[Mlir-commits] [mlir] [mlir][vector] Use `ShapeCastOp` in `castAwayContractionLeadingOneDim` (PR #226524)

Federico Bruzzone llvmlistbot at llvm.org
Sun Sep 27 00:41:24 PDT 2026


================
@@ -337,18 +377,16 @@ mlir::vector::castAwayContractionLeadingOneDim(vector::ContractionOp contractOp,
     return failure();
   if (oldAccType.getRank() < 1)
     return failure();
-  if (oldAccType.getShape()[0] != 1)
+  if (oldAccType.getShape()[0] != 1 || oldAccType.getScalableDims()[0])
     return failure();
-  // currently we support only dropping one dim but the pattern can be applied
-  // greedily to drop more.
-  int64_t dropDim = 1;
 
   auto oldIndexingMaps = contractOp.getIndexingMapsArray();
   SmallVector<AffineMap> newIndexingMaps;
 
   auto oldIteratorTypes = contractOp.getIteratorTypes();
   SmallVector<Attribute> newIteratorTypes;
 
+  // 0-th dim from the accuumlator
----------------
FedericoBruzzone wrote:

[nit]
```suggestion
  // 0-th dim from the accumulator
```

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


More information about the Mlir-commits mailing list