diff options
Diffstat (limited to 'lib/Target/AMDGPU/AMDGPUMachineFunction.h')
-rw-r--r-- | lib/Target/AMDGPU/AMDGPUMachineFunction.h | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/lib/Target/AMDGPU/AMDGPUMachineFunction.h b/lib/Target/AMDGPU/AMDGPUMachineFunction.h index 99bb61b21db0..8d6b871bc03e 100644 --- a/lib/Target/AMDGPU/AMDGPUMachineFunction.h +++ b/lib/Target/AMDGPU/AMDGPUMachineFunction.h @@ -15,57 +15,43 @@ namespace llvm { +class GCNSubtarget; + 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; +protected: + uint64_t ExplicitKernArgSize; // Cache for this. + unsigned MaxKernArgAlign; // Cache for this. /// 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; - - // Kernels + shaders. i.e. functions called by the driver and not not called + // Kernels + shaders. i.e. functions called by the driver and not called // by other functions. bool IsEntryFunction; bool NoSignedZerosFPMath; -public: - AMDGPUMachineFunction(const MachineFunction &MF); - - uint64_t allocateKernArg(uint64_t Size, unsigned Align) { - assert(isPowerOf2_32(Align)); - KernArgSize = alignTo(KernArgSize, Align); + // Function may be memory bound. + bool MemoryBound; - uint64_t Result = KernArgSize; - KernArgSize += Size; + // Kernel may need limited waves per EU for better performance. + bool WaveLimiter; - MaxKernArgAlign = std::max(Align, MaxKernArgAlign); - return Result; - } +public: + AMDGPUMachineFunction(const MachineFunction &MF); - uint64_t getKernArgSize() const { - return KernArgSize; + uint64_t getExplicitKernArgSize() const { + return ExplicitKernArgSize; } unsigned getMaxKernArgAlign() const { return MaxKernArgAlign; } - void setABIArgOffset(unsigned NewOffset) { - ABIArgOffset = NewOffset; - } - - unsigned getABIArgOffset() const { - return ABIArgOffset; - } - unsigned getLDSSize() const { return LDSSize; } @@ -78,6 +64,14 @@ public: return NoSignedZerosFPMath; } + bool isMemoryBound() const { + return MemoryBound; + } + + bool needsWaveLimiter() const { + return WaveLimiter; + } + unsigned allocateLDSGlobal(const DataLayout &DL, const GlobalValue &GV); }; |