summaryrefslogtreecommitdiff
path: root/lib/Target/R600/SIMachineFunctionInfo.cpp
diff options
context:
space:
mode:
authorChristian Konig <christian.koenig@amd.com>2013-03-07 09:03:46 +0000
committerChristian Konig <christian.koenig@amd.com>2013-03-07 09:03:46 +0000
commitc3c169c8844db7f8934fbb3a411290dc3cdcb543 (patch)
tree6522f11c991b625e911230ae789ffaccb4893c30 /lib/Target/R600/SIMachineFunctionInfo.cpp
parent204a2d32ba44ff150e2201d7e0900815b4446bad (diff)
downloadllvm-c3c169c8844db7f8934fbb3a411290dc3cdcb543.tar.gz
llvm-c3c169c8844db7f8934fbb3a411290dc3cdcb543.tar.bz2
llvm-c3c169c8844db7f8934fbb3a411290dc3cdcb543.tar.xz
R600/SI: remove shader type intrinsic
Just encode the type as target specific attribute. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176622 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/R600/SIMachineFunctionInfo.cpp')
-rw-r--r--lib/Target/R600/SIMachineFunctionInfo.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/Target/R600/SIMachineFunctionInfo.cpp b/lib/Target/R600/SIMachineFunctionInfo.cpp
index 7e59b42749..e5fbf05e08 100644
--- a/lib/Target/R600/SIMachineFunctionInfo.cpp
+++ b/lib/Target/R600/SIMachineFunctionInfo.cpp
@@ -10,11 +10,25 @@
#include "SIMachineFunctionInfo.h"
+#include "llvm/IR/Attributes.h"
+#include "llvm/IR/Function.h"
using namespace llvm;
+const char *SIMachineFunctionInfo::ShaderTypeAttribute = "ShaderType";
+
SIMachineFunctionInfo::SIMachineFunctionInfo(const MachineFunction &MF)
: MachineFunctionInfo(),
SPIPSInputAddr(0),
- ShaderType(0)
- { }
+ ShaderType(0) {
+
+ AttributeSet Set = MF.getFunction()->getAttributes();
+ Attribute A = Set.getAttribute(AttributeSet::FunctionIndex,
+ ShaderTypeAttribute);
+
+ if (A.isStringAttribute()) {
+ StringRef Str = A.getValueAsString();
+ if (Str.getAsInteger(0, ShaderType))
+ llvm_unreachable("Can't parse shader type!");
+ }
+}