Skip to content

Commit c6acb4e

Browse files
s-barannikovarsenm
authored andcommitted
[SDAG] Add getCALLSEQ_END overload taking uint64_ts
All in-tree targets pass pointer-sized ConstantSDNodes to the method. This overload reduced amount of boilerplate code a bit. This also makes getCALLSEQ_END consistent with getCALLSEQ_START, which already takes uint64_ts.
1 parent aafaa2f commit c6acb4e

24 files changed

+48
-103
lines changed

llvm/include/llvm/CodeGen/SelectionDAG.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,13 @@ class SelectionDAG {
978978
return getNode(ISD::CALLSEQ_END, DL, NodeTys, Ops);
979979
}
980980

981+
SDValue getCALLSEQ_END(SDValue Chain, uint64_t Size1, uint64_t Size2,
982+
SDValue Glue, const SDLoc &DL) {
983+
return getCALLSEQ_END(
984+
Chain, getIntPtrConstant(Size1, DL, /*isTarget=*/true),
985+
getIntPtrConstant(Size2, DL, /*isTarget=*/true), Glue, DL);
986+
}
987+
981988
/// Return true if the result of this operation is always undefined.
982989
bool isUndef(unsigned Opcode, ArrayRef<SDValue> Ops);
983990

llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,8 +1719,7 @@ void SelectionDAGLegalize::ExpandDYNAMIC_STACKALLOC(SDNode* Node,
17191719
DAG.getConstant(-Alignment.value(), dl, VT));
17201720
Chain = DAG.getCopyToReg(Chain, dl, SPReg, Tmp1); // Output chain
17211721

1722-
Tmp2 = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(0, dl, true),
1723-
DAG.getIntPtrConstant(0, dl, true), SDValue(), dl);
1722+
Tmp2 = DAG.getCALLSEQ_END(Chain, 0, 0, SDValue(), dl);
17241723

17251724
Results.push_back(Tmp1);
17261725
Results.push_back(Tmp2);

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9380,12 +9380,11 @@ void SelectionDAGBuilder::visitStackmap(const CallInst &CI) {
93809380

93819381
assert(CI.getType()->isVoidTy() && "Stackmap cannot return a value.");
93829382

9383-
SDValue Chain, InFlag, Callee, NullPtr;
9383+
SDValue Chain, InFlag, Callee;
93849384
SmallVector<SDValue, 32> Ops;
93859385

93869386
SDLoc DL = getCurSDLoc();
93879387
Callee = getValue(CI.getCalledOperand());
9388-
NullPtr = DAG.getIntPtrConstant(0, DL, true);
93899388

93909389
// The stackmap intrinsic only records the live variables (the arguments
93919390
// passed to it) and emits NOPS (if requested). Unlike the patchpoint
@@ -9428,7 +9427,7 @@ void SelectionDAGBuilder::visitStackmap(const CallInst &CI) {
94289427
Chain = DAG.getNode(ISD::STACKMAP, DL, NodeTys, Ops);
94299428
InFlag = Chain.getValue(1);
94309429

9431-
Chain = DAG.getCALLSEQ_END(Chain, NullPtr, NullPtr, InFlag, DL);
9430+
Chain = DAG.getCALLSEQ_END(Chain, 0, 0, InFlag, DL);
94329431

94339432
// Stackmaps don't generate values, so nothing goes into the NodeMap.
94349433

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7050,8 +7050,7 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
70507050
// we've carefully laid out the parameters so that when sp is reset they'll be
70517051
// in the correct location.
70527052
if (IsTailCall && !IsSibCall) {
7053-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(0, DL, true),
7054-
DAG.getIntPtrConstant(0, DL, true), InFlag, DL);
7053+
Chain = DAG.getCALLSEQ_END(Chain, 0, 0, InFlag, DL);
70557054
InFlag = Chain.getValue(1);
70567055
}
70577056

@@ -7142,9 +7141,7 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
71427141
uint64_t CalleePopBytes =
71437142
DoesCalleeRestoreStack(CallConv, TailCallOpt) ? alignTo(NumBytes, 16) : 0;
71447143

7145-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(NumBytes, DL, true),
7146-
DAG.getIntPtrConstant(CalleePopBytes, DL, true),
7147-
InFlag, DL);
7144+
Chain = DAG.getCALLSEQ_END(Chain, NumBytes, CalleePopBytes, InFlag, DL);
71487145
if (!Ins.empty())
71497146
InFlag = Chain.getValue(1);
71507147

