[PATCH] D155384: [amdgpu][wip] Precise existing usage calculation in PromoteAllocaToLDS

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 22 11:08:50 PDT 2023


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp:885-887
+  // LowerModuleToLDS runs unconditionally before this pass. The two calling
+  // conventions that pass the check in tryPromoteAllocaToLDS are {AMDGPU,SPIR}
+  // KERNEL, both of which are rewritten by LowerModuleToLDS.
----------------
Just say kernels, don't spell out the one that we only try to handle in random places 


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp:890
+  std::pair<unsigned, unsigned> LDSSizeRange = AMDGPU::getIntegerPairAttribute(
+      F, "amdgpu-lds-size", {0, UINT32_MAX}, true);
 
----------------
Break this into better names than .first/.second


================
Comment at: llvm/test/CodeGen/AMDGPU/promote-alloca-to-lds-constantexpr-use.ll:190
-; ASM: .group_segment_fixed_size: 65536
-define amdgpu_kernel void @constant_expression_uses_all_lds_global_initializer(ptr addrspace(1) nocapture %out, i32 %idx) #0 {
-entry:
----------------
Could just update these to add the new attribute?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155384



More information about the llvm-commits mailing list