[IndVars] Drop check for the validity of rewrite
authorRoman Lebedev <lebedev.ri@gmail.com>
Mon, 30 Aug 2021 09:00:26 +0000 (12:00 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Mon, 30 Aug 2021 09:06:58 +0000 (12:06 +0300)
commit7b0d59da9af4bf4eb8342cac579e42a818ac1ae7
tree65772119c937f1a92963bb0ed6f74d93b2731519
parentada219b13a2debc94cb252feb0dd987ef9290126
[IndVars] Drop check for the validity of rewrite

`isValidRewrite()` checks that the both the original SCEV,
and the rewrite SCEV have the same base pointer.
I //believe//, after all the recent SCEV improvements,
this invariant is already enforced by SCEV itself.

I originally tried changing it into an assert in D108043,
but that showed that it triggers on e.g. https://reviews.llvm.org/D108043#2946621,
where SCEV manages to forward the store to load,
test added.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D108655
llvm/lib/Transforms/Utils/LoopUtils.cpp
llvm/test/Transforms/IndVarSimplify/D108043.ll