[PATCH] D125060: [amdgpu] Implement lds kernel id intrinsic
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 13 09:33:32 PDT 2022
arsenm added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/SIFrameLowering.cpp:530-536
+ if (MFI->hasLDSKernelId()) {
+ ConstantInt *Id = AMDGPUMachineFunction::getLDSKernelIdMetadata(F);
+ Register Reg = MFI->getPreloadedReg(AMDGPUFunctionArgInfo::LDS_KERNEL_ID);
+ if (Id && Reg) {
+ BuildMI(MBB, I, DL, TII->get(AMDGPU::S_MOV_B32), Reg)
+ .addImm(Id->getZExtValue());
+ }
----------------
arsenm wrote:
> This shouldn't get initialized in frame lowering. This should have been emitted as an outgoing call argument only, this isn't a reserved register
The value chosen is also likely clobbering an incoming user sgpr
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