@@ -2576,18 +2576,12 @@ bool SelectionDAG::expandMultipleResultFPLibCall(
2576
2576
}
2577
2577
2578
2578
TargetLowering::ArgListTy Args;
2579
- auto AddArgListEntry = [&](SDValue Node, Type *Ty) {
2580
- TargetLowering::ArgListEntry Entry{};
2581
- Entry.Ty = Ty;
2582
- Entry.Node = Node;
2583
- Args.push_back(Entry);
2584
- };
2585
2579
2586
2580
// Pass the arguments.
2587
2581
for (const SDValue &Op : Node->op_values()) {
2588
2582
EVT ArgVT = Op.getValueType();
2589
2583
Type *ArgTy = ArgVT.getTypeForEVT(Ctx);
2590
- AddArgListEntry (Op, ArgTy);
2584
+ Args.emplace_back (Op, ArgTy);
2591
2585
}
2592
2586
2593
2587
// Pass the output pointers.
@@ -2599,7 +2593,7 @@ bool SelectionDAG::expandMultipleResultFPLibCall(
2599
2593
EVT ResVT = Node->getValueType(ResNo);
2600
2594
SDValue ResultPtr = ST ? ST->getBasePtr() : CreateStackTemporary(ResVT);
2601
2595
ResultPtrs[ResNo] = ResultPtr;
2602
- AddArgListEntry (ResultPtr, PointerTy);
2596
+ Args.emplace_back (ResultPtr, PointerTy);
2603
2597
}
2604
2598
2605
2599
SDLoc DL(Node);
@@ -2608,7 +2602,7 @@ bool SelectionDAG::expandMultipleResultFPLibCall(
2608
2602
if (VD && VD->isMasked()) {
2609
2603
EVT MaskVT = TLI->getSetCCResultType(getDataLayout(), Ctx, VT);
2610
2604
SDValue Mask = getBoolConstant(true, DL, MaskVT, VT);
2611
- AddArgListEntry (Mask, MaskVT.getTypeForEVT(Ctx));
2605
+ Args.emplace_back (Mask, MaskVT.getTypeForEVT(Ctx));
2612
2606
}
2613
2607
2614
2608
Type *RetType = CallRetResNo.has_value()
@@ -9019,18 +9013,11 @@ SelectionDAG::getMemcmp(SDValue Chain, const SDLoc &dl, SDValue Mem0,
9019
9013
if (!LibCallName)
9020
9014
return {};
9021
9015
9022
- // Emit a library call.
9023
- auto GetEntry = [](Type *Ty, SDValue &SDV) {
9024
- TargetLowering::ArgListEntry E;
9025
- E.Ty = Ty;
9026
- E.Node = SDV;
9027
- return E;
9028
- };
9029
-
9030
9016
PointerType *PT = PointerType::getUnqual(*getContext());
9031
9017
TargetLowering::ArgListTy Args = {
9032
- GetEntry(PT, Mem0), GetEntry(PT, Mem1),
9033
- GetEntry(getDataLayout().getIntPtrType(*getContext()), Size)};
9018
+ {Mem0, PT},
9019
+ {Mem1, PT},
9020
+ {Size, getDataLayout().getIntPtrType(*getContext())}};
9034
9021
9035
9022
TargetLowering::CallLoweringInfo CLI(*this);
9036
9023
bool IsTailCall = false;
@@ -9101,13 +9088,10 @@ SDValue SelectionDAG::getMemcpy(
9101
9088
9102
9089
// Emit a library call.
9103
9090
TargetLowering::ArgListTy Args;
9104
- TargetLowering::ArgListEntry Entry;
9105
- Entry.Ty = PointerType::getUnqual(*getContext());
9106
- Entry.Node = Dst; Args.push_back(Entry);
9107
- Entry.Node = Src; Args.push_back(Entry);
9108
-
9109
- Entry.Ty = getDataLayout().getIntPtrType(*getContext());
9110
- Entry.Node = Size; Args.push_back(Entry);
9091
+ Type *PtrTy = PointerType::getUnqual(*getContext());
9092
+ Args.emplace_back(Dst, PtrTy);
9093
+ Args.emplace_back(Src, PtrTy);
9094
+ Args.emplace_back(Size, getDataLayout().getIntPtrType(*getContext()));
9111
9095
// FIXME: pass in SDLoc
9112
9096
TargetLowering::CallLoweringInfo CLI(*this);
9113
9097
bool IsTailCall = false;
@@ -9145,17 +9129,10 @@ SDValue SelectionDAG::getAtomicMemcpy(SDValue Chain, const SDLoc &dl,
9145
9129
MachinePointerInfo SrcPtrInfo) {
9146
9130
// Emit a library call.
9147
9131
TargetLowering::ArgListTy Args;
9148
- TargetLowering::ArgListEntry Entry;
9149
- Entry.Ty = getDataLayout().getIntPtrType(*getContext());
9150
- Entry.Node = Dst;
9151
- Args.push_back(Entry);
9152
-
9153
- Entry.Node = Src;
9154
- Args.push_back(Entry);
9155
-
9156
- Entry.Ty = SizeTy;
9157
- Entry.Node = Size;
9158
- Args.push_back(Entry);
9132
+ Type *ArgTy = getDataLayout().getIntPtrType(*getContext());
9133
+ Args.emplace_back(Dst, ArgTy);
9134
+ Args.emplace_back(Src, ArgTy);
9135
+ Args.emplace_back(Size, SizeTy);
9159
9136
9160
9137
RTLIB::Libcall LibraryCall =
9161
9138
RTLIB::getMEMCPY_ELEMENT_UNORDERED_ATOMIC(ElemSz);
@@ -9218,13 +9195,10 @@ SDValue SelectionDAG::getMemmove(SDValue Chain, const SDLoc &dl, SDValue Dst,
9218
9195
9219
9196
// Emit a library call.
9220
9197
TargetLowering::ArgListTy Args;
9221
- TargetLowering::ArgListEntry Entry;
9222
- Entry.Ty = PointerType::getUnqual(*getContext());
9223
- Entry.Node = Dst; Args.push_back(Entry);
9224
- Entry.Node = Src; Args.push_back(Entry);
9225
-
9226
- Entry.Ty = getDataLayout().getIntPtrType(*getContext());
9227
- Entry.Node = Size; Args.push_back(Entry);
9198
+ Type *PtrTy = PointerType::getUnqual(*getContext());
9199
+ Args.emplace_back(Dst, PtrTy);
9200
+ Args.emplace_back(Src, PtrTy);
9201
+ Args.emplace_back(Size, getDataLayout().getIntPtrType(*getContext()));
9228
9202
// FIXME: pass in SDLoc
9229
9203
TargetLowering::CallLoweringInfo CLI(*this);
9230
9204
@@ -9262,17 +9236,10 @@ SDValue SelectionDAG::getAtomicMemmove(SDValue Chain, const SDLoc &dl,
9262
9236
MachinePointerInfo SrcPtrInfo) {
9263
9237
// Emit a library call.
9264
9238
TargetLowering::ArgListTy Args;
9265
- TargetLowering::ArgListEntry Entry;
9266
- Entry.Ty = getDataLayout().getIntPtrType(*getContext());
9267
- Entry.Node = Dst;
9268
- Args.push_back(Entry);
9269
-
9270
- Entry.Node = Src;
9271
- Args.push_back(Entry);
9272
-
9273
- Entry.Ty = SizeTy;
9274
- Entry.Node = Size;
9275
- Args.push_back(Entry);
9239
+ Type *IntPtrTy = getDataLayout().getIntPtrType(*getContext());
9240
+ Args.emplace_back(Dst, IntPtrTy);
9241
+ Args.emplace_back(Src, IntPtrTy);
9242
+ Args.emplace_back(Size, SizeTy);
9276
9243
9277
9244
RTLIB::Libcall LibraryCall =
9278
9245
RTLIB::getMEMMOVE_ELEMENT_UNORDERED_ATOMIC(ElemSz);
@@ -9349,28 +9316,20 @@ SDValue SelectionDAG::getMemset(SDValue Chain, const SDLoc &dl, SDValue Dst,
9349
9316
9350
9317
const char *BzeroName = getTargetLoweringInfo().getLibcallName(RTLIB::BZERO);
9351
9318
9352
- // Helper function to create an Entry from Node and Type.
9353
- const auto CreateEntry = [](SDValue Node, Type *Ty) {
9354
- TargetLowering::ArgListEntry Entry;
9355
- Entry.Node = Node;
9356
- Entry.Ty = Ty;
9357
- return Entry;
9358
- };
9359
-
9360
9319
bool UseBZero = isNullConstant(Src) && BzeroName;
9361
9320
// If zeroing out and bzero is present, use it.
9362
9321
if (UseBZero) {
9363
9322
TargetLowering::ArgListTy Args;
9364
- Args.push_back(CreateEntry( Dst, PointerType::getUnqual(Ctx) ));
9365
- Args.push_back(CreateEntry( Size, DL.getIntPtrType(Ctx) ));
9323
+ Args.emplace_back( Dst, PointerType::getUnqual(Ctx));
9324
+ Args.emplace_back( Size, DL.getIntPtrType(Ctx));
9366
9325
CLI.setLibCallee(
9367
9326
TLI->getLibcallCallingConv(RTLIB::BZERO), Type::getVoidTy(Ctx),
9368
9327
getExternalSymbol(BzeroName, TLI->getPointerTy(DL)), std::move(Args));
9369
9328
} else {
9370
9329
TargetLowering::ArgListTy Args;
9371
- Args.push_back(CreateEntry( Dst, PointerType::getUnqual(Ctx) ));
9372
- Args.push_back(CreateEntry( Src, Src.getValueType().getTypeForEVT(Ctx) ));
9373
- Args.push_back(CreateEntry( Size, DL.getIntPtrType(Ctx) ));
9330
+ Args.emplace_back( Dst, PointerType::getUnqual(Ctx));
9331
+ Args.emplace_back( Src, Src.getValueType().getTypeForEVT(Ctx));
9332
+ Args.emplace_back( Size, DL.getIntPtrType(Ctx));
9374
9333
CLI.setLibCallee(TLI->getLibcallCallingConv(RTLIB::MEMSET),
9375
9334
Dst.getValueType().getTypeForEVT(Ctx),
9376
9335
getExternalSymbol(TLI->getLibcallName(RTLIB::MEMSET),
@@ -9399,18 +9358,9 @@ SDValue SelectionDAG::getAtomicMemset(SDValue Chain, const SDLoc &dl,
9399
9358
MachinePointerInfo DstPtrInfo) {
9400
9359
// Emit a library call.
9401
9360
TargetLowering::ArgListTy Args;
9402
- TargetLowering::ArgListEntry Entry;
9403
- Entry.Ty = getDataLayout().getIntPtrType(*getContext());
9404
- Entry.Node = Dst;
9405
- Args.push_back(Entry);
9406
-
9407
- Entry.Ty = Type::getInt8Ty(*getContext());
9408
- Entry.Node = Value;
9409
- Args.push_back(Entry);
9410
-
9411
- Entry.Ty = SizeTy;
9412
- Entry.Node = Size;
9413
- Args.push_back(Entry);
9361
+ Args.emplace_back(Dst, getDataLayout().getIntPtrType(*getContext()));
9362
+ Args.emplace_back(Value, Type::getInt8Ty(*getContext()));
9363
+ Args.emplace_back(Size, SizeTy);
9414
9364
9415
9365
RTLIB::Libcall LibraryCall =
9416
9366
RTLIB::getMEMSET_ELEMENT_UNORDERED_ATOMIC(ElemSz);
@@ -14065,10 +14015,7 @@ SDValue SelectionDAG::makeStateFunctionCall(unsigned LibFunc, SDValue Ptr,
14065
14015
const SDLoc &DLoc) {
14066
14016
assert(InChain.getValueType() == MVT::Other && "Expected token chain");
14067
14017
TargetLowering::ArgListTy Args;
14068
- TargetLowering::ArgListEntry Entry;
14069
- Entry.Node = Ptr;
14070
- Entry.Ty = Ptr.getValueType().getTypeForEVT(*getContext());
14071
- Args.push_back(Entry);
14018
+ Args.emplace_back(Ptr, Ptr.getValueType().getTypeForEVT(*getContext()));
14072
14019
RTLIB::Libcall LC = static_cast<RTLIB::Libcall>(LibFunc);
14073
14020
SDValue Callee = getExternalSymbol(TLI->getLibcallName(LC),
14074
14021
TLI->getPointerTy(getDataLayout()));
0 commit comments