Skip to content

Commit 0f8eb7b

Browse files
committed
Combine two if conditions into one.
1 parent a86a72f commit 0f8eb7b

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3725,12 +3725,9 @@ static Value *foldSelectIntoAddConstant(SelectInst &SI,
37253725
m_OneUse(m_Instruction(FAdd)), m_Constant(C))) ||
37263726
match(&SI, m_Select(m_OneUse(m_FCmp(Pred, m_Value(X), m_Value(Z))),
37273727
m_Constant(C), m_OneUse(m_Instruction(FAdd))))) {
3728-
if (!match(Z, m_AnyZeroFP()))
3729-
return nullptr;
3730-
37313728
// Only these relational predicates can be transformed into maxnum/minnum
37323729
// intrinsic.
3733-
if (!CmpInst::isRelational(Pred))
3730+
if (!CmpInst::isRelational(Pred) || !match(Z, m_AnyZeroFP()))
37343731
return nullptr;
37353732

37363733
if (!match(FAdd, m_FAdd(m_Specific(X), m_Specific(C))))

0 commit comments

Comments
 (0)