[Mlir-commits] [mlir] [Mlir][Vector] fix contraction lowering crashes on scalar results after folding a broadcast-like shape_cast (PR #229824)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Oct 7 08:57:29 PDT 2026


https://github.com/StarOne01 created https://github.com/llvm/llvm-project/pull/229824

changes the type of the `resType` from `VectorType` to `Type` hence enabling `lowerParallel` to return a scalar result

fixes #228971

>From 2b647f9214a9f0080b897719020bf0de0ae64bad Mon Sep 17 00:00:00 2001
From: Prashanth <ping at starone01.me>
Date: Wed, 7 Oct 2026 21:22:07 +0530
Subject: [PATCH] [Mlir][Vector] Change result type in lowerParallel from
 VectorType to Type

---
 mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp
index b3cd4fb1e8f9b..76e71f76063b0 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp
@@ -1010,7 +1010,7 @@ FailureOr<Value> ContractionOpLowering::lowerParallel(PatternRewriter &rewriter,
                                                       Value mask) const {
   VectorType lhsType = op.getLhsType();
   VectorType rhsType = op.getRhsType();
-  VectorType resType = cast<VectorType>(op.getResultType());
+  Type resType = op.getResultType();
   // Find the iterator type index and result index.
   SmallVector<AffineMap> iMap = op.getIndexingMapsArray();
   int64_t iterIndex = -1;



More information about the Mlir-commits mailing list