OSDN Git Service

Don't recompute LCSSA after loop-unrolling when possible.
authorMichael Zolotukhin <mzolotukhin@apple.com>
Sat, 14 Nov 2015 05:51:41 +0000 (05:51 +0000)
committerMichael Zolotukhin <mzolotukhin@apple.com>
Sat, 14 Nov 2015 05:51:41 +0000 (05:51 +0000)
commit09dcb16d132ccbb3aaaf4cba5839c990e3101641
tree6019239a72f79107a62e0daf539fc135ab8816c6
parentff528b6f03a836b22cba331c08621a14777d49ba
Don't recompute LCSSA after loop-unrolling when possible.

Summary:
Currently we always recompute LCSSA for outer loops after unrolling an
inner loop. That leads to compile time problem when we have big loop
nests, and we can solve it by avoiding unnecessary work. For instance,
if w eonly do partial unrolling, we don't break LCSSA, so we don't need
to rebuild it. Also, if all exits from the inner loop are inside the
enclosing loop, then complete unrolling won't break LCSSA either.

I replaced unconditional LCSSA recomputation with conditional recomputation +
unconditional assert and added several tests, which were failing when I
experimented with it.

Soon I plan to follow up with a similar patch for recalculation of dominators
tree.

Reviewers: hfinkel, dexonsmith, bogner, joker.eph, chandlerc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D14526

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253126 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/LoopUnroll.cpp
test/Transforms/LoopUnroll/rebuild_lcssa.ll [new file with mode: 0644]