mkazantsev requested review of this revision. mkazantsev added a comment. It seems that this patch is OK, it just revealed some existing bug in IndVar simplifier: it fails to forget loops at some point. https://reviews.llvm.org/D44461