Skip to content

Commit f677b6a

Browse files
AZero13dtcxzyw
andcommitted
Update InstCombineSelect.cpp
Co-authored-by: Yingwei Zheng <[email protected]>
1 parent f99a7b1 commit f677b6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ static Value *canonicalizeSaturatedAddSigned(ICmpInst *Cmp, Value *TVal,
12061206
return nullptr;
12071207

12081208
if (match(Cmp0, m_NSWSub(m_MaxSignedValue(), m_Value(X))) &&
1209-
match(FVal, m_c_Add(m_Specific(X), m_Value(Y))) && Y == Cmp1) {
1209+
match(FVal, m_c_Add(m_Specific(X), m_Specific(Cmp1)))) {
12101210
// (INT_MAX - X s< Y) ? INT_MAX : (X + Y) --> sadd.sat(X, Y)
12111211
// (INT_MAX - X s< Y) ? INT_MAX : (Y + X) --> sadd.sat(X, Y)
12121212
return Builder.CreateBinaryIntrinsic(Intrinsic::sadd_sat, X, Y);

0 commit comments

Comments
 (0)