@@ -12583,8 +12580,7 @@ AArch64TargetLowering::LowerDYNAMIC_STACKALLOC(SDValue Op,
1258312580
DAG.getConstant(-(uint64_t)Align->value(), dl, VT));
1258412581
Chain = DAG.getCopyToReg(Chain, dl, AArch64::SP, SP);
1258512582

12586-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(0, dl, true),
12587-
DAG.getIntPtrConstant(0, dl, true), SDValue(), dl);
12583+
Chain = DAG.getCALLSEQ_END(Chain, 0, 0, SDValue(), dl);
1258812584

1258912585
SDValue Ops[2] = {SP, Chain};
1259012586
return DAG.getMergeValues(Ops, dl);

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3296,10 +3296,7 @@ SDValue SITargetLowering::LowerCall(CallLoweringInfo &CLI,
32963296
// we've carefully laid out the parameters so that when sp is reset they'll be
32973297
// in the correct location.
32983298
if (IsTailCall && !IsSibCall) {
3299-
Chain = DAG.getCALLSEQ_END(Chain,
3300-
DAG.getTargetConstant(NumBytes, DL, MVT::i32),
3301-
DAG.getTargetConstant(0, DL, MVT::i32),
3302-
InFlag, DL);
3299+
Chain = DAG.getCALLSEQ_END(Chain, NumBytes, 0, InFlag, DL);
33033300
InFlag = Chain.getValue(1);
33043301
}
33053302

@@ -3354,9 +3351,7 @@ SDValue SITargetLowering::LowerCall(CallLoweringInfo &CLI,
33543351
InFlag = Call.getValue(1);
33553352

33563353
uint64_t CalleePopBytes = NumBytes;
3357-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getTargetConstant(0, DL, MVT::i32),
3358-
DAG.getTargetConstant(CalleePopBytes, DL, MVT::i32),
3359-
InFlag, DL);
3354+
Chain = DAG.getCALLSEQ_END(Chain, 0, CalleePopBytes, InFlag, DL);
33603355
if (!Ins.empty())
33613356
InFlag = Chain.getValue(1);
33623357

@@ -3411,9 +3406,7 @@ SDValue SITargetLowering::lowerDYNAMIC_STACKALLOCImpl(
34113406
}
34123407

34133408
Chain = DAG.getCopyToReg(Chain, dl, SPReg, Tmp1); // Output chain
3414-
Tmp2 = DAG.getCALLSEQ_END(
3415-
Chain, DAG.getIntPtrConstant(0, dl, true),
3416-
DAG.getIntPtrConstant(0, dl, true), SDValue(), dl);
3409+
Tmp2 = DAG.getCALLSEQ_END(Chain, 0, 0, SDValue(), dl);
34173410

34183411
return DAG.getMergeValues({Tmp1, Tmp2}, dl);
34193412
}

llvm/lib/Target/ARC/ARCISelLowering.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ SDValue ARCTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
288288

289289
// Get a count of how many bytes are to be pushed on the stack.
290290
unsigned NumBytes = RetCCInfo.getNextStackOffset();
291-
auto PtrVT = getPointerTy(DAG.getDataLayout());
292291

293292
Chain = DAG.getCALLSEQ_START(Chain, NumBytes, 0, dl);
294293

@@ -392,8 +391,7 @@ SDValue ARCTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
392391
Glue = Chain.getValue(1);
393392

394393
// Create the CALLSEQ_END node.
395-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getConstant(NumBytes, dl, PtrVT, true),
396-
DAG.getConstant(0, dl, PtrVT, true), Glue, dl);
394+
Chain = DAG.getCALLSEQ_END(Chain, NumBytes, 0, Glue, dl);
397395
Glue = Chain.getValue(1);
398396

399397
// Handle result values, copying them out of physregs into vregs that we

