Skip to content

Commit e3f88a9

Browse files
authored
[AMDGPU] Rewrite getVOP3DPPSrcForVT with !cond (#81889)
`!cond` is much more clear than nested `!if`.
1 parent 5c57fd7 commit e3f88a9

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

llvm/lib/Target/AMDGPU/SIInstrInfo.td

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,13 +1571,15 @@ class getVOP3SrcForVT<ValueType VT, bit IsTrue16 = 0> {
15711571
// Src2 of VOP3 DPP instructions cannot be a literal
15721572
class getVOP3DPPSrcForVT<ValueType VT> {
15731573
RegisterOperand ret =
1574-
!if (!eq(VT.Value, i1.Value), SSrc_i1,
1575-
!if (VT.isFP,
1576-
!if (!or(!eq(VT.Value, f16.Value), !eq(VT.Value, bf16.Value)), VCSrc_f16,
1577-
!if (!or(!eq(VT.Value, v2f16.Value), !eq(VT.Value, v2bf16.Value)), VCSrc_v2f16, VCSrc_f32)),
1578-
!if (!eq(VT.Value, i16.Value), VCSrc_b16,
1579-
!if (!eq(VT.Value, v2i16.Value), VCSrc_v2b16,
1580-
VCSrc_b32))));
1574+
!cond(!eq(VT, i1) : SSrc_i1,
1575+
!eq(VT, i16) : VCSrc_b16,
1576+
!eq(VT, f16) : VCSrc_f16,
1577+
!eq(VT, bf16) : VCSrc_f16,
1578+
!eq(VT, v2i16) : VCSrc_v2b16,
1579+
!eq(VT, v2f16) : VCSrc_v2f16,
1580+
!eq(VT, v2bf16) : VCSrc_v2f16,
1581+
!eq(VT, f32) : VCSrc_f32,
1582+
1 : VCSrc_b32);
15811583
}
15821584

15831585
// Float or packed int

0 commit comments

Comments
 (0)