[llvm] c098f2d - [AMDGPU] Rewrite `getVOPSrc0ForVT` with `!cond` (#81956)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 16 08:19:17 PST 2024
Author: Shilei Tian
Date: 2024-02-16T11:19:13-05:00
New Revision: c098f2d1669fb1ec6a5eac81277bd16b334ec956
URL: https://github.com/llvm/llvm-project/commit/c098f2d1669fb1ec6a5eac81277bd16b334ec956
DIFF: https://github.com/llvm/llvm-project/commit/c098f2d1669fb1ec6a5eac81277bd16b334ec956.diff
LOG: [AMDGPU] Rewrite `getVOPSrc0ForVT` with `!cond` (#81956)
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 997cab6618062f..704de4f2783fc9 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.td
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.td
@@ -1488,37 +1488,25 @@ class getSDWADstForVT<ValueType VT> {
// instructions for the given VT.
class getVOPSrc0ForVT<ValueType VT, bit IsTrue16, bit IsFake16 = 1> {
RegisterOperand ret =
- !if(VT.isFP,
- !if(!eq(VT.Size, 64),
- VSrc_f64,
- !if(!or(!eq(VT.Value, f16.Value), !eq(VT.Value, bf16.Value)),
- !if(IsTrue16,
- !if(IsFake16, VSrcFake16_f16_Lo128, VSrcT_f16_Lo128),
- VSrc_f16
- ),
- !if(!or(!eq(VT.Value, v2f16.Value), !eq(VT.Value, v2bf16.Value)),
- VSrc_v2f16,
- !if(!or(!eq(VT.Value, v4f16.Value), !eq(VT.Value, v4bf16.Value)),
- AVSrc_64,
- VSrc_f32
- )
- )
- )
- ),
- !if(!eq(VT.Size, 64),
- VSrc_b64,
- !if(!eq(VT.Value, i16.Value),
- !if(IsTrue16,
- !if(IsFake16, VSrcFake16_b16_Lo128, VSrcT_b16_Lo128),
- VSrc_b16
- ),
- !if(!eq(VT.Value, v2i16.Value),
- VSrc_v2b16,
- VSrc_b32
- )
- )
- )
- );
+ !cond(!eq(VT, i64) : VSrc_b64,
+ !eq(VT, f64) : VSrc_f64,
+ !eq(VT, i32) : VSrc_b32,
+ !eq(VT, f32) : VSrc_f32,
+ !eq(VT, i16) : !if(IsTrue16,
+ !if(IsFake16, VSrcFake16_b16_Lo128, VSrcT_b16_Lo128),
+ VSrc_b16),
+ !eq(VT, f16) : !if(IsTrue16,
+ !if(IsFake16, VSrcFake16_f16_Lo128, VSrcT_f16_Lo128),
+ VSrc_f16),
+ !eq(VT, bf16) : !if(IsTrue16,
+ !if(IsFake16, VSrcFake16_f16_Lo128, VSrcT_f16_Lo128),
+ VSrc_f16),
+ !eq(VT, v2i16) : VSrc_v2b16,
+ !eq(VT, v2f16) : VSrc_v2f16,
+ !eq(VT, v2bf16) : VSrc_v2f16,
+ !eq(VT, v4f16) : AVSrc_64,
+ !eq(VT, v4bf16) : AVSrc_64,
+ 1 : VSrc_b32);
}
class getSOPSrcForVT<ValueType VT> {
More information about the llvm-commits
mailing list