@@ -1444,15 +1444,15 @@ void SystemZTargetLowering::LowerAsmOperandForConstraint(
14441444 case ' K' : // Signed 16-bit constant
14451445 if (auto *C = dyn_cast<ConstantSDNode>(Op))
14461446 if (isInt<16 >(C->getSExtValue ()))
1447- Ops.push_back (DAG.getTargetConstant (C-> getSExtValue (), SDLoc (Op),
1448- Op.getValueType ()));
1447+ Ops.push_back (DAG.getSignedTargetConstant (
1448+ C-> getSExtValue (), SDLoc (Op), Op.getValueType ()));
14491449 return ;
14501450
14511451 case ' L' : // Signed 20-bit displacement (on all targets we support)
14521452 if (auto *C = dyn_cast<ConstantSDNode>(Op))
14531453 if (isInt<20 >(C->getSExtValue ()))
1454- Ops.push_back (DAG.getTargetConstant (C-> getSExtValue (), SDLoc (Op),
1455- Op.getValueType ()));
1454+ Ops.push_back (DAG.getSignedTargetConstant (
1455+ C-> getSExtValue (), SDLoc (Op), Op.getValueType ()));
14561456 return ;
14571457
14581458 case ' M' : // 0x7fffffff
@@ -2578,7 +2578,7 @@ static void adjustSubwordCmp(SelectionDAG &DAG, const SDLoc &DL,
25782578 // Make sure that the second operand is an i32 with the right value.
25792579 if (C.Op1 .getValueType () != MVT::i32 ||
25802580 Value != ConstOp1->getZExtValue ())
2581- C.Op1 = DAG.getConstant (Value, DL, MVT::i32 );
2581+ C.Op1 = DAG.getConstant (( uint32_t ) Value, DL, MVT::i32 );
25822582}
25832583
25842584// Return true if Op is either an unextended load, or a load suitable
@@ -3410,7 +3410,7 @@ SDValue SystemZTargetLowering::lowerVectorSETCC(SelectionDAG &DAG,
34103410 }
34113411 if (Invert) {
34123412 SDValue Mask =
3413- DAG.getSplatBuildVector (VT, DL, DAG.getConstant (- 1 , DL, MVT::i64 ));
3413+ DAG.getSplatBuildVector (VT, DL, DAG.getAllOnesConstant ( DL, MVT::i64 ));
34143414 Cmp = DAG.getNode (ISD::XOR, DL, VT, Cmp, Mask);
34153415 }
34163416 if (Chain && Chain.getNode () != Cmp.getNode ()) {
@@ -3571,7 +3571,7 @@ SDValue SystemZTargetLowering::lowerGlobalAddress(GlobalAddressSDNode *Node,
35713571 // addition for it.
35723572 if (Offset != 0 )
35733573 Result = DAG.getNode (ISD::ADD, DL, PtrVT, Result,
3574- DAG.getConstant (Offset, DL, PtrVT));
3574+ DAG.getSignedConstant (Offset, DL, PtrVT));
35753575
35763576 return Result;
35773577}
@@ -3834,7 +3834,7 @@ SDValue SystemZTargetLowering::lowerRETURNADDR(SDValue Op,
38343834 const auto *TFL = Subtarget.getFrameLowering <SystemZFrameLowering>();
38353835 int Offset = TFL->getReturnAddressOffset (MF);
38363836 SDValue Ptr = DAG.getNode (ISD::ADD, DL, PtrVT, FrameAddr,
3837- DAG.getConstant (Offset, DL, PtrVT));
3837+ DAG.getSignedConstant (Offset, DL, PtrVT));
38383838 return DAG.getLoad (PtrVT, DL, DAG.getEntryNode (), Ptr,
38393839 MachinePointerInfo ());
38403840 }
@@ -4584,7 +4584,7 @@ static void getCSAddressAndShifts(SDValue Addr, SelectionDAG &DAG, SDLoc DL,
45844584
45854585 // Get the address of the containing word.
45864586 AlignedAddr = DAG.getNode (ISD::AND, DL, PtrVT, Addr,
4587- DAG.getConstant (-4 , DL, PtrVT));
4587+ DAG.getSignedConstant (-4 , DL, PtrVT));
45884588
45894589 // Get the number of bits that the word must be rotated left in order
45904590 // to bring the field to the top bits of a GR32.
@@ -4623,7 +4623,8 @@ SDValue SystemZTargetLowering::lowerATOMIC_LOAD_OP(SDValue Op,
46234623 if (Opcode == SystemZISD::ATOMIC_LOADW_SUB)
46244624 if (auto *Const = dyn_cast<ConstantSDNode>(Src2)) {
46254625 Opcode = SystemZISD::ATOMIC_LOADW_ADD;
4626- Src2 = DAG.getConstant (-Const->getSExtValue (), DL, Src2.getValueType ());
4626+ Src2 = DAG.getSignedConstant (-Const->getSExtValue (), DL,
4627+ Src2.getValueType ());
46274628 }
46284629
46294630 SDValue AlignedAddr, BitShift, NegBitShift;
0 commit comments