[llvm] [WIP][AMDGPU][MC] Support 128b rsrc reg in mimg instructions (PR #139121)
Jun Wang via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 2 10:58:14 PST 2025
================
@@ -922,6 +922,15 @@ defm "" : SRegClass<16, Reg512Types.types, SGPR_512Regs, TTMP_512Regs>;
defm "" : SRegClass<32, Reg1024Types.types, SGPR_1024Regs>;
}
+def SReg_RSRC : SIRegisterClass<"AMDGPU", [v8i32], 32,
+ (add SReg_256_XNULL, SReg_128_XNULL)> {
+ let Size = 8;
----------------
jwanggit86 wrote:
> Doesn't this imply that a value of type v8i32 can be stored in a SReg_128_XNULL register? Also "Size" is in bits, but if you have both SReg256 and SReg128 I'm not sure what to set.
>
The new reg class is a super-set of both SReg_128_XNULL and SReg_256_XNULL. Based on experiments, when
128b reg is called for, it is allocated from SReg_128 because that's the common subclass for SReg_128 and the new reg class. Similarly for 256b.
> I do not see any codegen tests with the new 128 rsrc size. This definition in fine for assembler/disassembler parts but I'm not sure if this works for codegen so please try some tests.
>
Added 2 new test files: `llvm.amdgcn.image.r128.ll` for testing the overall codegen, and `llvm.amdgcn.image.r128.regalloc.ll` for register allocation in particular.
https://github.com/llvm/llvm-project/pull/139121
More information about the llvm-commits
mailing list