[PATCH] D48179: [AMDGPU] Emit MessagePack HSA Metadata for v3 code object

Scott Linder via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 15 10:39:41 PDT 2018


scott.linder added inline comments.


================
Comment at: lib/Target/AMDGPU/MCTargetDesc/AMDGPUHSAMetadataStreamer.cpp:800-805
+  auto Size = DL.getTypeAllocSize(Ty);
+  auto Align = DL.getABITypeAlignment(Ty);
+  Arg[V3::Kernel::Arg::Key::Size] = make_unique<msgpack::ScalarNode>(Size);
+  Offset = alignTo(Offset, Align);
+  Arg[V3::Kernel::Arg::Key::Offset] = make_unique<msgpack::ScalarNode>(Offset);
+  Offset += Size;
----------------
@arsenm This calculation of the kernarg offset is analogous to what we used to have. We emitted DataLayout::getABITypeAlignment as "Align", and the runtime calculated the Offset.

Is DataLayout::getABITypeAlignment incorrect here? What is the correct way to reproduce the offsets calculated in the kernarg lowering?


https://reviews.llvm.org/D48179





More information about the llvm-commits mailing list