[llvm] 78ae1f6 - [AMDGPU] Change predicate for fma/fmac legacy
Stanislav Mekhanoshin via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 27 12:04:02 PDT 2020
Author: Stanislav Mekhanoshin
Date: 2020-10-27T12:03:52-07:00
New Revision: 78ae1f6c90029c7b213ac6fc01e460f5edb327c9
URL: https://github.com/llvm/llvm-project/commit/78ae1f6c90029c7b213ac6fc01e460f5edb327c9
DIFF: https://github.com/llvm/llvm-project/commit/78ae1f6c90029c7b213ac6fc01e460f5edb327c9.diff
LOG: [AMDGPU] Change predicate for fma/fmac legacy
I do not exactly like the use of a negative predicate to
enable instructions' support. Change HasNoMadMacF32Insts
with HasFmaLegacy32.
Differential Revision: https://reviews.llvm.org/D90250
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPU.td
llvm/lib/Target/AMDGPU/SIInstructions.td
llvm/lib/Target/AMDGPU/VOP2Instructions.td
llvm/lib/Target/AMDGPU/VOP3Instructions.td
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.td b/llvm/lib/Target/AMDGPU/AMDGPU.td
index 2a2c05fd561a..85d790234e6d 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPU.td
+++ b/llvm/lib/Target/AMDGPU/AMDGPU.td
@@ -1269,12 +1269,12 @@ def HasPkFmacF16Inst : Predicate<"Subtarget->hasPkFmacF16Inst()">,
def HasMadMacF32Insts : Predicate<"Subtarget->hasMadMacF32Insts()">,
AssemblerPredicate<(all_of FeatureMadMacF32Insts)>;
+def HasFmaLegacy32 : Predicate<"Subtarget->hasGFX10_3Insts()">,
+ AssemblerPredicate<(any_of FeatureGFX10_3Insts)>;
+
def HasAtomicFaddInsts : Predicate<"Subtarget->hasAtomicFaddInsts()">,
AssemblerPredicate<(all_of FeatureAtomicFaddInsts)>;
-def HasNoMadMacF32Insts : Predicate<"!Subtarget->hasMadMacF32Insts()">,
- AssemblerPredicate<(all_of (not FeatureMadMacF32Insts))>;
-
def HasDsSrc2Insts : Predicate<"!Subtarget->hasDsSrc2Insts()">,
AssemblerPredicate<(all_of FeatureDsSrc2Insts)>;
diff --git a/llvm/lib/Target/AMDGPU/SIInstructions.td b/llvm/lib/Target/AMDGPU/SIInstructions.td
index 808ccacd6910..1fdb5ed37be4 100644
--- a/llvm/lib/Target/AMDGPU/SIInstructions.td
+++ b/llvm/lib/Target/AMDGPU/SIInstructions.td
@@ -897,7 +897,7 @@ def : GCNPat <
// Don't allow source modifiers. If there are any source modifiers then it's
// better to select fma instead of fmac.
-let SubtargetPredicate = HasNoMadMacF32Insts in
+let SubtargetPredicate = HasFmaLegacy32 in
def : GCNPat <
(f32 (int_amdgcn_fma_legacy (VOP3NoMods f32:$src0),
(VOP3NoMods f32:$src1),
diff --git a/llvm/lib/Target/AMDGPU/VOP2Instructions.td b/llvm/lib/Target/AMDGPU/VOP2Instructions.td
index d089060eff7a..d788c7de1bc8 100644
--- a/llvm/lib/Target/AMDGPU/VOP2Instructions.td
+++ b/llvm/lib/Target/AMDGPU/VOP2Instructions.td
@@ -679,7 +679,7 @@ defm V_FMAC_F32 : VOP2Inst <"v_fmac_f32", VOP_MAC_F32>;
} // End SubtargetPredicate = HasDLInsts
-let SubtargetPredicate = HasNoMadMacF32Insts in {
+let SubtargetPredicate = HasFmaLegacy32 in {
let Constraints = "$vdst = $src2",
DisableEncoding = "$src2",
@@ -687,7 +687,7 @@ let Constraints = "$vdst = $src2",
isCommutable = 1 in
defm V_FMAC_LEGACY_F32 : VOP2Inst <"v_fmac_legacy_f32", VOP_MAC_LEGACY_F32>;
-} // End SubtargetPredicate = HasNoMadMacF32Insts
+} // End SubtargetPredicate = HasFmaLegacy32
let Constraints = "$vdst = $src2",
DisableEncoding="$src2",
diff --git a/llvm/lib/Target/AMDGPU/VOP3Instructions.td b/llvm/lib/Target/AMDGPU/VOP3Instructions.td
index 2a0b7466c7f2..cb8a1c6da4d1 100644
--- a/llvm/lib/Target/AMDGPU/VOP3Instructions.td
+++ b/llvm/lib/Target/AMDGPU/VOP3Instructions.td
@@ -297,7 +297,7 @@ def V_MAD_LEGACY_F32 : VOP3Inst <"v_mad_legacy_f32", VOP3_Profile<VOP_F32_F32_F3
def V_MAD_F32 : VOP3Inst <"v_mad_f32", VOP3_Profile<VOP_F32_F32_F32_F32>, fmad>;
} // End SubtargetPredicate = HasMadMacInsts
-let SubtargetPredicate = HasNoMadMacF32Insts in
+let SubtargetPredicate = HasFmaLegacy32 in
def V_FMA_LEGACY_F32 : VOP3Inst <"v_fma_legacy_f32",
VOP3_Profile<VOP_F32_F32_F32_F32>,
int_amdgcn_fma_legacy>;
More information about the llvm-commits
mailing list