[clang] [llvm] [mlir] [clang][NVPTX] Add support for pzo in f32/f16x2/bf16x2 to FP4 conversions (PR #225318)

Durgadoss R via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 03:20:41 PDT 2026


================
@@ -3244,29 +3244,41 @@ let Predicates = [hasNarrowFPToBF16x2ConversionSupport] in {
   }
 } // let Predicates = [hasNarrowFPToBF16x2ConversionSupport]
 
-let Predicates = [hasNarrowFPConversionSupport] in {
-  def : Pat<(int_nvvm_ff_to_e2m1x2_rn_satfinite f32:$a, f32:$b),
-            (CVT_e2m1x2_f32_sf $a, $b, CvtRN)>;
-  def : Pat<(int_nvvm_ff_to_e2m1x2_rn_relu_satfinite f32:$a, f32:$b),
-            (CVT_e2m1x2_f32_sf $a, $b, CvtRN_RELU)>;
+foreach relu = ["", "relu"] in {
+  foreach rnd = ["rn", "rz"] in {
+    defvar Relu     = !if(!empty(relu), "", "_" # relu);
----------------
durga4github wrote:

StrJoin can be handy here, to avoid the empty check

https://github.com/llvm/llvm-project/pull/225318


More information about the llvm-commits mailing list