[PATCH] D125060: [amdgpu] Implement lds kernel id intrinsic

Jon Chesterfield via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 4 11:13:02 PDT 2022


JonChesterfield added a comment.

Changes to tests were mechanical. Expecting a minor performance hit for code using indirect calls which resist analysis by the attribute propagator because sgpr15 is now reserved.

An alternative is to dedicate some LDS to the same purpose and store to it from the kernel, but accessing that LDS variable from an indirect function in order to find the other LDS is relatively complicated (put it at a fixed address and codegen loads/stores) and will inevitably lead to an application that wants to use all the LDS on the machine without sacrificing those four bytes. We could dedicate a vgpr instead but sgprs are cheaper and it will hold a __const value which is better represented by a scalar load.

Which sgpr is used doesn't matter but changing it will respin the noisy test updates. I'd much prefer we land this using 15, chosen as the next one in sequence, and then change it along with the others if necessary.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125060



More information about the llvm-commits mailing list