Have loop-rotate simplify instructions (yay instsimplify!) as it clones
authorChris Lattner <sabre@nondot.org>
Sat, 8 Jan 2011 08:24:46 +0000 (08:24 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 8 Jan 2011 08:24:46 +0000 (08:24 +0000)
commitd9ec3572f3d0997348361334446f942194522127
tree485ac863b85c5c16384201857fe935ed24d10cf4
parentc3942eb95d10fac62c6b5227f344bcda3f578077
Have loop-rotate simplify instructions (yay instsimplify!) as it clones
them into the loop preheader, eliminating silly instructions like
"icmp i32 0, 100" in fixed tripcount loops.  This also better exposes the
bigger problem with loop rotate that I'd like to fix: once this has been
folded, the duplicated conditional branch *often* turns into an uncond branch.

Not aggressively handling this is pessimizing later loop optimizations
somethin' fierce by making "dominates all exit blocks" checks fail.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123060 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LoopRotation.cpp
test/Transforms/LoopRotate/phi-duplicate.ll