diff options
author | Mark Lacey <mark.lacey@apple.com> | 2019-07-31 20:34:02 +0000 |
---|---|---|
committer | Mark Lacey <mark.lacey@apple.com> | 2019-07-31 20:34:02 +0000 |
commit | 7b8d3eb9e2174e0bec206faea405b693fcb9eb8d (patch) | |
tree | 856ae7d7c6ea5cdcdc74df32f853147bca9c61f6 /llvm/lib/CodeGen/GlobalISel/CallLowering.cpp | |
parent | 09f39967a2e8d145d4eb0635d735839e1dbf8611 (diff) | |
download | bcm5719-llvm-7b8d3eb9e2174e0bec206faea405b693fcb9eb8d.tar.gz bcm5719-llvm-7b8d3eb9e2174e0bec206faea405b693fcb9eb8d.zip |
[GISel] Pass MD_callees metadata down in call lowering.
Summary:
This will make it possible to improve IPRA by taking into account
register usage in indirect calls.
NFC yet; this is just laying the groundwork to start building
up patches to take advantage of the information for improved register
allocation.
Reviewers: aditya_nandakumar, volkan, qcolombet, arsenm, rovka, aemerson, paquette
Subscribers: sdardis, wdng, javed.absar, hiraditya, jrtc27, atanasyan, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65488
llvm-svn: 367476
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/CallLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/CallLowering.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp index a5d8205a34a..9f950131c85 100644 --- a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp +++ b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp @@ -19,6 +19,7 @@ #include "llvm/CodeGen/TargetLowering.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/Instructions.h" +#include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" #define DEBUG_TYPE "call-lowering" @@ -61,8 +62,11 @@ bool CallLowering::lowerCall(MachineIRBuilder &MIRBuilder, ImmutableCallSite CS, if (!OrigRet.Ty->isVoidTy()) setArgFlags(OrigRet, AttributeList::ReturnIndex, DL, CS); + const MDNode *KnownCallees = + CS.getInstruction()->getMetadata(LLVMContext::MD_callees); + return lowerCall(MIRBuilder, CS.getCallingConv(), Callee, OrigRet, OrigArgs, - SwiftErrorVReg); + SwiftErrorVReg, KnownCallees); } template <typename FuncInfoTy> |