summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2015-12-15 16:26:16 +0000
committerTom Stellard <thomas.stellard@amd.com>2015-12-15 16:26:16 +0000
commitac00eb5470b5bef857533799868e3e9ff997a50e (patch)
tree3c451e82c721241512a6a4ac2a523b557540386d /llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
parent8922476bcbf1344cd4a8bc97c08b6fbac19457d9 (diff)
downloadbcm5719-llvm-ac00eb5470b5bef857533799868e3e9ff997a50e.tar.gz
bcm5719-llvm-ac00eb5470b5bef857533799868e3e9ff997a50e.zip
AMDGPU/SI: Add getShaderType() function to Utils/
Reviewers: arsenm Subscribers: arsenm, llvm-commits Differential Revision: http://reviews.llvm.org/D15424 llvm-svn: 255650
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp b/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
index 7c595d5a83e..54137177e4c 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
@@ -1,11 +1,10 @@
#include "AMDGPUMachineFunction.h"
#include "AMDGPU.h"
+#include "Utils/AMDGPUBaseInfo.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/Function.h"
using namespace llvm;
-static const char *const ShaderTypeAttribute = "ShaderType";
-
// Pin the vtable to this file.
void AMDGPUMachineFunction::anchor() {}
@@ -16,11 +15,6 @@ AMDGPUMachineFunction::AMDGPUMachineFunction(const MachineFunction &MF) :
ABIArgOffset(0),
ScratchSize(0),
IsKernel(true) {
- Attribute A = MF.getFunction()->getFnAttribute(ShaderTypeAttribute);
- if (A.isStringAttribute()) {
- StringRef Str = A.getValueAsString();
- if (Str.getAsInteger(0, ShaderType))
- llvm_unreachable("Can't parse shader type!");
- }
+ ShaderType = AMDGPU::getShaderType(*MF.getFunction());
}
OpenPOWER on IntegriCloud