diff options
author | Owen Anderson <resistor@mac.com> | 2006-07-19 05:45:14 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2006-07-19 05:45:14 +0000 |
commit | 2698a08c23828865c96adf48f7d6c5b5f616b521 (patch) | |
tree | 424f41a912feca741af34547aceebc7510e51fdc | |
parent | db5b9cfd8625282aa5e08daaa8c10dd99469f0d9 (diff) | |
download | external_llvm-2698a08c23828865c96adf48f7d6c5b5f616b521.zip external_llvm-2698a08c23828865c96adf48f7d6c5b5f616b521.tar.gz external_llvm-2698a08c23828865c96adf48f7d6c5b5f616b521.tar.bz2 |
Make LoopUnroll not die on LCSSA Phis. This makes lencod work again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29198 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/LoopUnroll.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/LoopUnroll.cpp b/lib/Transforms/Scalar/LoopUnroll.cpp index 4f2a0e0..6f7df42 100644 --- a/lib/Transforms/Scalar/LoopUnroll.cpp +++ b/lib/Transforms/Scalar/LoopUnroll.cpp @@ -269,6 +269,12 @@ bool LoopUnroll::visitLoop(Loop *L) { // FIXME: Should update dominator analyses + // Remove LCSSA Phis from the exit block + for (BasicBlock::iterator ExitInstr = LoopExit->begin(); + PHINode* PN = dyn_cast<PHINode>(ExitInstr); ++ExitInstr) { + PN->replaceAllUsesWith(PN->getOperand(0)); + PN->eraseFromParent(); + } // Now that everything is up-to-date that will be, we fold the loop block into // the preheader and exit block, updating our analyses as we go. |