[llvm] 3fdcd9b - GlobalISel: Add CallBase to CallLoweringInfo
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 26 18:27:53 PDT 2021
Author: Matt Arsenault
Date: 2021-08-26T21:09:11-04:00
New Revision: 3fdcd9bb1371990399aeadb9aef1df9d74598a83
URL: https://github.com/llvm/llvm-project/commit/3fdcd9bb1371990399aeadb9aef1df9d74598a83
DIFF: https://github.com/llvm/llvm-project/commit/3fdcd9bb1371990399aeadb9aef1df9d74598a83.diff
LOG: 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.
Added:
Modified:
llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h b/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
index 6bdaddd9c6f54..aa3c824c298f3 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
@@ -116,6 +116,9 @@ class CallLowering {
/// 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.
diff --git a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
index d2cda9ece31a5..d3105d35955e7 100644
--- a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
@@ -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;
More information about the llvm-commits
mailing list