From: Chris Lattner Date: Mon, 19 Sep 2005 23:57:04 +0000 (+0000) Subject: Reject a case we don't handle yet X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9c88d9816246d260b37cdc689f313c56aec6941e;p=oota-llvm.git 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 --- diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index 08403aeca83..c0cb2f42b1e 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/lib/Transforms/Utils/SimplifyCFG.cpp @@ -897,7 +897,9 @@ HoistTerminator: static bool FoldCondBranchOnPHI(BranchInst *BI) { BasicBlock *BB = BI->getParent(); PHINode *PN = dyn_cast(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) {