[llvm] 60bb5c5 - [AMDGPU] Fix predicates for various True16 instructions. (#77581)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 10 04:58:22 PST 2024
Author: Ivan Kosarev
Date: 2024-01-10T12:58:18Z
New Revision: 60bb5c54f6e1eeed0aae7917d10f746ee8135d9d
URL: https://github.com/llvm/llvm-project/commit/60bb5c54f6e1eeed0aae7917d10f746ee8135d9d
DIFF: https://github.com/llvm/llvm-project/commit/60bb5c54f6e1eeed0aae7917d10f746ee8135d9d.diff
LOG: [AMDGPU] Fix predicates for various True16 instructions. (#77581)
Resolves AsmParser ambiguities, e.g., between
V_SUBREV_F16_t16_dpp8_gfx11 and V_SUBREV_F16_t16_dpp8_gfx12.
Part of <https://github.com/llvm/llvm-project/issues/69256>.
Added:
Modified:
llvm/lib/Target/AMDGPU/VOP2Instructions.td
llvm/lib/Target/AMDGPU/VOPInstructions.td
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/VOP2Instructions.td b/llvm/lib/Target/AMDGPU/VOP2Instructions.td
index 3e66b5550cce2b..48d4e259bc1cec 100644
--- a/llvm/lib/Target/AMDGPU/VOP2Instructions.td
+++ b/llvm/lib/Target/AMDGPU/VOP2Instructions.td
@@ -111,8 +111,8 @@ class VOP2_Real <VOP2_Pseudo ps, int EncodingFamily, string real_name = ps.Mnemo
class VOP2_Real_Gen <VOP2_Pseudo ps, GFXGen Gen, string real_name = ps.Mnemonic> :
VOP2_Real <ps, Gen.Subtarget, real_name> {
- let AssemblerPredicate = !if(ps.Pfl.IsRealTrue16, UseRealTrue16Insts,
- Gen.AssemblerPredicate);
+ let AssemblerPredicate = Gen.AssemblerPredicate;
+ let OtherPredicates = !if(ps.Pfl.IsRealTrue16, [UseRealTrue16Insts], []);
let DecoderNamespace = Gen.DecoderNamespace#
!if(ps.Pfl.IsRealTrue16, "", "_FAKE16");
}
@@ -1275,8 +1275,8 @@ class VOP2_DPP16<bits<6> op, VOP2_DPP_Pseudo ps, int subtarget,
class VOP2_DPP16_Gen<bits<6> op, VOP2_DPP_Pseudo ps, GFXGen Gen,
string opName = ps.OpName, VOPProfile p = ps.Pfl> :
VOP2_DPP16<op, ps, Gen.Subtarget, opName, p> {
- let AssemblerPredicate = !if(ps.Pfl.IsRealTrue16, UseRealTrue16Insts,
- Gen.AssemblerPredicate);
+ let AssemblerPredicate = Gen.AssemblerPredicate;
+ let OtherPredicates = !if(ps.Pfl.IsRealTrue16, [UseRealTrue16Insts], []);
let DecoderNamespace = "DPP"#Gen.DecoderNamespace#
!if(ps.Pfl.IsRealTrue16, "", "_FAKE16");
}
@@ -1304,8 +1304,8 @@ class VOP2_DPP8<bits<6> op, VOP2_Pseudo ps,
class VOP2_DPP8_Gen<bits<6> op, VOP2_Pseudo ps, GFXGen Gen,
VOPProfile p = ps.Pfl> :
VOP2_DPP8<op, ps, p> {
- let AssemblerPredicate = !if(ps.Pfl.IsRealTrue16, UseRealTrue16Insts,
- Gen.AssemblerPredicate);
+ let AssemblerPredicate = Gen.AssemblerPredicate;
+ let OtherPredicates = !if(ps.Pfl.IsRealTrue16, [UseRealTrue16Insts], []);
let DecoderNamespace = "DPP8"#Gen.DecoderNamespace#
!if(ps.Pfl.IsRealTrue16, "", "_FAKE16");
}
diff --git a/llvm/lib/Target/AMDGPU/VOPInstructions.td b/llvm/lib/Target/AMDGPU/VOPInstructions.td
index fd4626d902acea..c4b9e706309374 100644
--- a/llvm/lib/Target/AMDGPU/VOPInstructions.td
+++ b/llvm/lib/Target/AMDGPU/VOPInstructions.td
@@ -208,8 +208,8 @@ class VOP3_Real <VOP_Pseudo ps, int EncodingFamily, string asm_name = ps.Mnemoni
class VOP3_Real_Gen <VOP_Pseudo ps, GFXGen Gen, string asm_name = ps.Mnemonic> :
VOP3_Real <ps, Gen.Subtarget, asm_name> {
- let AssemblerPredicate = !if(ps.Pfl.IsRealTrue16, UseRealTrue16Insts,
- Gen.AssemblerPredicate);
+ let AssemblerPredicate = Gen.AssemblerPredicate;
+ let OtherPredicates = !if(ps.Pfl.IsRealTrue16, [UseRealTrue16Insts], []);
let DecoderNamespace = Gen.DecoderNamespace#
!if(ps.Pfl.IsRealTrue16, "", "_FAKE16");
}
@@ -1340,8 +1340,8 @@ class VOP3_DPP16<bits<10> op, VOP_DPP_Pseudo ps, int subtarget,
class VOP3_DPP16_Gen<bits<10> op, VOP_DPP_Pseudo ps, GFXGen Gen,
string opName = ps.OpName> :
VOP3_DPP16 <op, ps, Gen.Subtarget, opName> {
- let AssemblerPredicate = !if(ps.Pfl.IsRealTrue16, UseRealTrue16Insts,
- Gen.AssemblerPredicate);
+ let AssemblerPredicate = Gen.AssemblerPredicate;
+ let OtherPredicates = !if(ps.Pfl.IsRealTrue16, [UseRealTrue16Insts], []);
let DecoderNamespace = "DPP"#Gen.DecoderNamespace#
!if(ps.Pfl.IsRealTrue16, "", "_FAKE16");
}
@@ -1470,9 +1470,8 @@ multiclass VOP3_Real_dpp8_with_name<GFXGen Gen, bits<10> op, string opName,
let AsmString = asmName # ps.Pfl.AsmVOP3DPP8,
DecoderNamespace = "DPP8"#Gen.DecoderNamespace#
!if(ps.Pfl.IsRealTrue16, "", "_FAKE16"),
- AssemblerPredicate = !if(ps.Pfl.IsRealTrue16, UseRealTrue16Insts,
- Gen.AssemblerPredicate) in {
-
+ OtherPredicates = !if(ps.Pfl.IsRealTrue16, [UseRealTrue16Insts],
+ [TruePredicate]) in {
defm NAME : VOP3_Real_dpp8_Base<Gen, op, opName>;
}
}
More information about the llvm-commits
mailing list