[IRCE] Don't iterate on loops that were cloned out
authorSanjoy Das <sanjoy@playingwithpointers.com>
Sun, 14 Aug 2016 01:04:36 +0000 (01:04 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Sun, 14 Aug 2016 01:04:36 +0000 (01:04 +0000)
commit7a18a238c6368449f94eeace3f4813b9b8566cc6
tree4eecd3b3b2b81e6d607aac535a2a144478adf7ea
parent43fdc54303760237cf61198a6ba1da14524f2f0e
[IRCE] Don't iterate on loops that were cloned out

IRCE has the ability to further version pre-loops and post-loops that it
created, but this isn't useful at all.  This change teaches IRCE to
leave behind some metadata in the loops it creates (by cloning the main
loop) so that these new loops are not re-processed by IRCE.

Today this bug is hidden by another bug -- IRCE does not update LoopInfo
properly so the loop pass manager does not re-invoke IRCE on the loops
it split out.  However, once the latter is fixed the bug addressed in
this change causes IRCE to infinite-loop in some cases (e.g. it splits
out a pre-loop, a pre-pre-loop from that, a pre-pre-pre-loop from that
and so on).

llvm-svn: 278617
llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
llvm/test/Transforms/IRCE/unhandled.ll