From: Matt Arsenault Date: Fri, 6 Sep 2019 00:36:10 +0000 (+0000) Subject: AMDGPU/GlobalISel: Avoid repeating 32-bit type lists X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a38d47425d66af8cb76ee49b404bd0aaddd8627;p=llvm AMDGPU/GlobalISel: Avoid repeating 32-bit type lists git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371156 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/AMDGPU/BUFInstructions.td b/lib/Target/AMDGPU/BUFInstructions.td index 50089498289..1af12721b64 100644 --- a/lib/Target/AMDGPU/BUFInstructions.td +++ b/lib/Target/AMDGPU/BUFInstructions.td @@ -1535,7 +1535,7 @@ defm : MUBUFScratchLoadPat ; defm : MUBUFScratchLoadPat ; -foreach vt = [i32, f32, v2i16, v2f16, p2, p3, p5, p6] in { +foreach vt = Reg32Types.types in { defm : MUBUFScratchLoadPat ; } defm : MUBUFScratchLoadPat ; @@ -1613,7 +1613,7 @@ defm : MUBUFScratchStorePat ; defm : MUBUFScratchStorePat ; -foreach vt = [i32, f32, v2i16, v2f16, p2, p3, p5, p6] in { +foreach vt = Reg32Types.types in { defm : MUBUFScratchStorePat ; } diff --git a/lib/Target/AMDGPU/DSInstructions.td b/lib/Target/AMDGPU/DSInstructions.td index 53e567a69c2..6960727d882 100644 --- a/lib/Target/AMDGPU/DSInstructions.td +++ b/lib/Target/AMDGPU/DSInstructions.td @@ -640,7 +640,7 @@ defm : DSReadPat_mc ; defm : DSReadPat_mc ; defm : DSReadPat_mc ; -foreach vt = [i32, f32, v2i16, v2f16, p2, p3, p5, p6] in { +foreach vt = Reg32Types.types in { defm : DSReadPat_mc ; } diff --git a/lib/Target/AMDGPU/FLATInstructions.td b/lib/Target/AMDGPU/FLATInstructions.td index 02688529690..b76552d1b67 100644 --- a/lib/Target/AMDGPU/FLATInstructions.td +++ b/lib/Target/AMDGPU/FLATInstructions.td @@ -786,7 +786,7 @@ def : FlatLoadAtomicPat ; def : FlatStorePat ; def : FlatStorePat ; -foreach vt = [i32, f32, v2i16, v2f16, p2, p3, p5, p6] in { +foreach vt = Reg32Types.types in { def : FlatLoadPat ; def : FlatStorePat ; } @@ -867,7 +867,7 @@ def : FlatLoadSignedPat ; def : FlatLoadSignedPat ; def : FlatLoadSignedPat ; -foreach vt = [i32, f32, v2i16, v2f16, p2, p3, p5, p6] in { +foreach vt = Reg32Types.types in { def : FlatLoadSignedPat ; def : FlatStoreSignedPat ; } diff --git a/lib/Target/AMDGPU/SIRegisterInfo.td b/lib/Target/AMDGPU/SIRegisterInfo.td index 108e8020f13..4a6da28bfa8 100644 --- a/lib/Target/AMDGPU/SIRegisterInfo.td +++ b/lib/Target/AMDGPU/SIRegisterInfo.td @@ -350,9 +350,17 @@ def TTMP0_TTMP1_TTMP2_TTMP3_TTMP4_TTMP5_TTMP6_TTMP7_TTMP8_TTMP9_TTMP10_TTMP11_TT TTMP8_gfx9_gfx10, TTMP9_gfx9_gfx10, TTMP10_gfx9_gfx10, TTMP11_gfx9_gfx10, TTMP12_gfx9_gfx10, TTMP13_gfx9_gfx10, TTMP14_gfx9_gfx10, TTMP15_gfx9_gfx10]>; +class RegisterTypes reg_types> { + list types = reg_types; +} + +def Reg16Types : RegisterTypes<[i16, f16]>; +def Reg32Types : RegisterTypes<[i32, f32, v2i16, v2f16, p2, p3, p5, p6]>; + + // VGPR 32-bit registers // i16/f16 only on VI+ -def VGPR_32 : RegisterClass<"AMDGPU", [i32, f32, i16, f16, v2i16, v2f16, p2, p3, p5, p6], 32, +def VGPR_32 : RegisterClass<"AMDGPU", !listconcat(Reg32Types.types, Reg16Types.types), 32, (add (sequence "VGPR%u", 0, 255))> { let AllocationPriority = 1; let Size = 32;