[llvm] [AMDGPU][NFC] Refactor FLAT_Global_* pseudos. (PR #120244)
Joe Nash via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 12 12:29:18 PDT 2025
================
@@ -228,15 +228,14 @@ class GlobalSaddrTable <bit is_saddr, string Name = ""> {
// saddr is 32-bit (which isn't handled here yet).
class FLAT_Load_Pseudo<
string opName, RegisterOperand vdata_op, bit HasTiedOutput = 0,
- bit HasSaddr = 0, bit EnableSaddr = 0>
+ bit HasSaddr = 0, bit EnableSaddr = 0,
+ RegisterClass VaddrRC = !if(EnableSaddr, VGPR_32, VReg_64)>
: FLAT_Pseudo<opName, (outs), (ins), ""> {
let OutOperandList = (outs vdata_op:$vdst);
let InOperandList = !con(
- !if(EnableSaddr,
- (ins SReg_64_XEXEC_XNULL:$saddr, VGPR_32:$vaddr),
- (ins VReg_64:$vaddr)),
- (ins flat_offset:$offset),
+ !if(EnableSaddr, (ins SReg_64_XEXEC_XNULL:$saddr), (ins)),
+ (ins VaddrRC:$vaddr, flat_offset:$offset),
----------------
Sisyph wrote:
I see there might be multiple opinions on what the indentation represent. In my opinion, the level of indentation should represent the nesting hierarchy of the lists or dags. (ins VaddrRC:$vaddr, flat_offset:$offset) should be at the same alignment level as !if, because they are both arguments of !con, and so at the same level in the nesting hierarchy. that (ins VaddrRC...) dag is not inside the if, which this alignment would to me.
https://github.com/llvm/llvm-project/pull/120244
More information about the llvm-commits
mailing list