Skip to content

Commit c76c64e

Browse files
Added an assert and removed the commutative from the shift.
1 parent 373f2a8 commit c76c64e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14325,10 +14325,11 @@ static bool checkAddiForShift(SDValue AddI, int64_t &AddConst,
1432514325

1432614326
APInt AddVal;
1432714327
SDValue SHLVal;
14328-
sd_match(AddI, m_Add(m_Value(SHLVal), m_ConstInt(AddVal)));
14328+
assert(sd_match(AddI, m_Add(m_Value(SHLVal), m_ConstInt(AddVal))) &&
14329+
"Expected an addi with a constant addition.");
1432914330

1433014331
APInt VShift;
14331-
if (!sd_match(SHLVal, m_c_BinOp(ISD::SHL, m_Value(), m_ConstInt(VShift))))
14332+
if (!sd_match(SHLVal, m_BinOp(ISD::SHL, m_Value(), m_ConstInt(VShift))))
1433214333
return false;
1433314334

1433414335
if (VShift.slt(1) || VShift.sgt(3))

0 commit comments

Comments
 (0)