[PATCH] D141852: [amdgpu] Change LDS lowering default to hybrid

Jon Chesterfield via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 22 09:04:12 PST 2023


JonChesterfield added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp:1307
   const GlobalValue *GV = G->getGlobal();
 
+  if (G->getAddressSpace() == AMDGPUAS::LOCAL_ADDRESS) {
----------------
This is latent because the module lds variable is always lowered to zero and the path through codegen coincidentally picks zero for it. It breaks on the "kernel" lowering strategy because that can reference variables that aren't at zero directly, and breaks on the "hybrid" lowering when it happens to pick the "kernel" strategy for a variable allocated by a kernel which does not use the "module" scope variable.

Still, relying on unspecified -> zero is bad. Planning to add a test case for this behaviour change (it won't show up in codegen that picks zero anyway, but should do for codegen where zero was not the right answer)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141852



More information about the llvm-commits mailing list