[Mlir-commits] [mlir] [MLIR][Vector] Broadcast folding creates invalid scalar-result vector.contract (PR #230256)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Oct 9 20:13:09 PDT 2026
================
@@ -526,3 +526,39 @@ func.func @contract_result_transpose(%lhs : vector<2x4x4xf32>, %rhs: vector<4x8x
%resT = vector.transpose %contract, [0, 2, 1] : vector<2x4x8xf32> to vector<2x8x4xf32>
return %resT : vector<2x8x4xf32>
}
+
+// -----
+
+// Regression test for the one-sided broadcast fold in CombineContractBroadcast.
+// Folding a broadcast-like shape_cast into only one operand of a contraction
+// must be rejected: the pass used to accept it whenever a single reduction pair
+// remained, leaving the other retained reductions unpaired. Those became free
+// dimensions and produced an invalid scalar-result vector.contract. Here the
+// fold is refused, so the shape_cast, broadcast and contract are preserved.
----------------
StarOne01 wrote:
could we make the comment more concise and simpler to understand?
https://github.com/llvm/llvm-project/pull/230256
More information about the Mlir-commits
mailing list