[Mlir-commits] [mlir] d6f914f - [mlir][vector] Drop Linalg dependency from transfer full/partial split (#237985)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Nov 3 01:47:45 PST 2026


Author: Markus Böck
Date: 2026-11-03T09:47:40Z
New Revision: d6f914f06a18019d56f1e7899de9e1a0f666d0c3

URL: https://github.com/llvm/llvm-project/commit/d6f914f06a18019d56f1e7899de9e1a0f666d0c3
DIFF: https://github.com/llvm/llvm-project/commit/d6f914f06a18019d56f1e7899de9e1a0f666d0c3.diff

LOG: [mlir][vector] Drop Linalg dependency from transfer full/partial split (#237985)

The `LinalgCopy` strategy of the vector transfer full/partial split was
the only reason MLIRVectorTransforms depended on the Linalg dialect: its
read slow path filled the temporary buffer with `linalg.fill`. The
copies were already `memref.copy` since
https://reviews.llvm.org/D118028.

The temporary buffer is a statically shaped alloca holding exactly one
vector, so fill it with a `vector.broadcast` of the padding value stored
through `vector.type_cast`. This is the same buffer access the
`VectorTransfer` strategy already uses.

As the strategy no longer creates any Linalg ops, rename it from
`LinalgCopy` to `MemRefCopy`

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.h
    mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.td
    mlir/include/mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h
    mlir/include/mlir/Dialect/Vector/Transforms/VectorTransforms.h
    mlir/include/mlir/Dialect/Vector/Transforms/VectorTransformsBase.td
    mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt
    mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp
    mlir/test/Dialect/LLVM/transform-e2e.mlir
    mlir/test/Dialect/Vector/transform-vector.mlir
    mlir/test/Dialect/Vector/vector-transfer-full-partial-split-copy-transform.mlir
    mlir/test/python/dialects/transform_vector_ext.py

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.h b/mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.h
index c43a8a0b02c67e..1f09bbe078d2c7 100644
--- a/mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.h
+++ b/mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.h
@@ -42,7 +42,7 @@ struct LowerVectorsOptions : public VectorTransformsOptions {
     setVectorMultiReductionLowering(
         VectorMultiReductionLowering::InnerParallel);
     setVectorTransposeLowering(VectorTransposeLowering::EltWise);
-    setVectorTransferSplit(VectorTransferSplit::LinalgCopy);
+    setVectorTransferSplit(VectorTransferSplit::MemRefCopy);
   }
 
   /// Duplicate the base API of VectorTransformsOptions but return the

diff  --git a/mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.td b/mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.td
index af690211b894de..6eca25f6c6c12a 100644
--- a/mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.td
+++ b/mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.td
@@ -546,7 +546,7 @@ def ApplySplitTransferFullPartialPatternsOp : Op<Transform_Dialect,
 
   let arguments = (ins
      DefaultValuedAttr<VectorTransferSplitAttr,
-       "vector::VectorTransferSplit::LinalgCopy">:$split_transfer_strategy
+       "vector::VectorTransferSplit::MemRefCopy">:$split_transfer_strategy
   );
 
   let assemblyFormat = [{

diff  --git a/mlir/include/mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h b/mlir/include/mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h
index ebedcc58af4c28..4df0e2a357b1d7 100644
--- a/mlir/include/mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h
+++ b/mlir/include/mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h
@@ -126,7 +126,7 @@ void populateVectorReductionToContractPatterns(
 ///      memref.cast %A: memref<A...> to compatibleMemRefType
 ///      scf.yield %view : compatibleMemRefType, index, index
 ///    } else {
-///      // slow path, not in-bounds vector.transfer or linalg.copy.
+///      // slow path, not in-bounds vector.transfer or memref.copy.
 ///      memref.cast %alloc: memref<B...> to compatibleMemRefType
 ///      scf.yield %4 : compatibleMemRefType, index, index
 //     }

diff  --git a/mlir/include/mlir/Dialect/Vector/Transforms/VectorTransforms.h b/mlir/include/mlir/Dialect/Vector/Transforms/VectorTransforms.h
index f98e0a47f39eea..750e3eb125af23 100644
--- a/mlir/include/mlir/Dialect/Vector/Transforms/VectorTransforms.h
+++ b/mlir/include/mlir/Dialect/Vector/Transforms/VectorTransforms.h
@@ -86,7 +86,7 @@ struct VectorTransformsOptions {
 ///      memref.cast %A: memref<A...> to compatibleMemRefType
 ///      scf.yield %view : compatibleMemRefType, index, index
 ///    } else {
-///      // slowpath, not in-bounds vector.transfer or linalg.copy.
+///      // slowpath, not in-bounds vector.transfer or memref.copy.
 ///      memref.cast %alloc: memref<B...> to compatibleMemRefType
 ///      scf.yield %4 : compatibleMemRefType, index, index
 //     }

diff  --git a/mlir/include/mlir/Dialect/Vector/Transforms/VectorTransformsBase.td b/mlir/include/mlir/Dialect/Vector/Transforms/VectorTransformsBase.td
index 34febf2c4ff4b1..8d4b821096c356 100644
--- a/mlir/include/mlir/Dialect/Vector/Transforms/VectorTransformsBase.td
+++ b/mlir/include/mlir/Dialect/Vector/Transforms/VectorTransformsBase.td
@@ -70,10 +70,9 @@ def VectorTransferSplit_None: I32EnumAttrCase<"None", 0, "none">;
 // Split using in-bounds + out-of-bounds vector.transfer operations.
 def VectorTransferSplit_VectorTransfer:
   I32EnumAttrCase<"VectorTransfer", 1, "vector-transfer">;
-// Split using an in-bounds vector.transfer + linalg.fill + linalg.copy
-// operations.
-def VectorTransferSplit_LinalgCopy:
-  I32EnumAttrCase<"LinalgCopy", 2, "linalg-copy">;
+// Split using an in-bounds vector.transfer + memref.copy operations.
+def VectorTransferSplit_MemRefCopy:
+  I32EnumAttrCase<"MemRefCopy", 2, "memref-copy">;
 // Do not split vector transfer operation but instead mark it as "in-bounds".
 def VectorTransferSplit_ForceInBounds:
   I32EnumAttrCase<"ForceInBounds", 3, "force-in-bounds">;
@@ -82,7 +81,7 @@ def VectorTransferSplitAttr: I32EnumAttr<
     "control the splitting of `vector.transfer` operations into in-bounds"
     " and out-of-bounds variants.",
   [VectorTransferSplit_None, VectorTransferSplit_VectorTransfer,
-   VectorTransferSplit_LinalgCopy, VectorTransferSplit_ForceInBounds]> {
+   VectorTransferSplit_MemRefCopy, VectorTransferSplit_ForceInBounds]> {
   let cppNamespace = "::mlir::vector";
 }
 #endif

diff  --git a/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt
index fbed837808fa78..2a7f5f9e0c503c 100644
--- a/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt
@@ -47,7 +47,6 @@ add_mlir_dialect_library(MLIRVectorTransforms
   MLIRGPUDialect
   MLIRGPUUtils
   MLIRIR
-  MLIRLinalgDialect
   MLIRMemorySlotInterfaces
   MLIRMemRefDialect
   MLIRMemRefTransforms

diff  --git a/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp
index d436266654de91..ba6ee880f36e3e 100644
--- a/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp
@@ -15,7 +15,6 @@
 
 #include "mlir/Dialect/Affine/IR/AffineOps.h"
 #include "mlir/Dialect/Arith/IR/Arith.h"
-#include "mlir/Dialect/Linalg/IR/Linalg.h"
 #include "mlir/Dialect/MemRef/IR/MemRef.h"
 #include "mlir/Dialect/SCF/IR/SCF.h"
 #include "mlir/Dialect/Utils/StructuredOpsUtils.h"
@@ -91,7 +90,7 @@ static Value createInBoundsCond(RewriterBase &b,
 ///      memref.cast %A: memref<A...> to compatibleMemRefType
 ///      scf.yield %view : compatibleMemRefType, index, index
 ///    } else {
-///      // slow path, not in-bounds vector.transfer or linalg.copy.
+///      // slow path, not in-bounds vector.transfer or memref.copy.
 ///      memref.cast %alloc: memref<B...> to compatibleMemRefType
 ///      scf.yield %4 : compatibleMemRefType, index, index
 //     }
@@ -234,17 +233,19 @@ createSubViewIntersection(RewriterBase &b, VectorTransferOpInterface xferOp,
 ///      %view = memref.cast %A: memref<A...> to compatibleMemRefType
 ///      scf.yield %view, ... : compatibleMemRefType, index, index
 ///    } else {
-///      %2 = linalg.fill(%pad, %alloc)
-///      %3 = subview %view [...][...][...]
-///      %4 = subview %alloc [0, 0] [...] [...]
-///      linalg.copy(%3, %4)
-///      %5 = memref.cast %alloc: memref<B...> to compatibleMemRefType
-///      scf.yield %5, ... : compatibleMemRefType, index, index
+///      %2 = vector.broadcast %pad : elt to vector<...>
+///      %3 = vector.type_cast %alloc : memref<B...> to memref<vector<...>>
+///      memref.store %2, %3[] : memref<vector<...>>
+///      %4 = subview %view [...][...][...]
+///      %5 = subview %alloc [0, 0] [...] [...]
+///      memref.copy %4, %5
+///      %6 = memref.cast %alloc: memref<B...> to compatibleMemRefType
+///      scf.yield %6, ... : compatibleMemRefType, index, index
 ///   }
 /// ```
 /// Return the produced scf::IfOp.
 static scf::IfOp
-createFullPartialLinalgCopy(RewriterBase &b, vector::TransferReadOp xferOp,
+createFullPartialMemRefCopy(RewriterBase &b, vector::TransferReadOp xferOp,
                             TypeRange returnTypes, Value inBoundsCond,
                             MemRefType compatibleMemRefType, Value alloc) {
   Location loc = xferOp.getLoc();
@@ -259,8 +260,14 @@ createFullPartialLinalgCopy(RewriterBase &b, vector::TransferReadOp xferOp,
         scf::YieldOp::create(b, loc, viewAndIndices);
       },
       [&](OpBuilder &b, Location loc) {
-        linalg::FillOp::create(b, loc, ValueRange{xferOp.getPadding()},
-                               ValueRange{alloc});
+        // Fill the whole buffer with the padding value. The buffer holds
+        // exactly one vector, so a single vector store covers it.
+        Value padding = vector::BroadcastOp::create(
+            b, loc, xferOp.getVectorType(), xferOp.getPadding());
+        memref::StoreOp::create(
+            b, loc, padding,
+            vector::TypeCastOp::create(
+                b, loc, MemRefType::get({}, padding.getType()), alloc));
         // Take partial subview of memref which guarantees no dimension
         // overflows.
         IRRewriter rewriter(b);
@@ -380,10 +387,10 @@ getLocationToWriteFullVec(RewriterBase &b, vector::TransferWriteOp xferOp,
 ///    scf.if (%notInBounds) {
 ///      %3 = subview %alloc [...][...][...]
 ///      %4 = subview %view [0, 0][...][...]
-///      linalg.copy(%3, %4)
+///      memref.copy %3, %4
 ///   }
 /// ```
-static void createFullPartialLinalgCopy(RewriterBase &b,
+static void createFullPartialMemRefCopy(RewriterBase &b,
                                         vector::TransferWriteOp xferOp,
                                         Value inBoundsCond, Value alloc) {
   Location loc = xferOp.getLoc();
@@ -469,7 +476,7 @@ static Operation *getAutomaticAllocationScope(Operation *op) {
 ///      memref.cast %A: memref<A...> to compatibleMemRefType
 ///      scf.yield %view : compatibleMemRefType, index, index
 ///    } else {
-///      // slowpath, not in-bounds vector.transfer or linalg.copy.
+///      // slowpath, not in-bounds vector.transfer or memref.copy.
 ///      memref.cast %alloc: memref<B...> to compatibleMemRefType
 ///      scf.yield %4 : compatibleMemRefType, index, index
 //     }
@@ -498,7 +505,7 @@ static Operation *getAutomaticAllocationScope(Operation *op) {
 ///    %0 = vector.transfer_write %arg, %1#0[%1#1, %1#2] {in_bounds = [true ...
 ///                                                                    true]}
 ///    scf.if (%notInBounds) {
-///      // slowpath: not in-bounds vector.transfer or linalg.copy.
+///      // slowpath: not in-bounds vector.transfer or memref.copy.
 ///    }
 /// ```
 /// where `alloc` is a top of the function alloca'ed buffer of one vector.
@@ -581,7 +588,7 @@ LogicalResult mlir::vector::splitFullAndPartialTransfer(
             ? createFullPartialVectorTransferRead(b, xferReadOp, returnTypes,
                                                   inBoundsCond,
                                                   compatibleMemRefType, alloc)
-            : createFullPartialLinalgCopy(b, xferReadOp, returnTypes,
+            : createFullPartialMemRefCopy(b, xferReadOp, returnTypes,
                                           inBoundsCond, compatibleMemRefType,
                                           alloc);
     if (ifOp)
@@ -619,7 +626,7 @@ LogicalResult mlir::vector::splitFullAndPartialTransfer(
   if (options.vectorTransferSplit == VectorTransferSplit::VectorTransfer)
     createFullPartialVectorTransferWrite(b, xferWriteOp, inBoundsCond, alloc);
   else
-    createFullPartialLinalgCopy(b, xferWriteOp, inBoundsCond, alloc);
+    createFullPartialMemRefCopy(b, xferWriteOp, inBoundsCond, alloc);
 
   b.eraseOp(xferOp);
 

diff  --git a/mlir/test/Dialect/LLVM/transform-e2e.mlir b/mlir/test/Dialect/LLVM/transform-e2e.mlir
index 589cf15547e19f..5244cb313143a1 100644
--- a/mlir/test/Dialect/LLVM/transform-e2e.mlir
+++ b/mlir/test/Dialect/LLVM/transform-e2e.mlir
@@ -33,7 +33,7 @@ module attributes {transform.with_named_sequence} {
       transform.apply_patterns.vector.reorder_multi_reduction_dims lowering_strategy = "innerparallel"
       transform.apply_patterns.vector.multi_reduction_flattening lowering_strategy = "innerparallel"
       transform.apply_patterns.vector.multi_reduction_unrolling lowering_strategy = "innerparallel"
-      transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "linalg-copy"
+      transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "memref-copy"
       transform.apply_patterns.vector.transfer_to_scf max_transfer_rank = 1 full_unroll = true
       transform.apply_patterns.vector.lower_transfer max_transfer_rank = 1
       transform.apply_patterns.vector.lower_shape_cast

diff  --git a/mlir/test/Dialect/Vector/transform-vector.mlir b/mlir/test/Dialect/Vector/transform-vector.mlir
index 16011e3041eb55..889fe6979265b9 100644
--- a/mlir/test/Dialect/Vector/transform-vector.mlir
+++ b/mlir/test/Dialect/Vector/transform-vector.mlir
@@ -45,7 +45,7 @@ module attributes {transform.with_named_sequence} {
     } : !transform.any_op
 
     transform.apply_patterns to %f {
-      transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "linalg-copy"
+      transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "memref-copy"
     } : !transform.any_op
 
     transform.apply_patterns to %f {

diff  --git a/mlir/test/Dialect/Vector/vector-transfer-full-partial-split-copy-transform.mlir b/mlir/test/Dialect/Vector/vector-transfer-full-partial-split-copy-transform.mlir
index 068557a6d85aaa..7e523eaf3ba114 100644
--- a/mlir/test/Dialect/Vector/vector-transfer-full-partial-split-copy-transform.mlir
+++ b/mlir/test/Dialect/Vector/vector-transfer-full-partial-split-copy-transform.mlir
@@ -16,6 +16,8 @@ func.func @split_vector_transfer_read_2d(%A: memref<?x8xf32>, %i: index, %j: ind
   //  CHECK-DAG: %[[c0:.*]] = arith.constant 0 : index
   //  CHECK-DAG: %[[c4:.*]] = arith.constant 4 : index
   //  CHECK-DAG: %[[c8:.*]] = arith.constant 8 : index
+  //  CHECK-DAG: %[[pad:.*]] = arith.constant 0.000000e+00 : f32
+  //  CHECK-DAG: %[[pad_vec:.*]] = arith.constant dense<0.000000e+00> : vector<4x8xf32>
   // alloca for boundary full tile
   //      CHECK: %[[alloc:.*]] = memref.alloca() alignment = 32 : memref<4x8xf32>
   // %i + 4 <= dim(%A, 0)
@@ -32,7 +34,8 @@ func.func @split_vector_transfer_read_2d(%A: memref<?x8xf32>, %i: index, %j: ind
   //      CHECK:   scf.yield %[[A]], %[[i]], %[[j]] : memref<?x8xf32>, index, index
   //      CHECK: } else {
   //               slow path, fill tmp alloc and yield a memref_casted version of it
-  //      CHECK:   linalg.fill ins(%cst : f32) outs(%[[alloc]] : memref<4x8xf32>)
+  //      CHECK:   %[[alloc_vec:.*]] = vector.type_cast %[[alloc]] : memref<4x8xf32> to memref<vector<4x8xf32>>
+  //      CHECK:   memref.store %[[pad_vec]], %[[alloc_vec]][] : memref<vector<4x8xf32>>
   //      CHECK:   %[[d0:.*]] = memref.dim %[[A]], %[[c0]] : memref<?x8xf32>
   //      CHECK:   %[[sv0:.*]] = affine.min #[[$bounds_map_4]](%[[d0]], %[[i]], %[[c4]])
   //      CHECK:   %[[sv1:.*]] = affine.min #[[$bounds_map_8]](%[[c8]], %[[j]], %[[c8]])
@@ -45,7 +48,7 @@ func.func @split_vector_transfer_read_2d(%A: memref<?x8xf32>, %i: index, %j: ind
   //      CHECK:   scf.yield %[[yielded]], %[[c0]], %[[c0]] :
   // CHECK-SAME:     memref<?x8xf32>, index, index
   //      CHECK: }
-  //      CHECK: %[[res:.*]] = vector.transfer_read %[[ifres]]#0[%[[ifres]]#1, %[[ifres]]#2], %cst
+  //      CHECK: %[[res:.*]] = vector.transfer_read %[[ifres]]#0[%[[ifres]]#1, %[[ifres]]#2], %[[pad]]
   // CHECK-SAME:   {in_bounds = [true, true]} : memref<?x8xf32>, vector<4x8xf32>
   %1 = vector.transfer_read %A[%i, %j], %f0 : memref<?x8xf32>, vector<4x8xf32>
 
@@ -68,6 +71,7 @@ func.func @split_vector_transfer_read_strided_2d(
   //  CHECK-DAG: %[[c4:.*]] = arith.constant 4 : index
   //  CHECK-DAG: %[[c7:.*]] = arith.constant 7 : index
   //  CHECK-DAG: %[[c8:.*]] = arith.constant 8 : index
+  //  CHECK-DAG: %[[pad_vec:.*]] = arith.constant dense<0.000000e+00> : vector<4x8xf32>
   // alloca for boundary full tile
   //      CHECK: %[[alloc:.*]] = memref.alloca() alignment = 32 : memref<4x8xf32>
   // %i + 4 <= dim(%A, 0)
@@ -86,7 +90,8 @@ func.func @split_vector_transfer_read_strided_2d(
   // CHECK-SAME:     memref<?x8xf32, strided<[?, 1], offset: ?>>, index, index
   //      CHECK: } else {
   //               slow path, fill tmp alloc and yield a memref_casted version of it
-  //      CHECK:   linalg.fill ins(%cst : f32) outs(%[[alloc]] : memref<4x8xf32>)
+  //      CHECK:   %[[alloc_vec:.*]] = vector.type_cast %[[alloc]] : memref<4x8xf32> to memref<vector<4x8xf32>>
+  //      CHECK:   memref.store %[[pad_vec]], %[[alloc_vec]][] : memref<vector<4x8xf32>>
   //      CHECK:   %[[sv0:.*]] = affine.min #[[$bounds_map_4]](%[[c7]], %[[i]], %[[c4]])
   //      CHECK:   %[[sv1:.*]] = affine.min #[[$bounds_map_8]](%[[c8]], %[[j]], %[[c8]])
   //      CHECK:   %[[sv:.*]] = memref.subview %[[A]][%[[i]], %[[j]]] [%[[sv0]], %[[sv1]]] [1, 1]
@@ -106,11 +111,42 @@ func.func @split_vector_transfer_read_strided_2d(
   return %1 : vector<4x8xf32>
 }
 
+// CHECK-LABEL: split_vector_transfer_read_2d_non_constant_padding(
+//  CHECK-SAME: %[[A:[a-zA-Z0-9_]*]]: memref
+//  CHECK-SAME: %[[i:[a-zA-Z0-9_]*]]: index
+//  CHECK-SAME: %[[j:[a-zA-Z0-9_]*]]: index
+//  CHECK-SAME: %[[pad:[a-zA-Z0-9_]*]]: f32
+func.func @split_vector_transfer_read_2d_non_constant_padding(
+    %A: memref<?x8xf32>, %i: index, %j: index, %pad: f32) -> vector<4x8xf32> {
+  //      CHECK: %[[alloc:.*]] = memref.alloca() alignment = 32 : memref<4x8xf32>
+  //      CHECK: %[[ifres:.*]]:3 = scf.if %{{.*}} -> (memref<?x8xf32>, index, index) {
+  //      CHECK:   scf.yield %[[A]], %[[i]], %[[j]] : memref<?x8xf32>, index, index
+  //      CHECK: } else {
+  //               slow path, fill tmp alloc with the broadcasted padding value
+  //      CHECK:   %[[pad_vec:.*]] = vector.broadcast %[[pad]] : f32 to vector<4x8xf32>
+  //      CHECK:   %[[alloc_vec:.*]] = vector.type_cast %[[alloc]] : memref<4x8xf32> to memref<vector<4x8xf32>>
+  //      CHECK:   memref.store %[[pad_vec]], %[[alloc_vec]][] : memref<vector<4x8xf32>>
+  //      CHECK:   %[[sv:.*]] = memref.subview %[[A]][%[[i]], %[[j]]]
+  //      CHECK:   %[[alloc_view:.*]] = memref.subview %[[alloc]][0, 0]
+  //      CHECK:   memref.copy %[[sv]], %[[alloc_view]]
+  //      CHECK:   %[[yielded:.*]] = memref.cast %[[alloc]] :
+  // CHECK-SAME:     memref<4x8xf32> to memref<?x8xf32>
+  //      CHECK:   scf.yield %[[yielded]], %{{.*}}, %{{.*}} :
+  // CHECK-SAME:     memref<?x8xf32>, index, index
+  //      CHECK: }
+  //      CHECK: %[[res:.*]] = vector.transfer_read %[[ifres]]#0[%[[ifres]]#1, %[[ifres]]#2], %[[pad]]
+  // CHECK-SAME:   {in_bounds = [true, true]} : memref<?x8xf32>, vector<4x8xf32>
+  %1 = vector.transfer_read %A[%i, %j], %pad : memref<?x8xf32>, vector<4x8xf32>
+
+  // CHECK: return %[[res]] : vector<4x8xf32>
+  return %1 : vector<4x8xf32>
+}
+
 module attributes {transform.with_named_sequence} {
   transform.named_sequence @__transform_main(%root : !transform.any_op {transform.readonly}) {
     %func_op = transform.structured.match ops{["func.func"]} in %root : (!transform.any_op) -> !transform.op<"func.func">
     transform.apply_patterns to %func_op {
-      transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "linalg-copy"
+      transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "memref-copy"
     } : !transform.op<"func.func">
     transform.yield
   }
@@ -174,7 +210,7 @@ module attributes {transform.with_named_sequence} {
   transform.named_sequence @__transform_main(%root : !transform.any_op {transform.readonly}) {
     %func_op = transform.structured.match ops{["func.func"]} in %root : (!transform.any_op) -> !transform.op<"func.func">
     transform.apply_patterns to %func_op {
-      transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "linalg-copy"
+      transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "memref-copy"
     } : !transform.op<"func.func">
     transform.yield
   }
@@ -245,7 +281,7 @@ module attributes {transform.with_named_sequence} {
   transform.named_sequence @__transform_main(%root : !transform.any_op {transform.readonly}) {
     %func_op = transform.structured.match ops{["func.func"]} in %root : (!transform.any_op) -> !transform.op<"func.func">
     transform.apply_patterns to %func_op {
-      transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "linalg-copy"
+      transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "memref-copy"
     } : !transform.op<"func.func">
     transform.yield
   }

diff  --git a/mlir/test/python/dialects/transform_vector_ext.py b/mlir/test/python/dialects/transform_vector_ext.py
index 26225e014ed7b2..1d5396adc2ae75 100644
--- a/mlir/test/python/dialects/transform_vector_ext.py
+++ b/mlir/test/python/dialects/transform_vector_ext.py
@@ -163,7 +163,7 @@ def enum_configurable_patterns():
     # CHECK: transform.apply_patterns.vector.split_transfer_full_partial
     # This is the default mode, not printed.
     vector.ApplySplitTransferFullPartialPatternsOp(
-        split_transfer_strategy=vector.VectorTransferSplit.LinalgCopy
+        split_transfer_strategy=vector.VectorTransferSplit.MemRefCopy
     )
     # CHECK: transform.apply_patterns.vector.split_transfer_full_partial
     # CHECK-SAME: split_transfer_strategy = "force-in-bounds"


        


More information about the Mlir-commits mailing list