llvm/lib/Target/ARM/ARMISelLowering.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2778,8 +2778,7 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
27782778
// we've carefully laid out the parameters so that when sp is reset they'll be
27792779
// in the correct location.
27802780
if (isTailCall && !isSibCall) {
2781-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(0, dl, true),
2782-
DAG.getIntPtrConstant(0, dl, true), InFlag, dl);
2781+
Chain = DAG.getCALLSEQ_END(Chain, 0, 0, InFlag, dl);
27832782
InFlag = Chain.getValue(1);
27842783
}
27852784

@@ -2840,9 +2839,7 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
28402839
uint64_t CalleePopBytes =
28412840
canGuaranteeTCO(CallConv, TailCallOpt) ? alignTo(NumBytes, 16) : -1ULL;
28422841

2843-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(NumBytes, dl, true),
2844-
DAG.getIntPtrConstant(CalleePopBytes, dl, true),
2845-
InFlag, dl);
2842+
Chain = DAG.getCALLSEQ_END(Chain, NumBytes, CalleePopBytes, InFlag, dl);
28462843
if (!Ins.empty())
28472844
InFlag = Chain.getValue(1);
28482845

llvm/lib/Target/AVR/AVRISelLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,8 +1520,7 @@ SDValue AVRTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
15201520
InFlag = Chain.getValue(1);
15211521

15221522
// Create the CALLSEQ_END node.
1523-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(NumBytes, DL, true),
1524-
DAG.getIntPtrConstant(0, DL, true), InFlag, DL);
1523+
Chain = DAG.getCALLSEQ_END(Chain, NumBytes, 0, InFlag, DL);
15251524

15261525
if (!Ins.empty()) {
15271526
InFlag = Chain.getValue(1);

llvm/lib/Target/BPF/BPFISelLowering.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,7 @@ SDValue BPFTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
486486
InFlag = Chain.getValue(1);
487487

488488
// Create the CALLSEQ_END node.
489-
Chain = DAG.getCALLSEQ_END(
490-
Chain, DAG.getConstant(NumBytes, CLI.DL, PtrVT, true),
491-
DAG.getConstant(0, CLI.DL, PtrVT, true), InFlag, CLI.DL);
489+
Chain = DAG.getCALLSEQ_END(Chain, NumBytes, 0, InFlag, CLI.DL);
492490
InFlag = Chain.getValue(1);
493491

494492
// Handle result values, copying them out of physregs into vregs that we

llvm/lib/Target/CSKY/CSKYISelLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,7 @@ SDValue CSKYTargetLowering::LowerCall(CallLoweringInfo &CLI,
702702
Glue = Chain.getValue(1);
703703

704704
// Mark the end of the call, which is glued to the call itself.
705-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getConstant(NumBytes, DL, PtrVT, true),
706-
DAG.getConstant(0, DL, PtrVT, true), Glue, DL);
705+
Chain = DAG.getCALLSEQ_END(Chain, NumBytes, 0, Glue, DL);
707706
Glue = Chain.getValue(1);
708707

709708
// Assign locations to each value returned by this call.

llvm/lib/Target/Hexagon/HexagonISelLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,8 +612,7 @@ HexagonTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
612612
Glue = Chain.getValue(1);
613613

614614
// Create the CALLSEQ_END node.
615-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(NumBytes, dl, true),
616-
DAG.getIntPtrConstant(0, dl, true), Glue, dl);
615+
Chain = DAG.getCALLSEQ_END(Chain, NumBytes, 0, Glue, dl);
617616
Glue = Chain.getValue(1);
618617

619618
// Handle result values, copying them out of physregs into vregs that we

