diff --git a/llvm/lib/Target/Xtensa/XtensaISelLowering.cpp b/llvm/lib/Target/Xtensa/XtensaISelLowering.cpp index 5450222a7b2e1d..5865eb7b70b608 100644 --- a/llvm/lib/Target/Xtensa/XtensaISelLowering.cpp +++ b/llvm/lib/Target/Xtensa/XtensaISelLowering.cpp @@ -845,7 +845,7 @@ SDValue XtensaTargetLowering::LowerDYNAMIC_STACKALLOC(SDValue Op, SDValue SizeTmp = DAG.getNode(ISD::ADD, DL, VT, Size, DAG.getConstant(31, DL, MVT::i32)); SDValue SizeRoundUp = DAG.getNode(ISD::AND, DL, VT, SizeTmp, - DAG.getConstant(~31, DL, MVT::i32)); + DAG.getSignedConstant(~31, DL, MVT::i32)); unsigned SPReg = Xtensa::SP; SDValue SP = DAG.getCopyFromReg(Chain, DL, SPReg, VT); @@ -873,7 +873,7 @@ SDValue XtensaTargetLowering::LowerShiftLeftParts(SDValue Op, // Lo = 0 // Hi = Lo << (Shamt - register size) - SDValue MinusRegisterSize = DAG.getConstant(-32, DL, VT); + SDValue MinusRegisterSize = DAG.getSignedConstant(-32, DL, VT); SDValue ShamtMinusRegisterSize = DAG.getNode(ISD::ADD, DL, VT, Shamt, MinusRegisterSize); @@ -914,7 +914,7 @@ SDValue XtensaTargetLowering::LowerShiftRightParts(SDValue Op, // Hi = 0; unsigned ShiftRightOp = IsSRA ? ISD::SRA : ISD::SRL; - SDValue MinusRegisterSize = DAG.getConstant(-32, DL, VT); + SDValue MinusRegisterSize = DAG.getSignedConstant(-32, DL, VT); SDValue RegisterSizeMinus1 = DAG.getConstant(32 - 1, DL, VT); SDValue ShamtMinusRegisterSize = DAG.getNode(ISD::ADD, DL, VT, Shamt, MinusRegisterSize);