[PATCH] D123346: AMDGPU: Align the implicit kernel argument segment to 8 bytes for v5

Changpeng Fang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 8 09:26:54 PDT 2022


cfang marked an inline comment as done.
cfang added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp:991
+  // Refer to AMDGPUSubtarget::getAlignmentForImplicitArgPtr().
+  emitKernelArg(DL, Int32Ty, Align(8), "hidden_block_count_x", Offset, Args);
   emitKernelArg(DL, Int32Ty, Align(4), "hidden_block_count_y", Offset, Args);
----------------
arsenm wrote:
> It would be better to compute the actual alignment based on the known offset plus kernarg segment base alignment, if only to assert that it's at least 8
We can use the alignTo to align the Offset at the very beginning. We don't need to worry about 8 bytes: 
Offset = alignTo(Offset, ST.getAlignmentForImplicitArgPtr());


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

https://reviews.llvm.org/D123346



More information about the llvm-commits mailing list