]> granicus.if.org Git - llvm/commitdiff
AMDGPU: Change stack alignment
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 17 Apr 2017 19:48:24 +0000 (19:48 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 17 Apr 2017 19:48:24 +0000 (19:48 +0000)
While the incoming stack for a kernel is 256-byte aligned,
this refers to the base address of the entire wave. This isn't
useful information for most of codegen. Fixes unnecessarily
aligning stack objects in callees.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300481 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AMDGPU/AMDGPUSubtarget.h

index 36bc2498781fedd4ace2b856403c3fc1ea8da50a..a5cda817ac11c415b311f733aa2b482577ffcb22 100644 (file)
@@ -415,9 +415,11 @@ public:
     return 0;
   }
 
+  // Scratch is allocated in 256 dword per wave blocks for the entire
+  // wavefront. When viewed from the perspecive of an arbitrary workitem, this
+  // is 4-byte aligned.
   unsigned getStackAlignment() const {
-    // Scratch is allocated in 256 dword per wave blocks.
-    return 4 * 256 / getWavefrontSize();
+    return 4;
   }
 
   bool enableMachineScheduler() const override {