diff options
Diffstat (limited to 'contrib/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h')
-rw-r--r-- | contrib/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/contrib/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h b/contrib/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h index 6b31f63..5d0640b 100644 --- a/contrib/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h +++ b/contrib/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h @@ -11,15 +11,26 @@ #define LLVM_LIB_TARGET_AMDGPU_AMDGPUMACHINEFUNCTION_H #include "llvm/CodeGen/MachineFunction.h" -#include <map> +#include "llvm/ADT/DenseMap.h" namespace llvm { class AMDGPUMachineFunction : public MachineFunctionInfo { + /// A map to keep track of local memory objects and their offsets within the + /// local memory space. + SmallDenseMap<const GlobalValue *, unsigned, 4> LocalMemoryObjects; + uint64_t KernArgSize; unsigned MaxKernArgAlign; - virtual void anchor(); + /// Number of bytes in the LDS that are being used. + unsigned LDSSize; + + // FIXME: This should probably be removed. + /// Start of implicit kernel args + unsigned ABIArgOffset; + + bool IsKernel; public: AMDGPUMachineFunction(const MachineFunction &MF); @@ -35,19 +46,31 @@ public: return Result; } - /// A map to keep track of local memory objects and their offsets within - /// the local memory space. - std::map<const GlobalValue *, unsigned> LocalMemoryObjects; - /// Number of bytes in the LDS that are being used. - unsigned LDSSize; + uint64_t getKernArgSize() const { + return KernArgSize; + } - /// Start of implicit kernel args - unsigned ABIArgOffset; + unsigned getMaxKernArgAlign() const { + return MaxKernArgAlign; + } - bool isKernel() const; + void setABIArgOffset(unsigned NewOffset) { + ABIArgOffset = NewOffset; + } - unsigned ScratchSize; - bool IsKernel; + unsigned getABIArgOffset() const { + return ABIArgOffset; + } + + unsigned getLDSSize() const { + return LDSSize; + } + + bool isKernel() const { + return IsKernel; + } + + unsigned allocateLDSGlobal(const DataLayout &DL, const GlobalValue &GV); }; } |