[PATCH] D104997: [WIP][AMDGPU] Deduce attributes with the Attributor

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 28 06:26:44 PDT 2021


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp:27-31
+    "amdgpu-work-item-id-x",  "amdgpu-work-item-id-y",
+    "amdgpu-work-item-id-z",  "amdgpu-work-group-id-x",
+    "amdgpu-work-group-id-y", "amdgpu-work-group-id-z",
+    "amdgpu-dispatch-ptr",    "amdgpu-dispatch-id",
+    "amdgpu-queue-ptr",       "amdgpu-implicitarg-ptr"};
----------------
These are the attributes as they exist now, but I do think these need to be inverted to be more sound. Assuming they are present is the conservative direction, so ideally we would operate on a no-* basis


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp:191
+    auto CheckAlloca = [&](Instruction &I) {
+      AddAttribute("amdgpu-stack-objects");
+      return false;
----------------
I do not like this attribute and don't believe it's very sound, but I guess continuing with it doesn't make things worse


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp:199-200
+      unsigned SrcAS = static_cast<AddrSpaceCastInst &>(I).getSrcAddressSpace();
+      if (SrcAS == AMDGPUAS::LOCAL_ADDRESS ||
+          SrcAS == AMDGPUAS::PRIVATE_ADDRESS)
+        AddAttribute("amdgpu-queue-ptr");
----------------
This also depends on the subtarget since we don't need this on newer ones for addrspacecast


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104997



More information about the llvm-commits mailing list