[LoopInterchange] Preserve ScalarEvolution, by forgetting about interchanged loops.
authorFlorian Hahn <florian.hahn@arm.com>
Fri, 14 Sep 2018 07:50:20 +0000 (07:50 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Fri, 14 Sep 2018 07:50:20 +0000 (07:50 +0000)
commit3afb974aa5e8c30eb10679afbaa6db1922b0599c
tree59040c4b0ba446738347419863a2e7f30fc8283d
parent2fa5c2833910071684403ef60ac0b82180e197bc
[LoopInterchange] Preserve ScalarEvolution, by forgetting about interchanged loops.

As preparation for LoopInterchange becoming a loop pass, it needs to
preserve ScalarEvolution. Even though interchanging should not change
the trip count of the loop, it modifies loop entry, latch and exit
blocks.

I added -verify-scev to some loop interchange tests, but the verification does
not catch problems caused by missing invalidation of SE in loop interchange, as
the trip counts themselves do not change. So there might be potential to
make the SE verification covering more stuff in the future.

Reviewers: mkazantsev, efriedma, karthikthecool

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D52026

llvm-svn: 342209
llvm/lib/Transforms/Scalar/LoopInterchange.cpp
llvm/test/Transforms/LoopInterchange/interchangeable.ll
llvm/test/Transforms/LoopInterchange/phi-ordering.ll