LoopRotate: Also rotate loops with multiple exits.
authorBenjamin Kramer <benny.kra@googlemail.com>
Thu, 30 Aug 2012 15:39:42 +0000 (15:39 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Thu, 30 Aug 2012 15:39:42 +0000 (15:39 +0000)
commitd70846ec1b79162d519620ddf07bcb7a64b65eb5
tree5c1607e51c17567cd462d90493ff17e3c12a6287
parentc81fe9cab545a93a61c059b1c2813f622aef43ae
LoopRotate: Also rotate loops with multiple exits.

The old PHI updating code in loop-rotate was replaced with SSAUpdater a while
ago, it has no problems with comples PHIs. What had to be fixed is detecting
whether a loop was already rotated and updating dominators when multiple exits
were present.

This change increases overall code size a bit, mostly due to additional loop
unrolling opportunities. Passes test-suite and selfhost with -verify-dom-info.
Fixes PR7447.

Thanks to Andy for the input on the domtree updating code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162912 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LoopRotation.cpp
test/Transforms/LoopRotate/multiple-exits.ll [new file with mode: 0644]