llvm/lib/Target/Lanai/LanaiISelLowering.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -761,11 +761,7 @@ SDValue LanaiTargetLowering::LowerCCCCallTo(
761761
InFlag = Chain.getValue(1);
762762

763763
// Create the CALLSEQ_END node.
764-
Chain = DAG.getCALLSEQ_END(
765-
Chain,
766-
DAG.getConstant(NumBytes, DL, getPointerTy(DAG.getDataLayout()), true),
767-
DAG.getConstant(0, DL, getPointerTy(DAG.getDataLayout()), true), InFlag,
768-
DL);
764+
Chain = DAG.getCALLSEQ_END(Chain, NumBytes, 0, InFlag, DL);
769765
InFlag = Chain.getValue(1);
770766

771767
// Handle result values, copying them out of physregs into vregs that we

llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,8 +1664,7 @@ LoongArchTargetLowering::LowerCall(CallLoweringInfo &CLI,
16641664
Glue = Chain.getValue(1);
16651665

16661666
// Mark the end of the call, which is glued to the call itself.
1667-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getConstant(NumBytes, DL, PtrVT, true),
1668-
DAG.getConstant(0, DL, PtrVT, true), Glue, DL);
1667+
Chain = DAG.getCALLSEQ_END(Chain, NumBytes, 0, Glue, DL);
16691668
Glue = Chain.getValue(1);
16701669

16711670
// Assign locations to each value returned by this call.

llvm/lib/Target/M68k/M68kISelLowering.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -765,9 +765,7 @@ SDValue M68kTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
765765
SmallVector<SDValue, 8> Ops;
766766

767767
if (!IsSibcall && IsTailCall) {
768-
Chain = DAG.getCALLSEQ_END(Chain,
769-
DAG.getIntPtrConstant(NumBytesToPop, DL, true),
770-
DAG.getIntPtrConstant(0, DL, true), InFlag, DL);
768+
Chain = DAG.getCALLSEQ_END(Chain, NumBytesToPop, 0, InFlag, DL);
771769
InFlag = Chain.getValue(1);
772770
}
773771

@@ -821,9 +819,8 @@ SDValue M68kTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
821819

822820
// Returns a flag for retval copy to use.
823821
if (!IsSibcall) {
824-
Chain = DAG.getCALLSEQ_END(
825-
Chain, DAG.getIntPtrConstant(NumBytesToPop, DL, true),
826-
DAG.getIntPtrConstant(NumBytesForCalleeToPop, DL, true), InFlag, DL);
822+
Chain = DAG.getCALLSEQ_END(Chain, NumBytesToPop, NumBytesForCalleeToPop,
823+
InFlag, DL);
827824
InFlag = Chain.getValue(1);
828825
}
829826

@@ -3241,8 +3238,7 @@ SDValue M68kTargetLowering::LowerDYNAMIC_STACKALLOC(SDValue Op,
32413238
Chain = DAG.getCopyToReg(Chain, DL, SPReg, Result); // Output chain
32423239
}
32433240

3244-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(0, DL, true),
3245-
DAG.getIntPtrConstant(0, DL, true), SDValue(), DL);
3241+
Chain = DAG.getCALLSEQ_END(Chain, 0, 0, SDValue(), DL);
32463242

32473243
SDValue Ops[2] = {Result, Chain};
32483244
return DAG.getMergeValues(Ops, DL);

llvm/lib/Target/MSP430/MSP430ISelLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -919,8 +919,7 @@ SDValue MSP430TargetLowering::LowerCCCCallTo(
919919
InFlag = Chain.getValue(1);
920920

921921
// Create the CALLSEQ_END node.
922-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getConstant(NumBytes, dl, PtrVT, true),
923-
DAG.getConstant(0, dl, PtrVT, true), InFlag, dl);
922+
Chain = DAG.getCALLSEQ_END(Chain, NumBytes, 0, InFlag, dl);
924923
InFlag = Chain.getValue(1);
925924

926925
// Handle result values, copying them out of physregs into vregs that we

llvm/lib/Target/Mips/MipsISelLowering.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3250,7 +3250,6 @@ MipsTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
32503250
// byval arguments to the stack.
32513251
unsigned StackAlignment = TFL->getStackAlignment();
32523252
NextStackOffset = alignTo(NextStackOffset, StackAlignment);
3253-
SDValue NextStackOffsetVal = DAG.getIntPtrConstant(NextStackOffset, DL, true);
32543253

