[PATCH] D102401: [AMDGPU] Allocate LDS globals in sorted order of their alignment and size.

Mahesha S via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 14 04:57:54 PDT 2021


hsmhsm added a comment.

In D102401#2757441 <https://reviews.llvm.org/D102401#2757441>, @rampitec wrote:

> We probably need a test which only runs this lowering and showing a resulting transformed IR. Test the alignment, sorting and situation with multiple kernels using intersecting LDS variable sets.

Added test - lds-allocation.ll.  However, note that we actually do not update the alignment of LDS globals within the module,  during allocation, we only just compute the required natural alignment for proper allocation.



================
Comment at: llvm/include/llvm/Support/Alignment.h:348
 
+inline Align max(Align Lhs, Align Rhs) { return Lhs > Rhs ? Lhs : Rhs; }
+
----------------
rampitec wrote:
> It does not follow the style around, make the body on separate lines.
This was forced by clang-format tool.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp:61
+    const auto *I = dyn_cast<Instruction>(UU);
+    assert(I && "Expected an instruction");
+    const Function *F = I->getFunction();
----------------
rampitec wrote:
> It can probably be Operator.
I did not understand this comment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102401



More information about the llvm-commits mailing list