mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 12:12:47 +01:00
Add an assertion.
llvm-svn: 29199
This commit is contained in:
parent
7d68cbc39a
commit
3d84b9e0cc
@ -272,6 +272,8 @@ bool LoopUnroll::visitLoop(Loop *L) {
|
|||||||
// Remove LCSSA Phis from the exit block
|
// Remove LCSSA Phis from the exit block
|
||||||
for (BasicBlock::iterator ExitInstr = LoopExit->begin();
|
for (BasicBlock::iterator ExitInstr = LoopExit->begin();
|
||||||
PHINode* PN = dyn_cast<PHINode>(ExitInstr); ++ExitInstr) {
|
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->replaceAllUsesWith(PN->getOperand(0));
|
||||||
PN->eraseFromParent();
|
PN->eraseFromParent();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user