[PATCH] D103261: [AMDGPU] Increase alignment of LDS globals if necessary before LDS lowering.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 7 06:58:04 PDT 2021


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp:178
+    for (auto *GV : FoundLocalVars) {
+      unsigned AlignValue = GV->getAlignment();
+      if (AlignValue == 0) {
----------------
This should really be using getAlign. getAlignment has a FIXME comment saying it will be removed.

You should use the Align or MaybeAlign types throughout instead of unsigned.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp:181
+        GV->setAlignment(DL.getABITypeAlign(GV->getValueType()));
+        continue;
+      }
----------------
Why continue here? Surely it's better to fall through into the code that increases alignment?


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