summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2017-08-01 19:54:18 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2017-08-01 19:54:18 +0000
commitb62a4eb5241969e79ca244295611fb8e9a2f3426 (patch)
treeb92db3327c2abd411a7e6af2a627bea1c0c9aa83 /llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
parent253be33610119a7145826e0b192f7d0b6cfe198b (diff)
downloadbcm5719-llvm-b62a4eb5241969e79ca244295611fb8e9a2f3426.tar.gz
bcm5719-llvm-b62a4eb5241969e79ca244295611fb8e9a2f3426.zip
AMDGPU: Initial implementation of calls
Includes a hack to fix the type selected for the GlobalAddress of the function, which will be fixed by changing the default datalayout to use generic pointers for 0. llvm-svn: 309732
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
index 343bca550e7..571ee97ff36 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -123,6 +123,12 @@ static cl::opt<bool> LateCFGStructurize(
cl::init(false),
cl::Hidden);
+static cl::opt<bool> EnableAMDGPUFunctionCalls(
+ "amdgpu-function-calls",
+ cl::Hidden,
+ cl::desc("Enable AMDGPU function call support"),
+ cl::init(false));
+
extern "C" void LLVMInitializeAMDGPUTarget() {
// Register the target
RegisterTargetMachine<R600TargetMachine> X(getTheAMDGPUTarget());
@@ -269,6 +275,11 @@ AMDGPUTargetMachine::AMDGPUTargetMachine(const Target &T, const Triple &TT,
AMDGPUTargetMachine::~AMDGPUTargetMachine() = default;
+bool AMDGPUTargetMachine::enableFunctionCalls() const {
+ return EnableAMDGPUFunctionCalls &&
+ getTargetTriple().getArch() == Triple::amdgcn;
+}
+
StringRef AMDGPUTargetMachine::getGPUName(const Function &F) const {
Attribute GPUAttr = F.getFnAttribute("target-cpu");
return GPUAttr.hasAttribute(Attribute::None) ?
OpenPOWER on IntegriCloud