[llvm] [AMDGPU] Use a single SubtargetPredicate for fp8/bf8 -> f32 conversions (PR #212888)
Dmitry Sidorov via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 30 05:33:44 PDT 2026
================
@@ -2900,6 +2895,41 @@ def NotHasMAIInsts : Predicate<"!Subtarget->hasMAIInsts()">,
def NotHasFP8E5M3Insts : Predicate<"!Subtarget->hasFP8E5M3Insts()">,
AssemblerPredicate<(all_of (not FeatureFP8E5M3Insts))>;
+// The fp8/bf8 to f32 conversions have three mutually exclusive encodings, so
+// each predicate below covers the instructions and the encoding together.
+def HasFP8ConversionInstsGFX9 :
+ Predicate<"Subtarget->hasFP8ConversionInsts() &&"
+ " Subtarget->getGeneration() == AMDGPUSubtarget::GFX9">,
+ AssemblerPredicate<(all_of FeatureFP8ConversionInsts, FeatureGCN3Encoding,
+ FeatureGFX9Insts)>;
+
+def HasFP8ConversionInstsGFX9NoVOP1Bug :
+ Predicate<"Subtarget->hasFP8ConversionInsts() &&"
+ " Subtarget->getGeneration() == AMDGPUSubtarget::GFX9 &&"
+ " !Subtarget->hasCvtFP8VOP1Bug()">,
+ AssemblerPredicate<(all_of FeatureFP8ConversionInsts, FeatureGCN3Encoding,
+ FeatureGFX9Insts, (not FeatureCvtFP8VOP1Bug))>;
+
+def HasFP8ConversionInstsGFX11Plus :
----------------
MrSidims wrote:
Addressed, thanks! Not sure if we want to give more descriptive name to VOP1Bug.
https://github.com/llvm/llvm-project/pull/212888
More information about the llvm-commits
mailing list