Fix the LoopUnroller to handle nontrivial loops and partial unrolling.
authorAndrew Trick <atrick@apple.com>
Wed, 10 Aug 2011 00:28:10 +0000 (00:28 +0000)
committerAndrew Trick <atrick@apple.com>
Wed, 10 Aug 2011 00:28:10 +0000 (00:28 +0000)
commitb1eede12818d91a32adac928c6fffcf6d2800dc0
tree4070b1152a0888c9b929e2e6779b19063e6e371f
parent33e57515b173baf572398fafeffcf4644c2a7381
Fix the LoopUnroller to handle nontrivial loops and partial unrolling.

These are not individual bug fixes. I had to rewrite a good chunk of
the unroller to make it sane. I think it was getting lucky on trivial
completely unrolled loops with no early exits. I included some fairly
simple unit tests for partial unrolling. I didn't do much stress
testing, so it may not be perfect, but should be usable now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137190 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/LoopInfo.h
lib/Transforms/Utils/LoopUnroll.cpp
test/Transforms/LoopUnroll/2011-08-08-PhiUpdate.ll [new file with mode: 0644]
test/Transforms/LoopUnroll/2011-08-09-PhiUpdate.ll [new file with mode: 0644]