[PATCH] D103261: [AMDGPU] If required, increase natural alignment of LDS globals before LDS lowering.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 28 01:38:18 PDT 2021


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/Utils/AMDGPULDSUtils.cpp:159-161
+    // If LDS has section defined, and it has its alignment explicitly
+    // specified, then we need to *honor* explicitly specified alignment whether
+    // it is under-aligned or not.
----------------
I think this needs a better explanation. Normally increasing the alignment would still be considered to "honor" the original alignment.


================
Comment at: llvm/lib/Target/AMDGPU/Utils/AMDGPULDSUtils.h:45-48
+// Go through each LDS, and if it is under-aligned, then find its natural
+// alignment, and update LDS accordingly. This will make sure that the members
+// of sorted structure are properly aligned, and hence it will further reduce
+// the probability of unaligned LDS access.
----------------
I don't think it's a good idea to have three copies of this block comment (maybe just keep this one?) and I don't particularly like the use of "under-aligned" and "natural alignment" here. I would say something like: "Increase the alignment of LDS globals if necessary to maximise the chance that we can use aligned LDS instructions to access them"


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103261



More information about the llvm-commits mailing list