Skip to content

Commit 0f4ea1a

Browse files
committed
review comment
1 parent a885dfc commit 0f4ea1a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13877,12 +13877,11 @@ static SDValue tryFoldMADwithSRL(SelectionDAG &DAG, const SDLoc &SL,
1387713877
if (ShiftVal->getAsZExtVal() != 32)
1387813878
return SDValue();
1387913879

13880-
APInt Const = dyn_cast<ConstantSDNode>(MulRHS.getNode())->getAPIntValue();
13881-
if (!Const.isNegative() || !Const.isSignedIntN(33))
13880+
uint64_t Const = dyn_cast<ConstantSDNode>(MulRHS.getNode())->getZExtValue();
13881+
if (Hi_32(Const) != -1)
1388213882
return SDValue();
1388313883

13884-
SDValue ConstMul =
13885-
DAG.getConstant(Const.getZExtValue() & 0x00000000FFFFFFFF, SL, MVT::i32);
13884+
SDValue ConstMul = DAG.getConstant(Const & 0x00000000FFFFFFFF, SL, MVT::i32);
1388613885
return getMad64_32(DAG, SL, MVT::i64,
1388713886
DAG.getNode(ISD::TRUNCATE, SL, MVT::i32, MulLHS), ConstMul,
1388813887
DAG.getZeroExtendInReg(AddRHS, SL, MVT::i32), false);

0 commit comments

Comments
 (0)