Reject a case we don't handle yet

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23393 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-09-19 23:57:04 +00:00
parent 7e1ff8d2d9
commit 9c88d98162

View File

@ -897,7 +897,9 @@ HoistTerminator:
static bool FoldCondBranchOnPHI(BranchInst *BI) {
BasicBlock *BB = BI->getParent();
PHINode *PN = dyn_cast<PHINode>(BI->getCondition());
if (!PN || PN->getParent() != BB) return false;
// NOTE: we currently cannot transform this case if the PHI node is used
// outside of the block.
if (!PN || PN->getParent() != BB || !PN->hasOneUse()) return false;
// Degenerate case of a single entry PHI.
if (PN->getNumIncomingValues() == 1) {