From 238328fc3e31ee6a52e95886e30f9719336fb019 Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Sat, 3 May 2025 21:03:45 +0100 Subject: [PATCH] [AMDGPU] Use Reg32Types for move-immediate patterns This just avoids having another copy of the list of valid 32-bit pointer types. --- llvm/lib/Target/AMDGPU/SIInstructions.td | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/SIInstructions.td b/llvm/lib/Target/AMDGPU/SIInstructions.td index f5c6d47369781..dea20e2d84d7b 100644 --- a/llvm/lib/Target/AMDGPU/SIInstructions.td +++ b/llvm/lib/Target/AMDGPU/SIInstructions.td @@ -2270,16 +2270,18 @@ def : GCNPat < // FIXME: Remove VGPRImm. Should be inferrable from register bank. -foreach vt = [i32, p3, p5, p6, p2] in { - def : GCNPat < - (VGPRImm<(vt imm)>:$imm), - (V_MOV_B32_e32 imm:$imm) - >; +foreach vt = Reg32Types.types in { + if !and(!not(vt.isVector), !not(vt.isFP)) then { + def : GCNPat < + (VGPRImm<(vt imm)>:$imm), + (V_MOV_B32_e32 imm:$imm) + >; - def : GCNPat < - (vt imm:$imm), - (S_MOV_B32 imm:$imm) - >; + def : GCNPat < + (vt imm:$imm), + (S_MOV_B32 imm:$imm) + >; + } } // FIXME: The register bank of the frame index should depend on the