32553254
if (!(IsTailCall || MemcpyInByVal))
32563255
Chain = DAG.getCALLSEQ_START(Chain, NextStackOffset, 0, DL);
@@ -3481,8 +3480,7 @@ MipsTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
34813480
// Create the CALLSEQ_END node in the case of where it is not a call to
34823481
// memcpy.
34833482
if (!(MemcpyInByVal)) {
3484-
Chain = DAG.getCALLSEQ_END(Chain, NextStackOffsetVal,
3485-
DAG.getIntPtrConstant(0, DL, true), InFlag, DL);
3483+
Chain = DAG.getCALLSEQ_END(Chain, NextStackOffset, 0, InFlag, DL);
34863484
InFlag = Chain.getValue(1);
34873485
}
34883486

llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,9 +1891,8 @@ SDValue NVPTXTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
18911891
}
18921892
}
18931893

1894-
Chain = DAG.getCALLSEQ_END(
1895-
Chain, DAG.getIntPtrConstant(UniqueCallSite, dl, true),
1896-
DAG.getIntPtrConstant(UniqueCallSite + 1, dl, true), InFlag, dl);
1894+
Chain =
1895+
DAG.getCALLSEQ_END(Chain, UniqueCallSite, UniqueCallSite + 1, InFlag, dl);
18971896
InFlag = Chain.getValue(1);
18981897

18991898
// Append ProxyReg instructions to the chain to make sure that `callseq_end`

llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5109,8 +5109,7 @@ PrepareTailCall(SelectionDAG &DAG, SDValue &InFlag, SDValue &Chain,
51095109
Chain = EmitTailCallStoreFPAndRetAddr(DAG, Chain, LROp, FPOp, SPDiff, dl);
51105110

51115111
// Emit callseq_end just before tailcall node.
5112-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(NumBytes, dl, true),
5113-
DAG.getIntPtrConstant(0, dl, true), InFlag, dl);
5112+
Chain = DAG.getCALLSEQ_END(Chain, NumBytes, 0, InFlag, dl);
51145113
InFlag = Chain.getValue(1);
51155114
}
51165115

@@ -5621,9 +5620,7 @@ SDValue PPCTargetLowering::FinishCall(
56215620
? NumBytes
56225621
: 0;
56235622

5624-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(NumBytes, dl, true),
5625-
DAG.getIntPtrConstant(BytesCalleePops, dl, true),
5626-
Glue, dl);
5623+
Chain = DAG.getCALLSEQ_END(Chain, NumBytes, BytesCalleePops, Glue, dl);
56275624
Glue = Chain.getValue(1);
56285625

