Add an assertion.
authorOwen Anderson <resistor@mac.com>
Wed, 19 Jul 2006 05:48:45 +0000 (05:48 +0000)
committerOwen Anderson <resistor@mac.com>
Wed, 19 Jul 2006 05:48:45 +0000 (05:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29199 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopUnroll.cpp

index 6f7df426f16c17a32628b67f0d04cec92399cc8a..98b5b62e4b4d153f1818141a54fe35c8a79a6512 100644 (file)
@@ -272,6 +272,8 @@ bool LoopUnroll::visitLoop(Loop *L) {
   // Remove LCSSA Phis from the exit block
   for (BasicBlock::iterator ExitInstr = LoopExit->begin();
        PHINode* PN = dyn_cast<PHINode>(ExitInstr); ++ExitInstr) {
+    assert(PN->getNumIncomingValues() == 1
+           && "Block should only have one pred, so Phi's must be LCSSA");
     PN->replaceAllUsesWith(PN->getOperand(0));
     PN->eraseFromParent();
   }