[PATCH] D104316: [AMDGPU] Propagate LDS align into to instructions

Mahesha S via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 21 22:28:58 PDT 2021


hsmhsm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp:324
+      uint64_t Off = DL.getStructLayout(LDSTy)->getElementOffset(I);
+      Align A = commonAlignment(MaxAlign, Off);
+      refineUsesAlignment(GEP, A, DL);
----------------
Did not understand the logic behind calling commonAlignment() here. I thought, alignment of GV and GEP are same, and we just need to propogate the alignment of GV? Because, we already have properly updated the alignment of GV?


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp:374
+          Align GA = commonAlignment(A, Off.getLimitedValue());
+          refineUsesAlignment(GEP, GA, DL, MaxDepth - 1);
+        }
----------------
In case of GEP instruction, I thought, we should be exploring the uses of GEP?


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp:381
+            I->getOpcode() == Instruction::AddrSpaceCast)
+          refineUsesAlignment(I, A, DL, MaxDepth - 1);
+      }
----------------
Same here, in case of bitcast instruction, I thought, we should be exploring uses of bitcast?


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

https://reviews.llvm.org/D104316



More information about the llvm-commits mailing list