56295626
return LowerCallResult(Chain, Glue, CFlags.CallConv, CFlags.IsVarArg, Ins, dl,

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12054,10 +12054,7 @@ SDValue RISCVTargetLowering::LowerCall(CallLoweringInfo &CLI,
1205412054
Glue = Chain.getValue(1);
1205512055

1205612056
// Mark the end of the call, which is glued to the call itself.
12057-
Chain = DAG.getCALLSEQ_END(Chain,
12058-
DAG.getConstant(NumBytes, DL, PtrVT, true),
12059-
DAG.getConstant(0, DL, PtrVT, true),
12060-
Glue, DL);
12057+
Chain = DAG.getCALLSEQ_END(Chain, NumBytes, 0, Glue, DL);
1206112058
Glue = Chain.getValue(1);
1206212059

1206312060
// Assign locations to each value returned by this call.

llvm/lib/Target/Sparc/SparcISelLowering.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,8 +1018,7 @@ SparcTargetLowering::LowerCall_32(TargetLowering::CallLoweringInfo &CLI,
10181018
Chain = DAG.getNode(SPISD::CALL, dl, NodeTys, Ops);
10191019
InFlag = Chain.getValue(1);
10201020

1021-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(ArgsSize, dl, true),
1022-
DAG.getIntPtrConstant(0, dl, true), InFlag, dl);
1021+
Chain = DAG.getCALLSEQ_END(Chain, ArgsSize, 0, InFlag, dl);
10231022
InFlag = Chain.getValue(1);
10241023

10251024
// Assign locations to each value returned by this call.
@@ -1324,8 +1323,7 @@ SparcTargetLowering::LowerCall_64(TargetLowering::CallLoweringInfo &CLI,
13241323
InGlue = Chain.getValue(1);
13251324

13261325
// Revert the stack pointer immediately after the call.
1327-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(ArgsSize, DL, true),
1328-
DAG.getIntPtrConstant(0, DL, true), InGlue, DL);
1326+
Chain = DAG.getCALLSEQ_END(Chain, ArgsSize, 0, InGlue, DL);
13291327
InGlue = Chain.getValue(1);
13301328

13311329
// Now extract the return values. This is more or less the same as
@@ -2125,8 +2123,7 @@ SDValue SparcTargetLowering::LowerGlobalTLSAddress(SDValue Op,
21252123
InFlag};
21262124
Chain = DAG.getNode(SPISD::TLS_CALL, DL, NodeTys, Ops);
21272125
InFlag = Chain.getValue(1);
2128-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(1, DL, true),
2129-
DAG.getIntPtrConstant(0, DL, true), InFlag, DL);
2126+
Chain = DAG.getCALLSEQ_END(Chain, 1, 0, InFlag, DL);
21302127
InFlag = Chain.getValue(1);
21312128
SDValue Ret = DAG.getCopyFromReg(Chain, DL, SP::O0, PtrVT, InFlag);
21322129

llvm/lib/Target/SystemZ/SystemZISelLowering.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,10 +1854,7 @@ SystemZTargetLowering::LowerCall(CallLoweringInfo &CLI,
18541854
Glue = Chain.getValue(1);
18551855

18561856
// Mark the end of the call, which is glued to the call itself.
1857-
Chain = DAG.getCALLSEQ_END(Chain,
1858-
DAG.getConstant(NumBytes, DL, PtrVT, true),
1859-
DAG.getConstant(0, DL, PtrVT, true),
1860-
Glue, DL);
1857+
Chain = DAG.getCALLSEQ_END(Chain, NumBytes, 0, Glue, DL);
18611858
Glue = Chain.getValue(1);
18621859

18631860
// Assign locations to each value returned by this call.

llvm/lib/Target/VE/VEISelLowering.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -768,8 +768,7 @@ SDValue VETargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
768768
InGlue = Chain.getValue(1);
769769

770770
// Revert the stack pointer immediately after the call.
771-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(ArgsSize, DL, true),
772-
DAG.getIntPtrConstant(0, DL, true), InGlue, DL);
771+
Chain = DAG.getCALLSEQ_END(Chain, ArgsSize, 0, InGlue, DL);
773772
InGlue = Chain.getValue(1);
774773

775774
// Now extract the return values. This is more or less the same as
@@ -1274,9 +1273,7 @@ VETargetLowering::lowerToTLSGeneralDynamicModel(SDValue Op,
12741273
Chain = DAG.getCALLSEQ_START(Chain, 64, 0, DL);
12751274
SDValue Args[] = {Chain, Label, DAG.getRegisterMask(Mask), Chain.getValue(1)};
12761275
Chain = DAG.getNode(VEISD::GETTLSADDR, DL, NodeTys, Args);
1277-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(64, DL, true),
1278-
DAG.getIntPtrConstant(0, DL, true),
1279-
Chain.getValue(1), DL);
1276+
Chain = DAG.getCALLSEQ_END(Chain, 64, 0, Chain.getValue(1), DL);
12801277
Chain = DAG.getCopyFromReg(Chain, DL, VE::SX0, PtrVT, Chain.getValue(1));
12811278

12821279
// GETTLSADDR will be codegen'ed as call. Inform MFI that function has calls.
@@ -1680,8 +1677,7 @@ SDValue VETargetLowering::lowerDYNAMIC_STACKALLOC(SDValue Op,
16801677
DAG.getConstant(~(Alignment->value() - 1ULL), DL, VT));
16811678
}
16821679
// Chain = Result.getValue(1);
1683-
Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(0, DL, true),
1684-
DAG.getIntPtrConstant(0, DL, true), SDValue(), DL);
1680+
Chain = DAG.getCALLSEQ_END(Chain, 0, 0, SDValue(), DL);
16851681

16861682
SDValue Ops[2] = {Result, Chain};
16871683
return DAG.getMergeValues(Ops, DL);

0 commit comments

Comments
 (0)