summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-09-19 23:57:04 +0000
committerChris Lattner <sabre@nondot.org>2005-09-19 23:57:04 +0000
commit049cb4482ff89e90533fc78fc55fddb3f798d2c9 (patch)
treec9d5df266a7e367d572f1fd7b93c5c7a3b950958 /llvm/lib/Transforms/Utils
parenta160924d57b21c7eddba08f695e0ebe5beb139d3 (diff)
downloadbcm5719-llvm-049cb4482ff89e90533fc78fc55fddb3f798d2c9.tar.gz
bcm5719-llvm-049cb4482ff89e90533fc78fc55fddb3f798d2c9.zip
Reject a case we don't handle yet
llvm-svn: 23393
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index 08403aeca83..c0cb2f42b1e 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -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) {
OpenPOWER on IntegriCloud