Reject a case we don't handle yet

llvm-svn: 23393
This commit is contained in:
Chris Lattner 2005-09-19 23:57:04 +00:00
parent a160924d57
commit 049cb4482f
1 changed files with 3 additions and 1 deletions

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) {