[PATCH] D139433: [amdgpu] Reimplement LDS lowering

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 15 08:59:59 PST 2022


arsenm added inline comments.


================
Comment at: llvm/test/CodeGen/AMDGPU/addrspacecast-known-non-null.ll:28
 ; CHECK: s_mov_b64 s[{{[0-9]+}}:[[HIREG:[0-9]+]]], src_shared_base
-; CHECK: v_mov_b32_e32 v0, 0
 ; CHECK: v_mov_b32_e32 v1, s[[HIREG]]
----------------
JonChesterfield wrote:
> cdevadas wrote:
> > Why this write to v0 is gone now?
> > The code looks broken without defining v0 before swappc is called.
> This is a function which is reachable by no kernel, thus ignored by the pass that lowers LDS globals. There's no kernel to put the LDS variable into. It'll compile with a warning from llc and replacing the use of the variable with undef.
> 
> Making this function a kernel, or making it reachable from a kernel, will have the effect of allocating the LDS variable (and avoiding the warning from the back end).
> 
> Codegen for this function should be identical with the LDS lowering pass enabled or disabled.
Probably not the most helpful behavior for an externally visible function. Probably should treat this like an external LDS relocation


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139433



More information about the llvm-commits mailing list