[Mlir-commits] [mlir] [mlir][vector] NFC - Add more structured interface support to vector.… (PR #145313)
Fabian Mora
llvmlistbot at llvm.org
Mon Jun 23 06:16:11 PDT 2025
================
@@ -207,6 +207,39 @@ def Vector_ContractionOp :
.template getAsValueRange<IteratorTypeAttr, IteratorType>();
return {range.begin(), range.end()};
}
+
+ //===------------------------------------------------------------------===//
+ // The code below is shared with LinalgStructuredInterface.
+ // vector.contract is really a linalg.generic on vectors without region.
+ // TODO: factor out in a common interface to inherit from ince identified.
+ //===------------------------------------------------------------------===//
+ ArrayRef<int64_t> getShape(OpOperand * opOperand) {
+ assert(opOperand->getOwner() == this->getOperation());
+ Type t = opOperand->get().getType();
+ return cast<VectorType>(t).getShape();
+ }
+
+ AffineMap getLoopsToShapesMap() {
+ auto maps = getIndexingMapsArray();
+ return concatAffineMaps(maps, getContext());
+ }
+
+ AffineMap getShapesToLoopsMap() {
+ return inversePermutation(getLoopsToShapesMap());
+ }
+
+ SmallVector<int64_t> getStaticShape(){
----------------
fabianmcg wrote:
```suggestion
SmallVector<int64_t> getStaticShape() {
```
https://github.com/llvm/llvm-project/pull/145313
More information about the Mlir-commits
mailing list