[Mlir-commits] [mlir] [MLIR] [Vector] ConstantFold MultiDReduction (PR #122450)

Andrzej WarzyƄski llvmlistbot at llvm.org
Fri Jan 10 11:56:37 PST 2025


================
@@ -11,3 +11,57 @@ func.func @fold_extract_transpose_negative(%arg0: vector<4x4xf16>) -> vector<4x4
   %2 = vector.extract %1[0] : vector<4x4xf16> from vector<1x4x4xf16>
   return %2 : vector<4x4xf16>
 }
+
+// CHECK-LABEL: fold_multid_reduction_f32_add
+func.func @fold_multid_reduction_f32_add() -> vector<1xf32> {
+  %cst_0 = arith.constant dense<0.000000e+00> : vector<1xf32>
----------------
banach-space wrote:

[nit]
```suggestion
  %acc = arith.constant dense<0.000000e+00> : vector<1xf32>
```

I'm not sure what the difference between `%cst_0` and `%cst_1` below is meant to mean. I'd just stick to names from the Op definition.

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


More information about the Mlir-commits mailing list