GlobalISel: Add CallBase to CallLoweringInfo

The DAG version has this, and is necessary for call lowering to take
advantage of any attributes at the call site.
This commit is contained in:
Matt Arsenault
2021-08-14 15:58:17 -04:00
parent 46d82e7357
commit 3fdcd9bb13
2 changed files with 4 additions and 0 deletions

View File

@@ -116,6 +116,9 @@ public:
/// vreg that the swifterror should be copied into after the call.
Register SwiftErrorVReg;
/// Original IR callsite corresponding to this call, if available.
const CallBase *CB = nullptr;
MDNode *KnownCallees = nullptr;
/// True if the call must be tail call optimized.

View File

@@ -139,6 +139,7 @@ bool CallLowering::lowerCall(MachineIRBuilder &MIRBuilder, const CallBase &CB,
if (!Info.OrigRet.Ty->isVoidTy())
setArgFlags(Info.OrigRet, AttributeList::ReturnIndex, DL, CB);
Info.CB = &CB;
Info.KnownCallees = CB.getMetadata(LLVMContext::MD_callees);
Info.CallConv = CallConv;
Info.SwiftErrorVReg = SwiftErrorVReg;