diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-06-18 05:15:53 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-06-18 05:15:53 +0000 |
commit | e935f05a94dae95e5d86606bd2b65cb92bf302aa (patch) | |
tree | 7956c83a9efeb0ec380ed061bc1a7aeeb87b86cb /llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h | |
parent | e8fd9561cb16d9d8398276e8c4ca836199b7699c (diff) | |
download | bcm5719-llvm-e935f05a94dae95e5d86606bd2b65cb92bf302aa.tar.gz bcm5719-llvm-e935f05a94dae95e5d86606bd2b65cb92bf302aa.zip |
AMDGPU: Fix kernel argument alignment impacting stack size
Don't use AllocateStack because kernel arguments have nothing
to do with the stack. The ensureMaxAlignment call was still
changing the stack alignment.
llvm-svn: 273080
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h')
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h b/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h index 2ef3bf5f2fb..a534024dc2e 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h +++ b/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h @@ -16,10 +16,25 @@ namespace llvm { class AMDGPUMachineFunction : public MachineFunctionInfo { + uint64_t KernArgSize; + unsigned MaxKernArgAlign; + virtual void anchor(); public: AMDGPUMachineFunction(const MachineFunction &MF); + + uint64_t allocateKernArg(uint64_t Size, unsigned Align) { + assert(isPowerOf2_32(Align)); + KernArgSize = alignTo(KernArgSize, Align); + + uint64_t Result = KernArgSize; + KernArgSize += Size; + + MaxKernArgAlign = std::max(Align, MaxKernArgAlign); + 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; |