Skip to content

Commit 2e585c4

Browse files
authored
[AMDGPU] Rewrite getVregSrcForVT with !cond (#81954)
1 parent 8c1c94e commit 2e585c4

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

llvm/lib/Target/AMDGPU/SIInstrInfo.td

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,15 +1528,14 @@ class getSOPSrcForVT<ValueType VT> {
15281528
// Returns the vreg register class to use for source operand given VT
15291529
class getVregSrcForVT<ValueType VT, bit IsTrue16 = 0, bit IsFake16 = 0> {
15301530
RegisterOperand ret =
1531-
!if (!eq(VT.Size, 128), RegisterOperand<VReg_128>,
1532-
!if (!eq(VT.Size, 96), RegisterOperand<VReg_96>,
1533-
!if (!eq(VT.Size, 64), RegisterOperand<VReg_64>,
1534-
!if (!eq(VT.Size, 48), RegisterOperand<VReg_64>,
1535-
!if (!eq(VT.Size, 16),
1536-
!if (IsTrue16,
1537-
!if (IsFake16, VGPRSrc_32_Lo128, VGPRSrc_16_Lo128),
1538-
RegisterOperand<VGPR_32>),
1539-
RegisterOperand<VGPR_32>)))));
1531+
!cond(!eq(VT.Size, 128) : RegisterOperand<VReg_128>,
1532+
!eq(VT.Size, 96) : RegisterOperand<VReg_96>,
1533+
!eq(VT.Size, 64) : RegisterOperand<VReg_64>,
1534+
!eq(VT.Size, 48) : RegisterOperand<VReg_64>,
1535+
!eq(VT.Size, 16) : !if(IsTrue16,
1536+
!if(IsFake16, VGPRSrc_32_Lo128, VGPRSrc_16_Lo128),
1537+
RegisterOperand<VGPR_32>),
1538+
1 : RegisterOperand<VGPR_32>);
15401539
}
15411540

15421541
class getSDWASrcForVT <ValueType VT> {

0 commit comments

Comments
 (0)