[llvm] e3f88a9 - [AMDGPU] Rewrite `getVOP3DPPSrcForVT` with `!cond` (#81889)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 15 13:03:08 PST 2024
Author: Shilei Tian
Date: 2024-02-15T16:03:04-05:00
New Revision: e3f88a9e587a6924054def5e26b3c976dcb31453
URL: https://github.com/llvm/llvm-project/commit/e3f88a9e587a6924054def5e26b3c976dcb31453
DIFF: https://github.com/llvm/llvm-project/commit/e3f88a9e587a6924054def5e26b3c976dcb31453.diff
LOG: [AMDGPU] Rewrite `getVOP3DPPSrcForVT` with `!cond` (#81889)
`!cond` is much more clear than nested `!if`.
Added:
Modified:
llvm/lib/Target/AMDGPU/SIInstrInfo.td
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.td b/llvm/lib/Target/AMDGPU/SIInstrInfo.td
index 2b47686f23c238..4b7555de712c80 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.td
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.td
@@ -1571,13 +1571,15 @@ class getVOP3SrcForVT<ValueType VT, bit IsTrue16 = 0> {
// Src2 of VOP3 DPP instructions cannot be a literal
class getVOP3DPPSrcForVT<ValueType VT> {
RegisterOperand ret =
- !if (!eq(VT.Value, i1.Value), SSrc_i1,
- !if (VT.isFP,
- !if (!or(!eq(VT.Value, f16.Value), !eq(VT.Value, bf16.Value)), VCSrc_f16,
- !if (!or(!eq(VT.Value, v2f16.Value), !eq(VT.Value, v2bf16.Value)), VCSrc_v2f16, VCSrc_f32)),
- !if (!eq(VT.Value, i16.Value), VCSrc_b16,
- !if (!eq(VT.Value, v2i16.Value), VCSrc_v2b16,
- VCSrc_b32))));
+ !cond(!eq(VT, i1) : SSrc_i1,
+ !eq(VT, i16) : VCSrc_b16,
+ !eq(VT, f16) : VCSrc_f16,
+ !eq(VT, bf16) : VCSrc_f16,
+ !eq(VT, v2i16) : VCSrc_v2b16,
+ !eq(VT, v2f16) : VCSrc_v2f16,
+ !eq(VT, v2bf16) : VCSrc_v2f16,
+ !eq(VT, f32) : VCSrc_f32,
+ 1 : VCSrc_b32);
}
// Float or packed int
More information about the llvm-commits
mailing list