We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 684fa5a commit a078f47Copy full SHA for a078f47
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -691,8 +691,9 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
691
}
692
693
} else if (SwitchInst *SI = dyn_cast<SwitchInst>(BB->begin())) {
694
- if (FoldValueComparisonIntoPredecessors(SI))
695
- return SimplifyCFG(BB) || 1;
+ if (isValueEqualityComparison(SI))
+ if (FoldValueComparisonIntoPredecessors(SI))
696
+ return SimplifyCFG(BB) || 1;
697
} else if (BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator())) {
698
if (Value *CompVal = isValueEqualityComparison(BB->getTerminator())) {
699
// This block must be empty, except for the setcond inst, if it exists.
0 commit comments