Skip to content

Commit 8f3fc72

Browse files
authored
[AMDGPU] Use Reg32Types for move-immediate patterns (#138422)
This just avoids having another copy of the list of valid 32-bit pointer types.
1 parent 5f24ae9 commit 8f3fc72

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

llvm/lib/Target/AMDGPU/SIInstructions.td

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2270,16 +2270,18 @@ def : GCNPat <
22702270

22712271
// FIXME: Remove VGPRImm. Should be inferrable from register bank.
22722272

2273-
foreach vt = [i32, p3, p5, p6, p2] in {
2274-
def : GCNPat <
2275-
(VGPRImm<(vt imm)>:$imm),
2276-
(V_MOV_B32_e32 imm:$imm)
2277-
>;
2273+
foreach vt = Reg32Types.types in {
2274+
if !and(!not(vt.isVector), !not(vt.isFP)) then {
2275+
def : GCNPat <
2276+
(VGPRImm<(vt imm)>:$imm),
2277+
(V_MOV_B32_e32 imm:$imm)
2278+
>;
22782279

2279-
def : GCNPat <
2280-
(vt imm:$imm),
2281-
(S_MOV_B32 imm:$imm)
2282-
>;
2280+
def : GCNPat <
2281+
(vt imm:$imm),
2282+
(S_MOV_B32 imm:$imm)
2283+
>;
2284+
}
22832285
}
22842286

22852287
// FIXME: The register bank of the frame index should depend on the

0 commit comments

Comments
 (0)