[PATCH] D47566: AMDHSA: Code object v3 updates

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 4 07:19:41 PDT 2018


nhaehnle added inline comments.


================
Comment at: lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp:403-409
+  Streamer.EmitValue(MCBinaryExpr::createSub(
+      MCSymbolRefExpr::create(
+          KernelCodeSymbol, MCSymbolRefExpr::VK_AMDGPU_REL64, Context),
+      MCSymbolRefExpr::create(
+          KernelDescriptorSymbol, MCSymbolRefExpr::VK_None, Context),
+      Context),
+      sizeof(KernelDescriptor.kernel_code_entry_byte_offset));
----------------
Isn't the REL64 here redundant? The way I see it, we should either have an //absolute// reference to `(start of kernel code) - (start of kernel descriptor)`, or a //relative// reference to `(start of kernel code) - offsetof(kernel_descriptor_t, kernel_code_entry_byte_offset)`.

I'm not deep enough in MC to say for certain which of these is really preferable.


https://reviews.llvm.org/D47566





More information about the llvm-commits mailing list