Index: llvm/lib/Target/AMDGPU/AMDGPU.td =================================================================== --- llvm/lib/Target/AMDGPU/AMDGPU.td +++ llvm/lib/Target/AMDGPU/AMDGPU.td @@ -1125,6 +1125,9 @@ Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::GFX10">, AssemblerPredicate<(all_of FeatureGFX10Insts)>; +def isGFX10_3Plus : Predicate<"Subtarget->hasGFX10_3Insts()">, + AssemblerPredicate<(any_of FeatureGFX10_3Insts)>; + def HasFlatAddressSpace : Predicate<"Subtarget->hasFlatAddressSpace()">, AssemblerPredicate<(all_of FeatureFlatAddressSpace)>; @@ -1272,9 +1275,6 @@ 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)>; Index: llvm/lib/Target/AMDGPU/SIInstructions.td =================================================================== --- llvm/lib/Target/AMDGPU/SIInstructions.td +++ llvm/lib/Target/AMDGPU/SIInstructions.td @@ -897,7 +897,7 @@ // 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 = isGFX10_3Plus in def : GCNPat < (f32 (int_amdgcn_fma_legacy (VOP3NoMods f32:$src0), (VOP3NoMods f32:$src1), Index: llvm/lib/Target/AMDGPU/VOP2Instructions.td =================================================================== --- llvm/lib/Target/AMDGPU/VOP2Instructions.td +++ llvm/lib/Target/AMDGPU/VOP2Instructions.td @@ -679,7 +679,7 @@ } // End SubtargetPredicate = HasDLInsts -let SubtargetPredicate = HasNoMadMacF32Insts in { +let SubtargetPredicate = isGFX10_3Plus in { let Constraints = "$vdst = $src2", DisableEncoding = "$src2", @@ -687,7 +687,7 @@ isCommutable = 1 in defm V_FMAC_LEGACY_F32 : VOP2Inst <"v_fmac_legacy_f32", VOP_MAC_LEGACY_F32>; -} // End SubtargetPredicate = HasNoMadMacF32Insts +} // End SubtargetPredicate = isGFX10_3Plus let Constraints = "$vdst = $src2", DisableEncoding="$src2", Index: llvm/lib/Target/AMDGPU/VOP3Instructions.td =================================================================== --- llvm/lib/Target/AMDGPU/VOP3Instructions.td +++ llvm/lib/Target/AMDGPU/VOP3Instructions.td @@ -297,7 +297,7 @@ def V_MAD_F32 : VOP3Inst <"v_mad_f32", VOP3_Profile, fmad>; } // End SubtargetPredicate = HasMadMacInsts -let SubtargetPredicate = HasNoMadMacF32Insts in +let SubtargetPredicate = isGFX10_3Plus in def V_FMA_LEGACY_F32 : VOP3Inst <"v_fma_legacy_f32", VOP3_Profile, int_amdgcn_fma_legacy>;