aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Utils/SimplifyCFG.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp
index 09153ed..a8785fe 100644
--- a/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -691,8 +691,9 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
}
} else if (SwitchInst *SI = dyn_cast<SwitchInst>(BB->begin())) {
- if (FoldValueComparisonIntoPredecessors(SI))
- return SimplifyCFG(BB) || 1;
+ if (isValueEqualityComparison(SI))
+ if (FoldValueComparisonIntoPredecessors(SI))
+ return SimplifyCFG(BB) || 1;
} else if (BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator())) {
if (Value *CompVal = isValueEqualityComparison(BB->getTerminator())) {
// This block must be empty, except for the setcond inst, if it exists.