[PATCH] D122091: [amdgpu] Elide module lds allocation in kernels with no callees

Jon Chesterfield via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 23 09:36:42 PDT 2022


JonChesterfield added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp:391
+            // the allocation without repeating callgraph walks.
+            Func.addFnAttr("amdgpu-elide-module-lds", "true");
+          }
----------------
arsenm wrote:
> You don't need to have a value (no true), just set the attribute. I think all the bool-as-string variable are an antipattern that for some reason spread to a subset of attributes
Ah, that explains the getValueAsBool behaviour. Thanks


================
Comment at: llvm/test/CodeGen/AMDGPU/lower-module-lds-offsets.ll:64
+; GCN:     ds_write_b8 [[NULL]], [[TWO]]
+define amdgpu_kernel void @k1() #0 {
+; OPT-LABEL: @k1(
----------------
Sadly I think the ordering here is too unstable to hit from a test case, dropping it in the next diff.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122091



More information about the llvm-commits mailing list