[PATCH] D82496: [amdgpu] Add codegen support for HIP dynamic shared memory.

Michael Liao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 09:10:12 PDT 2020


hliao added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp:59
+  // memory.
+  LDSSize = alignTo(StaticLDSSize, DynLDSAlign);
 
----------------
arsenm wrote:
> This is an independent field and should not be changed here
As the sequence of static LDS allocation and dynamic LDS alignment updates are processed in the program order or reverse of that order, we need to collect all static LDS usage and dynamic LDS alignment. As we remove the previous the one single point adjustment, we need to update LDSSizze if there's any static LDS allocation or dynamic LDS alignment updates.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h:99
+      return;
+    LDSSize = alignTo(StaticLDSSize, A);
+    DynLDSAlign = A;
----------------
arsenm wrote:
> This should still not be modifying LDSSize. This is still missing an independent query to give the static + rounded size
Valid LDS queries should be done after instruction selection. `LDSSize` is ONLY modified within instruction selection through static LDS allocation and dynamic LDS alignment update.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82496/new/

https://reviews.llvm.org/D82496



More information about the llvm-commits mailing list