[Mlir-commits] [mlir] [mlir][vector] Propagate `vector.extract` through elementwise ops (PR #131462)

Andrzej WarzyƄski llvmlistbot at llvm.org
Mon Mar 17 10:37:26 PDT 2025


================
@@ -453,4 +453,15 @@ def ApplyVectorReductionToContractPatternsOp : Op<Transform_Dialect,
   let assemblyFormat = "attr-dict";
 }
 
+def ApplyVectorPropagateExtractPatternsOp : Op<Transform_Dialect,
+    "apply_patterns.vector.propagate_extract",
+    [DeclareOpInterfaceMethods<PatternDescriptorOpInterface>]> {
+  let description = [{
+    Collect a set of patterns for propagating `vector.extract` through the
+    vector ops.
----------------
banach-space wrote:

Do we classify Arith ops as vector ops? Also, are you planning to add more patterns like this? Otherwise this TD Op is over-promising a bit.

On a related note, we already have similar patterns for elementwise here: https://github.com/llvm/llvm-project/blob/d928a671b84afb9c2ad64353694537a198f04651/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp#L964-L1044

We should move this pattern there unless there's expectation for this to grow?

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


More information about the Mlir-commits mailing list