diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-12-13 05:34:18 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-12-13 05:34:18 +0000 |
| commit | cb570f87e5fa150d60668119f8e9d985ade1d070 (patch) | |
| tree | 7c3157f092c135a01fb969cfb7d41be28d96c7fe /llvm/lib/Transforms | |
| parent | a6db741f3d2596330798a0e07190cdf293d1b456 (diff) | |
| download | bcm5719-llvm-cb570f87e5fa150d60668119f8e9d985ade1d070.tar.gz bcm5719-llvm-cb570f87e5fa150d60668119f8e9d985ade1d070.zip | |
fix a bug in r121680 that upset the various buildbots.
llvm-svn: 121687
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index e16125e8326..9187a0f1752 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1899,6 +1899,13 @@ static bool SimplifyBranchOnICmpChain(BranchInst *BI, const TargetData *TD) { BranchInst::Create(EdgeBB, NewBB, ExtraCase, OldTI); OldTI->eraseFromParent(); + + // If there are PHI nodes in EdgeBB, then we need to add a new entry to them + // for the edge we just added. + for (BasicBlock::iterator I = EdgeBB->begin(); isa<PHINode>(I); ++I) { + PHINode *PN = cast<PHINode>(I); + PN->addIncoming(PN->getIncomingValueForBlock(NewBB), BB); + } BB = NewBB; } |

