Skip to content

Commit 289325d

Browse files
committed
fixup! [SimplifyCFG] Handle that first matched eq cond in if chain can be Extra condition.
1 parent 3153ab8 commit 289325d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Utils/SimplifyCFG.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ struct ConstantComparesGatherer {
592592
/// Try to set the current value used for the comparison, it succeeds only if
593593
/// it wasn't set before or if the new value is the same as the old one
594594
bool setValueOnce(Value *NewVal) {
595-
if (IgnoreFirstMatch && NewVal) {
595+
if (IgnoreFirstMatch) {
596596
IgnoreFirstMatch = false;
597597
return false;
598598
}
@@ -601,7 +601,7 @@ struct ConstantComparesGatherer {
601601
return false;
602602
}
603603
CompValue = NewVal;
604-
return (CompValue != nullptr);
604+
return true;
605605
}
606606

607607
/// Try to match Instruction "I" as a comparison against a constant and

0 commit comments

Comments
 (0)