forked from OSchip/llvm-project
[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
This commit is contained in:
parent
2e1a737f46
commit
78ae1f6c90
|
@ -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)>;
|
||||
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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>;
|
||||
|
|
Loading…
Reference in New Issue