aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2016-07-26 16:45:58 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2016-07-26 16:45:58 +0000
commit52ef4019fd7f1300812dd73c2c1c755319891097 (patch)
tree3060118b10e3b2048a1281dafededa9c974b9239 /llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h
parent07f65718bb638eddc0c40ace9e0c28cc6c6b053a (diff)
downloadllvm-52ef4019fd7f1300812dd73c2c1c755319891097.zip
llvm-52ef4019fd7f1300812dd73c2c1c755319891097.tar.gz
llvm-52ef4019fd7f1300812dd73c2c1c755319891097.tar.bz2
AMDGPU: Make AMDGPUMachineFunction fields private
ABIArgOffset is a problem because properly fsetting the KernArgSize requires that the reserved area before the real kernel arguments be correctly aligned, which requires fixing clover. llvm-svn: 276766
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h43
1 files changed, 31 insertions, 12 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h b/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h
index 6b31f63..0c8b79d 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h
+++ b/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,27 @@ 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;
+ void setABIArgOffset(unsigned NewOffset) {
+ ABIArgOffset = NewOffset;
+ }
+
+ unsigned getABIArgOffset() const {
+ return ABIArgOffset;
+ }
- bool isKernel() const;
+ unsigned getLDSSize() const {
+ return LDSSize;
+ }
- unsigned ScratchSize;
- bool IsKernel;
+ bool isKernel() const {
+ return IsKernel;
+ }
+
+ unsigned allocateLDSGlobal(const DataLayout &DL, const GlobalValue &GV);
};
}