[PATCH] D119027: [AMDGPU][NFC]: Emit metadata for hidden_heap_v1 kernarg

Sameer Sahasrabuddhe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 20 05:28:21 PST 2022


sameerds added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUAttributes.def:22
 AMDGPU_ATTRIBUTE(HOSTCALL_PTR, "amdgpu-no-hostcall-ptr")
+AMDGPU_ATTRIBUTE(HEAP_PTR, "amdgpu-no-heap-ptr")
 AMDGPU_ATTRIBUTE(WORKGROUP_ID_X, "amdgpu-no-workgroup-id-x")
----------------
cfang wrote:
> sameerds wrote:
> > It seems we need to document these attributes in AMDGPUUsage, which I missed for no-hostcall-ptr. 
> > 
> > https://llvm.org/docs/AMDGPUUsage.html#llvm-ir-attributes
> Can you suggest the description for both no-hostcall and no-heap-ptr? Thanks.  
How about this:

"Similar to amdgpu-no-implicitarg-ptr, except specific to the implicit kernel argument that holds the pointer to the hostcall buffer. If this attribute is absent, then the amdgpu-no-implicitarg-ptr is also removed."

I do believe the removal already happens, but it will be good to convince ourselves about that.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp:521
     // initial call to the implicitarg_ptr intrinsic.
-    auto DoesNotLeadToHostcallPtr = [&](Instruction &I) {
+    auto DoesNotLeadToMemoryLoc = [&](Instruction &I) {
       auto &Call = cast<CallBase>(I);
----------------
cfang wrote:
> cfang wrote:
> > sameerds wrote:
> > > b-sumner wrote:
> > > > We could potentially be more specific with KernargLoc instead of MemoryLoc.
> > > Or more importantly, the outer function needs a more specific name ... it is checking whether the supplied offset is being accessed from the implicitarg_ptr base.
> > Will update as suggested. Thanks.
> Can we use "funcRetrievesImplicitKernarg(...) ?
Sounds good to me. But "kernarg" usually refers to the segment ... maybe say "KernelArgument" instead? I am okay with either, since the function has a very limited scope.


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

https://reviews.llvm.org/D119027



More information about the llvm-commits mailing list