[X86][SSE] Vector integer/float conversion memory folding
[oota-llvm.git] / lib / Target / R600 / AMDGPUMachineFunction.cpp
1 #include "AMDGPUMachineFunction.h"
2 #include "AMDGPU.h"
3 #include "llvm/IR/Attributes.h"
4 #include "llvm/IR/Function.h"
5 using namespace llvm;
6
7 static const char *const ShaderTypeAttribute = "ShaderType";
8
9 // Pin the vtable to this file.
10 void AMDGPUMachineFunction::anchor() {}
11
12 AMDGPUMachineFunction::AMDGPUMachineFunction(const MachineFunction &MF) :
13   MachineFunctionInfo(),
14   ShaderType(ShaderType::COMPUTE),
15   LDSSize(0),
16   ScratchSize(0),
17   IsKernel(true) {
18   AttributeSet Set = MF.getFunction()->getAttributes();
19   Attribute A = Set.getAttribute(AttributeSet::FunctionIndex,
20                                  ShaderTypeAttribute);
21
22   if (A.isStringAttribute()) {
23     StringRef Str = A.getValueAsString();
24     if (Str.getAsInteger(0, ShaderType))
25       llvm_unreachable("Can't parse shader type!");
26   }
27 }