[Mlir-commits] [mlir] 015cd84 - Revert "[mlir][Linalg][Transform] Avoid FunctionalStyleTransformOpTrait where unnecesseary to improve usability"

Nicolas Vasilache llvmlistbot at llvm.org
Mon Mar 20 07:10:06 PDT 2023


Author: Nicolas Vasilache
Date: 2023-03-20T07:07:27-07:00
New Revision: 015cd84d3cdaba1b8dd299f540cd017b61864ff2

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

LOG: Revert "[mlir][Linalg][Transform] Avoid FunctionalStyleTransformOpTrait where unnecesseary to improve usability"

This reverts commit 31aa8ea252c0b6acdcb362c1d0f01cc4b810d6d0.

This is currently not in a good state as we have some footguns due to missing listeners.

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/GPU/TransformOps/GPUTransformOps.td
    mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td
    mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.td
    mlir/lib/Dialect/GPU/TransformOps/GPUTransformOps.cpp
    mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
    mlir/lib/Dialect/Vector/TransformOps/VectorTransformOps.cpp
    mlir/python/mlir/dialects/_structured_transform_ops_ext.py
    mlir/test/Dialect/GPU/transform-gpu-failing.mlir
    mlir/test/Dialect/GPU/transform-gpu.mlir
    mlir/test/Dialect/LLVM/transform-e2e.mlir
    mlir/test/Dialect/Linalg/hoisting.mlir
    mlir/test/Dialect/Linalg/transform-op-vectorize.mlir
    mlir/test/Dialect/Linalg/vectorization.mlir
    mlir/test/Dialect/Transform/selective-targeting.mlir
    mlir/test/Dialect/Vector/transform-vector.mlir
    mlir/test/python/dialects/transform_structured_ext.py

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/GPU/TransformOps/GPUTransformOps.td b/mlir/include/mlir/Dialect/GPU/TransformOps/GPUTransformOps.td
index a218db3a02ce3..c719fedc90e33 100644
--- a/mlir/include/mlir/Dialect/GPU/TransformOps/GPUTransformOps.td
+++ b/mlir/include/mlir/Dialect/GPU/TransformOps/GPUTransformOps.td
@@ -17,7 +17,8 @@ include "mlir/IR/OpBase.td"
 
 def MapNestedForallToThreads :
   Op<Transform_Dialect, "gpu.map_nested_forall_to_threads",
-    [DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
+    [FunctionalStyleTransformOpTrait,
+     MemoryEffectsOpInterface,
      TransformEachOpTrait,
      TransformOpInterface]> {
   let description = [{
@@ -71,7 +72,9 @@ def MapNestedForallToThreads :
       scf.forall operations with mappings other than gpu.thread are
       ignored.
 
-      This operation returns nothing.
+      The returned handle points to the same LaunchOp operand, consuming it and
+      producing a new SSA value to satisfy chaining and linearity of the IR
+      properties.
 
       #### Example:
 
@@ -108,11 +111,11 @@ def MapNestedForallToThreads :
       ```
     }];
 
-  let arguments = (ins TransformHandleTypeInterface:$target,
+  let arguments = (ins PDL_Operation:$target,
                    DefaultValuedAttr<DenseI64ArrayAttr, "{}">:$block_dims,
                    DefaultValuedOptionalAttr<DenseI64ArrayAttr, "{}">:$warp_dims,
                    DefaultValuedAttr<BoolAttr, "true">:$sync_after_distribute);
-  let results = (outs);
+  let results = (outs PDL_Operation:$result);
 
   let assemblyFormat = [{
     $target
@@ -120,7 +123,6 @@ def MapNestedForallToThreads :
     (`warp_dims` `=` $warp_dims^)?
     (`sync_after_distribute` `=` $sync_after_distribute^)?
     attr-dict
-    `:` functional-type(operands, results)
   }];
   let extraClassDeclaration = [{
     ::mlir::DiagnosedSilenceableFailure applyToOne(

diff  --git a/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td b/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td
index c16c286ece484..712abf341f460 100644
--- a/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td
+++ b/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td
@@ -1651,13 +1651,11 @@ def TileToScfForOp : Op<Transform_Dialect, "structured.tile_to_scf_for",
 //===----------------------------------------------------------------------===//
 
 def VectorizeOp : Op<Transform_Dialect, "structured.vectorize",
-    [DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
-     TransformEachOpTrait,
-     TransformOpInterface]> {
+    [FunctionalStyleTransformOpTrait, MemoryEffectsOpInterface,
+     TransformEachOpTrait, TransformOpInterface]> {
   let description = [{
     Indicates that the given `target` op all the ops it contains should be
     vectorized with the configuration specified by the attributes of this op.
-
     This vectorization only handles structured ops that operate on shaped types
     and does not vectorize loops or straight-line. Internally, it applies a
     set of rewrite patterns, some of which enable vectorization and some of
@@ -1687,22 +1685,24 @@ def VectorizeOp : Op<Transform_Dialect, "structured.vectorize",
 
     This operation produces `definiteFailure` if vectorization fails for any
     reason.
-    This operation returns nothing.
+    The operation always returns the handle to the target op that is expected
+    to be isolated from above.
   }];
 
-  let arguments = (ins TransformHandleTypeInterface:$target,
+  let arguments = (ins PDL_Operation:$target,
                    UnitAttr:$vectorize_padding,
                    UnitAttr:$vectorize_nd_extract,
                    UnitAttr:$disable_multi_reduction_to_contract_patterns,
                    UnitAttr:$disable_transfer_permutation_map_lowering_patterns);
-  let results = (outs);
+  let results = (outs PDL_Operation:$transformed);
 
-  let assemblyFormat = [{
-    $target 
-    attr-dict 
-    `:` functional-type(operands, results)
-  }];
+  let assemblyFormat = "$target attr-dict";
 
+  let builders = [
+    OpBuilder<(ins "Value":$target,
+               CArg<"bool", "false">:$vectorizePadding,
+               CArg<"bool", "false">:$vectorizeNDExtract)>,
+  ];
   let extraClassDeclaration = [{
     ::mlir::DiagnosedSilenceableFailure applyToOne(
         ::mlir::Operation *target,
@@ -1711,10 +1711,6 @@ def VectorizeOp : Op<Transform_Dialect, "structured.vectorize",
   }];
 }
 
-//===----------------------------------------------------------------------===//
-// MaskedVectorizeOp
-//===----------------------------------------------------------------------===//
-
 def MaskedVectorizeOp : Op<Transform_Dialect, "structured.masked_vectorize",
     [DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
      TransformOpInterface]> {
@@ -1769,9 +1765,8 @@ def MaskedVectorizeOp : Op<Transform_Dialect, "structured.masked_vectorize",
 
 def HoistRedundantVectorTransfersOp :
   Op<Transform_Dialect, "structured.hoist_redundant_vector_transfers",
-    [DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
-     TransformEachOpTrait,
-     TransformOpInterface]> {
+    [FunctionalStyleTransformOpTrait, MemoryEffectsOpInterface,
+     TransformEachOpTrait, TransformOpInterface]> {
   let description = [{
     Hoist vector.transfer_read / vector.transfer_write pairs out of immediately
     enclosing scf::ForOp iteratively, if the following conditions are true:
@@ -1787,17 +1782,18 @@ def HoistRedundantVectorTransfersOp :
 
     #### Return modes:
 
-    The operation always succeeds and returns nothing.
+    The operation always succeeds and returns a handle to the transformed
+    function op.
   }];
 
   let arguments = (ins TransformHandleTypeInterface:$target);
-  let results = (outs);
-  let assemblyFormat = [{
-    $target 
-    attr-dict 
-    `:` functional-type(operands, results)
-  }];
+  let results = (outs TransformHandleTypeInterface:$transformed);
+
+  let assemblyFormat = "$target attr-dict `:` functional-type(operands, results) ";
 
+  let builders = [
+    OpBuilder<(ins "Value":$target)>,
+  ];
   let extraClassDeclaration = [{
     ::mlir::DiagnosedSilenceableFailure applyToOne(
         ::mlir::func::FuncOp target,
@@ -1888,9 +1884,8 @@ def ConvertConv2DToImg2ColOp : Op<Transform_Dialect,
 
 def HoistRedundantTensorSubsetsOp :
   Op<Transform_Dialect, "structured.hoist_redundant_tensor_subsets",
-    [DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
-     TransformEachOpTrait,
-     TransformOpInterface]> {
+    [FunctionalStyleTransformOpTrait, MemoryEffectsOpInterface,
+     TransformEachOpTrait, TransformOpInterface]> {
   let description = [{
     Hoists supported tensor subset extract/insert operation pairs out of 
     immediately enclosing loop iteratively, if the following conditions
@@ -1910,18 +1905,18 @@ def HoistRedundantTensorSubsetsOp :
 
     #### Return modes:
 
-    The operation always succeeds and returns nothing.
+    The operation always succeeds and returns a handle to the transformed
+    function op.
   }];
 
   let arguments = (ins TransformHandleTypeInterface:$target);
-  let results = (outs);
+  let results = (outs TransformHandleTypeInterface:$transformed);
 
-  let assemblyFormat = [{
-    $target 
-    attr-dict 
-    `:` functional-type(operands, results)
-  }];
+  let assemblyFormat = "$target attr-dict `:` functional-type(operands, results) ";
 
+  let builders = [
+    OpBuilder<(ins "Value":$target)>,
+  ];
   let extraClassDeclaration = [{
     ::mlir::DiagnosedSilenceableFailure applyToOne(
         ::mlir::Operation *target,

diff  --git a/mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.td b/mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.td
index 4be84e9800d72..4533c5a8d6425 100644
--- a/mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.td
+++ b/mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.td
@@ -17,9 +17,8 @@ include "mlir/Interfaces/SideEffectInterfaces.td"
 include "mlir/IR/OpBase.td"
 
 def LowerVectorsOp : Op<Transform_Dialect, "vector.lower_vectors",
-    [DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
-     TransformEachOpTrait,
-     TransformOpInterface]> {
+    [DeclareOpInterfaceMethods<TransformOpInterface>,
+     DeclareOpInterfaceMethods<MemoryEffectsOpInterface>]> {
   let description = [{
     Indicates that the vector operations nested under the isolated from above op
     `target` should be lowered to finer-grained vector primitives.
@@ -28,14 +27,10 @@ def LowerVectorsOp : Op<Transform_Dialect, "vector.lower_vectors",
 
     This is usally a late step that is run after bufferization as part of the
     process of lowering to e.g. LLVM or NVVM.
-
-    #### Return modes:
-
-    The operation returns nothing.
   }];
 
   // TODO: evolve this to proper enums.
-  let arguments = (ins TransformHandleTypeInterface:$target,
+  let arguments = (ins PDL_Operation:$target,
      DefaultValuedAttr<VectorContractLoweringAttr,
        "vector::VectorContractLowering::OuterProduct">:$contraction_lowering,
      DefaultValuedAttr<VectorMultiReductionLoweringAttr,
@@ -48,7 +43,7 @@ def LowerVectorsOp : Op<Transform_Dialect, "vector.lower_vectors",
      DefaultValuedAttr<BoolAttr, "false">:$transpose_avx2_lowering,
      DefaultValuedAttr<BoolAttr, "true">:$unroll_vector_transfers
   );
-  let results = (outs);
+  let results = (outs PDL_Operation:$results);
 
   let builders = [
     OpBuilder<(ins "Type":$resultType, "Value":$target,
@@ -71,14 +66,6 @@ def LowerVectorsOp : Op<Transform_Dialect, "vector.lower_vectors",
       | `transpose_lowering` `=` $transpose_lowering
     )
     attr-dict
-    `:` functional-type(operands, results)
-  }];
-  
-  let extraClassDeclaration = [{
-    ::mlir::DiagnosedSilenceableFailure applyToOne(
-        ::mlir::Operation *target,
-        ::mlir::transform::ApplyToEachResultList &results,
-        ::mlir::transform::TransformState &state);
   }];
 }
 

diff  --git a/mlir/lib/Dialect/GPU/TransformOps/GPUTransformOps.cpp b/mlir/lib/Dialect/GPU/TransformOps/GPUTransformOps.cpp
index 550d8c1f7e44d..753e7e638740e 100644
--- a/mlir/lib/Dialect/GPU/TransformOps/GPUTransformOps.cpp
+++ b/mlir/lib/Dialect/GPU/TransformOps/GPUTransformOps.cpp
@@ -854,12 +854,6 @@ DiagnosedSilenceableFailure mlir::transform::gpu::mapNestedForallToThreadsImpl(
   return DiagnosedSilenceableFailure::success();
 }
 
-void transform::MapNestedForallToThreads::getEffects(
-    SmallVectorImpl<MemoryEffects::EffectInstance> &effects) {
-  onlyReadsHandle(getTarget(), effects);
-  modifiesPayload(effects);
-}
-
 DiagnosedSilenceableFailure transform::MapNestedForallToThreads::applyToOne(
     Operation *target, ApplyToEachResultList &results, TransformState &state) {
   LaunchOp gpuLaunch = dyn_cast<LaunchOp>(target);
@@ -892,6 +886,7 @@ DiagnosedSilenceableFailure transform::MapNestedForallToThreads::applyToOne(
       mapNestedForallToThreadsImpl(rewriter, transformOp, gpuLaunch, blockDims,
                                    getWarpDims(), getSyncAfterDistribute());
 
+  results.push_back(gpuLaunch.getOperation());
   return diag;
 }
 

diff  --git a/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp b/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
index 332a9bfa680d1..407b8d213de1c 100644
--- a/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
+++ b/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
@@ -1786,7 +1786,7 @@ LogicalResult transform::PadOp::verify() {
 }
 
 //===---------------------------------------------------------------------===//
-// PadOp
+// HoistPadOp
 //===---------------------------------------------------------------------===//
 
 DiagnosedSilenceableFailure
@@ -2977,6 +2977,21 @@ void transform::TileToScfForOp::getEffects(
 // VectorizeOp
 //===----------------------------------------------------------------------===//
 
+void transform::VectorizeOp::build(OpBuilder &builder, OperationState &result,
+                                   Value target, bool vectorizePadding,
+                                   bool vectorizeExtract) {
+  result.addOperands(target);
+  if (vectorizePadding) {
+    result.addAttribute(VectorizeOp::getVectorizePaddingAttrName(result.name),
+                        builder.getUnitAttr());
+  }
+  if (vectorizeExtract) {
+    result.addAttribute(VectorizeOp::getVectorizeNdExtractAttrName(result.name),
+                        builder.getUnitAttr());
+  }
+  result.addTypes(pdl::OperationType::get(builder.getContext()));
+}
+
 namespace {
 /// This is an helper only to call vectorize via a pattern inside of
 /// VectorizeOp::applyToOne.
@@ -3035,15 +3050,10 @@ transform::VectorizeOp::applyToOne(Operation *target,
   if (failed(applyPatternsAndFoldGreedily(target, std::move(patterns))))
     return emitDefaultDefiniteFailure(target);
 
+  results.push_back(target);
   return DiagnosedSilenceableFailure::success();
 }
 
-void transform::VectorizeOp::getEffects(
-    SmallVectorImpl<MemoryEffects::EffectInstance> &effects) {
-  transform::onlyReadsHandle(getTarget(), effects);
-  transform::modifiesPayload(effects);
-}
-
 //===----------------------------------------------------------------------===//
 // MaskedVectorizeOp
 //===----------------------------------------------------------------------===//
@@ -3123,6 +3133,22 @@ SmallVector<OpFoldResult> MaskedVectorizeOp::getMixedVectorSizes() {
   return getMixedValues(getStaticVectorSizes(), getVectorSizes(), b);
 }
 
+//===----------------------------------------------------------------------===//
+// HoistRedundantVectorTransfersOp
+//===----------------------------------------------------------------------===//
+
+DiagnosedSilenceableFailure
+transform::HoistRedundantVectorTransfersOp::applyToOne(
+    func::FuncOp target, transform::ApplyToEachResultList &results,
+    transform::TransformState &state) {
+  // WARNING: This hoisting does not model parallelism and is generally
+  // incorrect when used on distributed loops with memref semantics!
+  // TODO: obsolete and should be retired.
+  linalg::hoistRedundantVectorTransfers(target);
+  results.push_back(target);
+  return DiagnosedSilenceableFailure::success();
+}
+
 //===----------------------------------------------------------------------===//
 // ConvertConv2DToImg2ColOp.
 //===----------------------------------------------------------------------===//
@@ -3167,7 +3193,9 @@ transform::HoistRedundantTensorSubsetsOp::applyToOne(
   IRRewriter rewriter(target->getContext());
   auto forOp = dyn_cast<scf::ForOp>(target);
   if (forOp) {
-    linalg::hoistRedundantSubsetExtractInsert(rewriter, forOp);
+    scf::ForOp newForOp =
+        linalg::hoistRedundantSubsetExtractInsert(rewriter, forOp);
+    results.push_back(newForOp);
     return DiagnosedSilenceableFailure::success();
   }
 
@@ -3176,36 +3204,10 @@ transform::HoistRedundantTensorSubsetsOp::applyToOne(
   target->walk([&](scf::ForOp forOp) {
     hoistRedundantSubsetExtractInsert(rewriter, forOp);
   });
+  results.push_back(target);
   return DiagnosedSilenceableFailure::success();
 }
 
-void transform::HoistRedundantTensorSubsetsOp::getEffects(
-    SmallVectorImpl<MemoryEffects::EffectInstance> &effects) {
-  transform::onlyReadsHandle(getTarget(), effects);
-  transform::modifiesPayload(effects);
-}
-
-//===----------------------------------------------------------------------===//
-// HoistRedundantVectorTransfersOp
-//===----------------------------------------------------------------------===//
-
-DiagnosedSilenceableFailure
-transform::HoistRedundantVectorTransfersOp::applyToOne(
-    func::FuncOp target, transform::ApplyToEachResultList &results,
-    transform::TransformState &state) {
-  // WARNING: This hoisting does not model parallelism and is generally
-  // incorrect when used on distributed loops with memref semantics!
-  // TODO: obsolete and should be retired.
-  linalg::hoistRedundantVectorTransfers(target);
-  return DiagnosedSilenceableFailure::success();
-}
-
-void transform::HoistRedundantVectorTransfersOp::getEffects(
-    SmallVectorImpl<MemoryEffects::EffectInstance> &effects) {
-  transform::onlyReadsHandle(getTarget(), effects);
-  transform::modifiesPayload(effects);
-}
-
 //===----------------------------------------------------------------------===//
 // Transform op registration
 //===----------------------------------------------------------------------===//

diff  --git a/mlir/lib/Dialect/Vector/TransformOps/VectorTransformOps.cpp b/mlir/lib/Dialect/Vector/TransformOps/VectorTransformOps.cpp
index 9b2e1d7d4cfe0..60996b9add614 100644
--- a/mlir/lib/Dialect/Vector/TransformOps/VectorTransformOps.cpp
+++ b/mlir/lib/Dialect/Vector/TransformOps/VectorTransformOps.cpp
@@ -29,90 +29,98 @@ using namespace mlir::transform;
 
 void transform::LowerVectorsOp::getEffects(
     SmallVectorImpl<MemoryEffects::EffectInstance> &effects) {
-  onlyReadsHandle(getTarget(), effects);
+  consumesHandle(getTarget(), effects);
+  producesHandle(getResults(), effects);
   modifiesPayload(effects);
 }
 
-DiagnosedSilenceableFailure transform::LowerVectorsOp::applyToOne(
-    ::mlir::Operation *target,
-    ::mlir::transform::ApplyToEachResultList &results,
-    ::mlir::transform::TransformState &state) {
-
-  // This check can't be part of the verifier because payload IR is
-  // independent from transform IR and may not even exist.
-  if (!target->hasTrait<OpTrait::IsIsolatedFromAbove>()) {
-    return mlir::emitDefiniteFailure(target,
-                                     "applies only to isolated-from-above "
-                                     "targets because it needs to apply "
-                                     "patterns greedily");
+DiagnosedSilenceableFailure transform::LowerVectorsOp::apply(
+    mlir::transform::TransformResults &transformResults,
+    mlir::transform::TransformState &state) {
+
+  SmallVector<Operation *> results;
+  ArrayRef<Operation *> payloadOps = state.getPayloadOps(getTarget());
+  for (Operation *target : payloadOps) {
+    // This check can't be part of the verifier because payload IR is
+    // independent from transform IR and may not even exist.
+    if (!target->hasTrait<OpTrait::IsIsolatedFromAbove>()) {
+      return mlir::emitDefiniteFailure(target,
+                                       "applies only to isolated-from-above "
+                                       "targets because it needs to apply "
+                                       "patterns greedily");
+    }
+
+    MLIRContext *ctx = getContext();
+    RewritePatternSet patterns(ctx);
+    vector::VectorTransposeLowering vectorTransposeLowering =
+        getTransposeLowering();
+    vector::VectorMultiReductionLowering vectorMultiReductionLowering =
+        getMultireductionLowering();
+    vector::VectorContractLowering vectorContractLowering =
+        getContractionLowering();
+    vector::VectorTransferSplit vectorTransferSplit = getSplitTransfers();
+
+    vector::VectorTransformsOptions vectorTransformOptions;
+    vectorTransformOptions.setVectorTransformsOptions(vectorContractLowering)
+        .setVectorMultiReductionLowering(vectorMultiReductionLowering)
+        .setVectorTransposeLowering(vectorTransposeLowering)
+        .setVectorTransferSplit(vectorTransferSplit);
+
+    VectorTransferToSCFOptions vectorTransferToSCFOptions =
+        VectorTransferToSCFOptions().enableFullUnroll(
+            getUnrollVectorTransfers());
+
+    int maxTransferRank = 1;
+
+    auto avx2LoweringOptions =
+        x86vector::avx2::LoweringOptions().setTransposeOptions(
+            x86vector::avx2::TransposeLoweringOptions()
+                .lower4x8xf32(getTransposeAvx2Lowering())
+                .lower8x8xf32(getTransposeAvx2Lowering()));
+
+    vector::populateVectorToVectorCanonicalizationPatterns(patterns);
+
+    // In the future we may want to more finely select particular stages.
+    // Stage 1: contraction lowerings.
+    patterns.add<mlir::vector::ContractionOpToOuterProductOpLowering,
+                 mlir::vector::ContractionOpToMatmulOpLowering,
+                 mlir::vector::ContractionOpLowering>(vectorTransformOptions,
+                                                      ctx);
+    vector::populateVectorTransferPermutationMapLoweringPatterns(patterns);
+
+    // Stage 2: multi-reduction lowerings.
+    vector::populateVectorMultiReductionLoweringPatterns(
+        patterns, vectorTransformOptions.vectorMultiReductionLowering);
+
+    // Stage 3: Rewrite vector.transfer into full and partial parts.
+    patterns.add<vector::VectorTransferFullPartialRewriter>(
+        ctx, vectorTransformOptions);
+
+    // Stage 4: Lower vector transfers.
+    vector::populateVectorTransferLoweringPatterns(patterns, maxTransferRank);
+
+    // Stage 5: Vector to scf patterns.
+    populateVectorToSCFConversionPatterns(
+        patterns, vectorTransferToSCFOptions.setTargetRank(maxTransferRank));
+
+    // Stage 6: Lower vector.shape_cast.
+    vector::populateVectorShapeCastLoweringPatterns(patterns);
+
+    // Stage 7: Lower vector.transpose.
+    vector::populateVectorTransposeLoweringPatterns(patterns,
+                                                    vectorTransformOptions);
+    if (getTransposeAvx2Lowering())
+      x86vector::avx2::populateSpecializedTransposeLoweringPatterns(
+          patterns, avx2LoweringOptions, /*benefit=*/10);
+
+    // Apply everything.
+    if (failed(applyPatternsAndFoldGreedily(target, std::move(patterns))))
+      return DiagnosedSilenceableFailure::definiteFailure();
+
+    results.push_back(target);
   }
 
-  MLIRContext *ctx = getContext();
-  RewritePatternSet patterns(ctx);
-  vector::VectorTransposeLowering vectorTransposeLowering =
-      getTransposeLowering();
-  vector::VectorMultiReductionLowering vectorMultiReductionLowering =
-      getMultireductionLowering();
-  vector::VectorContractLowering vectorContractLowering =
-      getContractionLowering();
-  vector::VectorTransferSplit vectorTransferSplit = getSplitTransfers();
-
-  vector::VectorTransformsOptions vectorTransformOptions;
-  vectorTransformOptions.setVectorTransformsOptions(vectorContractLowering)
-      .setVectorMultiReductionLowering(vectorMultiReductionLowering)
-      .setVectorTransposeLowering(vectorTransposeLowering)
-      .setVectorTransferSplit(vectorTransferSplit);
-
-  VectorTransferToSCFOptions vectorTransferToSCFOptions =
-      VectorTransferToSCFOptions().enableFullUnroll(getUnrollVectorTransfers());
-
-  int maxTransferRank = 1;
-
-  auto avx2LoweringOptions =
-      x86vector::avx2::LoweringOptions().setTransposeOptions(
-          x86vector::avx2::TransposeLoweringOptions()
-              .lower4x8xf32(getTransposeAvx2Lowering())
-              .lower8x8xf32(getTransposeAvx2Lowering()));
-
-  vector::populateVectorToVectorCanonicalizationPatterns(patterns);
-
-  // In the future we may want to more finely select particular stages.
-  // Stage 1: contraction lowerings.
-  patterns.add<mlir::vector::ContractionOpToOuterProductOpLowering,
-               mlir::vector::ContractionOpToMatmulOpLowering,
-               mlir::vector::ContractionOpLowering>(vectorTransformOptions,
-                                                    ctx);
-  vector::populateVectorTransferPermutationMapLoweringPatterns(patterns);
-
-  // Stage 2: multi-reduction lowerings.
-  vector::populateVectorMultiReductionLoweringPatterns(
-      patterns, vectorTransformOptions.vectorMultiReductionLowering);
-
-  // Stage 3: Rewrite vector.transfer into full and partial parts.
-  patterns.add<vector::VectorTransferFullPartialRewriter>(
-      ctx, vectorTransformOptions);
-
-  // Stage 4: Lower vector transfers.
-  vector::populateVectorTransferLoweringPatterns(patterns, maxTransferRank);
-
-  // Stage 5: Vector to scf patterns.
-  populateVectorToSCFConversionPatterns(
-      patterns, vectorTransferToSCFOptions.setTargetRank(maxTransferRank));
-
-  // Stage 6: Lower vector.shape_cast.
-  vector::populateVectorShapeCastLoweringPatterns(patterns);
-
-  // Stage 7: Lower vector.transpose.
-  vector::populateVectorTransposeLoweringPatterns(patterns,
-                                                  vectorTransformOptions);
-  if (getTransposeAvx2Lowering())
-    x86vector::avx2::populateSpecializedTransposeLoweringPatterns(
-        patterns, avx2LoweringOptions, /*benefit=*/10);
-
-  // Apply everything.
-  if (failed(applyPatternsAndFoldGreedily(target, std::move(patterns))))
-    return DiagnosedSilenceableFailure::definiteFailure();
-
+  transformResults.set(getResults().cast<OpResult>(), results);
   return DiagnosedSilenceableFailure::success();
 }
 

diff  --git a/mlir/python/mlir/dialects/_structured_transform_ops_ext.py b/mlir/python/mlir/dialects/_structured_transform_ops_ext.py
index f314496c693f1..e2c262ca50201 100644
--- a/mlir/python/mlir/dialects/_structured_transform_ops_ext.py
+++ b/mlir/python/mlir/dialects/_structured_transform_ops_ext.py
@@ -325,9 +325,11 @@ def __init__(self,
                vectorize_padding: Union[bool, BoolAttr] = False,
                loc=None,
                ip=None):
+    pdl_operation_type = pdl.OperationType.get()
     if isinstance(vectorize_padding, bool):
       vectorize_padding = UnitAttr.get()
     super().__init__(
+        pdl_operation_type,
         _get_op_result_or_value(target),
         vectorize_padding=vectorize_padding,
         loc=loc,

diff  --git a/mlir/test/Dialect/GPU/transform-gpu-failing.mlir b/mlir/test/Dialect/GPU/transform-gpu-failing.mlir
index c9ded7d7ef193..459b800f76d35 100644
--- a/mlir/test/Dialect/GPU/transform-gpu-failing.mlir
+++ b/mlir/test/Dialect/GPU/transform-gpu-failing.mlir
@@ -8,8 +8,7 @@ transform.sequence failures(propagate) {
 ^bb0(%arg0: !pdl.operation):
   %funcop = transform.structured.match ops{["tensor.empty"]} in %arg0 : (!pdl.operation) -> !pdl.operation
   // expected-error @below {{Given target is not a gpu.launch}}
-  transform.gpu.map_nested_forall_to_threads %funcop block_dims = [1, 1, 1]
-    : (!pdl.operation) -> ()
+  %1 = transform.gpu.map_nested_forall_to_threads %funcop block_dims = [1, 1, 1]
 }
 
 // -----
@@ -51,7 +50,6 @@ transform.sequence failures(propagate) {
   // expected-error @below {{Trying to launch a GPU kernel with grid_dims = (1, 1, 1) block_dims = (1200, 9, 1). It is larger than the limits.}}
   // expected-note @below {{"block_dims" is too large}}
   transform.gpu.map_nested_forall_to_threads %funcop block_dims = [1200, 9, 1]
-    : (!pdl.operation) -> ()
 }
 
 // -----
@@ -93,7 +91,6 @@ transform.sequence failures(propagate) {
   %funcop = transform.structured.match ops{["gpu.launch"]} in %arg0 : (!pdl.operation) -> !pdl.operation
   // expected-error @below {{Trying to map to fewer GPU threads than loop iterations but overprovisioning is not yet supported. Try additional tiling of the before mapping or map to more threads.}}
   transform.gpu.map_nested_forall_to_threads %funcop block_dims = [128, 4, 1]
-    : (!pdl.operation) -> ()
 }
 
 // -----
@@ -120,7 +117,6 @@ transform.sequence failures(propagate) {
   %funcop = transform.structured.match ops{["gpu.launch"]} in %arg0 : (!pdl.operation) -> !pdl.operation
   // expected-error @below {{unsupported dynamic sizes}}
   transform.gpu.map_nested_forall_to_threads %funcop block_dims = [128, 4, 1]
-    : (!pdl.operation) -> ()
 }
 
 // -----
@@ -143,7 +139,6 @@ transform.sequence failures(propagate) {
   %funcop = transform.structured.match ops{["gpu.launch"]} in %arg0 : (!pdl.operation) -> !pdl.operation
   // expected-error @below {{only bufferized scf.forall can be mapped}}
   transform.gpu.map_nested_forall_to_threads %funcop block_dims = [128, 4, 1]
-    : (!pdl.operation) -> ()
 }
 
 // -----
@@ -277,7 +272,6 @@ transform.sequence failures(propagate) {
   %funcop = transform.structured.match ops{["gpu.launch"]} in %arg0 : (!pdl.operation) -> !pdl.operation
   // expected-error @below {{duplicated attribute, cannot map 
diff erent loops to the same processor}}
   transform.gpu.map_nested_forall_to_threads %funcop block_dims = [32, 32, 1]
-    : (!pdl.operation) -> ()
 }
 
 // -----

diff  --git a/mlir/test/Dialect/GPU/transform-gpu.mlir b/mlir/test/Dialect/GPU/transform-gpu.mlir
index e485d4107a645..d9872a9666f62 100644
--- a/mlir/test/Dialect/GPU/transform-gpu.mlir
+++ b/mlir/test/Dialect/GPU/transform-gpu.mlir
@@ -88,7 +88,6 @@ transform.sequence failures(propagate) {
 ^bb1(%arg0: !pdl.operation):
   %funcop = transform.structured.match ops{["gpu.launch"]} in %arg0 : (!pdl.operation) -> !pdl.operation
   transform.gpu.map_nested_forall_to_threads %funcop block_dims = [12, 9, 1]
-    : (!pdl.operation) -> ()
 }
 
 // -----
@@ -129,7 +128,6 @@ transform.sequence failures(propagate) {
   %funcop = transform.structured.match ops{["func.func"]} in %arg0 : (!pdl.operation) -> !pdl.operation
   %gpuLaunch = transform.gpu.map_forall_to_blocks %funcop { generate_gpu_launch }
   transform.gpu.map_nested_forall_to_threads %gpuLaunch block_dims = [32, 4, 1]
-    : (!pdl.operation) -> ()
 }
 
 // -----
@@ -163,7 +161,6 @@ transform.sequence failures(propagate) {
 ^bb1(%arg0: !pdl.operation):
   %funcop = transform.structured.match ops{["gpu.launch"]} in %arg0 : (!pdl.operation) -> !pdl.operation
   transform.gpu.map_nested_forall_to_threads %funcop block_dims = [12, 9, 1] sync_after_distribute = false
-    : (!pdl.operation) -> ()
 }
 
 // -----
@@ -196,7 +193,6 @@ transform.sequence failures(propagate) {
 ^bb1(%arg0: !pdl.operation):
   %funcop = transform.structured.match ops{["gpu.launch"]} in %arg0 : (!pdl.operation) -> !pdl.operation
   transform.gpu.map_nested_forall_to_threads %funcop block_dims = [32, 1, 1]
-    : (!pdl.operation) -> ()
 }
 
 // -----
@@ -233,7 +229,6 @@ transform.sequence failures(propagate) {
 ^bb1(%arg0: !pdl.operation):
   %funcop = transform.structured.match ops{["gpu.launch"]} in %arg0 : (!pdl.operation) -> !pdl.operation
   transform.gpu.map_nested_forall_to_threads %funcop block_dims = [12, 9, 1] sync_after_distribute = false
-    : (!pdl.operation) -> ()
 }
 
 // -----
@@ -311,5 +306,4 @@ transform.sequence failures(propagate) {
   %funcop = transform.structured.match ops{["gpu.launch"]} in %arg0 : (!pdl.operation) -> !pdl.operation
   transform.gpu.map_nested_forall_to_threads %funcop
     block_dims = [12, 11, 1] warp_dims = [3, 2, 1]
-    : (!pdl.operation) -> ()
 }

diff  --git a/mlir/test/Dialect/LLVM/transform-e2e.mlir b/mlir/test/Dialect/LLVM/transform-e2e.mlir
index 7d7a2c85a379d..d091e9d18d1b5 100644
--- a/mlir/test/Dialect/LLVM/transform-e2e.mlir
+++ b/mlir/test/Dialect/LLVM/transform-e2e.mlir
@@ -17,10 +17,9 @@ transform.sequence failures(propagate) {
   %0 = transform.structured.match ops{["linalg.matmul"]} in %module_op : (!pdl.operation) -> !pdl.operation
   %1, %loops:3 = transform.structured.tile %0 [2, 2, 2] : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
   %2 = get_closest_isolated_parent %1 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %2 : (!pdl.operation) -> ()
+  transform.structured.vectorize %2
   transform.bufferization.one_shot_bufferize layout{IdentityLayoutMap} %module_op
     {bufferize_function_boundaries = true}
   %func = transform.structured.match ops{["func.func"]} in %module_op : (!pdl.operation) -> !pdl.operation
-  transform.vector.lower_vectors %func multireduction_lowering = "innerreduction" 
-    : (!pdl.operation) -> ()
+  transform.vector.lower_vectors %func multireduction_lowering = "innerreduction"
 }

diff  --git a/mlir/test/Dialect/Linalg/hoisting.mlir b/mlir/test/Dialect/Linalg/hoisting.mlir
index 96d809a1fd694..aeecb8cf95f89 100644
--- a/mlir/test/Dialect/Linalg/hoisting.mlir
+++ b/mlir/test/Dialect/Linalg/hoisting.mlir
@@ -79,10 +79,7 @@ transform.sequence failures(propagate) {
   %0 = transform.structured.match ops{["func.func"]} in %arg1
     : (!pdl.operation) -> !pdl.operation
   transform.structured.hoist_redundant_vector_transfers %0
-    : (!pdl.operation) -> ()
-  // Test we can call the op twice without consuming the handle.
-  transform.structured.hoist_redundant_vector_transfers %0
-    : (!pdl.operation) -> ()
+    : (!pdl.operation) -> !pdl.operation
 }
 
 // -----
@@ -171,7 +168,7 @@ transform.sequence failures(propagate) {
   %0 = transform.structured.match ops{["func.func"]} in %arg1
     : (!pdl.operation) -> !pdl.operation
   transform.structured.hoist_redundant_vector_transfers %0
-    : (!pdl.operation) -> ()
+    : (!pdl.operation) -> !pdl.operation
 }
 
 // -----
@@ -216,7 +213,7 @@ transform.sequence failures(propagate) {
   %0 = transform.structured.match ops{["func.func"]} in %arg1
     : (!pdl.operation) -> !pdl.operation
   transform.structured.hoist_redundant_vector_transfers %0
-    : (!pdl.operation) -> ()
+    : (!pdl.operation) -> !pdl.operation
 }
 
 // -----
@@ -305,10 +302,7 @@ transform.sequence failures(propagate) {
   %0 = transform.structured.match ops{["func.func"]} in %arg1
     : (!pdl.operation) -> !pdl.operation
   transform.structured.hoist_redundant_tensor_subsets %0
-    : (!pdl.operation) -> ()
-  // Test we can call the op twice without consuming the handle.
-  transform.structured.hoist_redundant_tensor_subsets %0
-    : (!pdl.operation) -> ()
+    : (!pdl.operation) -> !pdl.operation
 }
 
 // -----
@@ -403,7 +397,7 @@ transform.sequence failures(propagate) {
   %0 = transform.structured.match ops{["func.func"]} in %arg1
     : (!pdl.operation) -> !pdl.operation
   transform.structured.hoist_redundant_tensor_subsets %0
-    : (!pdl.operation) -> ()
+    : (!pdl.operation) -> !pdl.operation
 }
 
 // -----
@@ -520,7 +514,7 @@ transform.sequence failures(propagate) {
   %0 = transform.structured.match ops{["func.func"]} in %arg1
     : (!pdl.operation) -> !pdl.operation
   transform.structured.hoist_redundant_tensor_subsets %0
-    : (!pdl.operation) -> ()
+    : (!pdl.operation) -> !pdl.operation
 }
 
 // -----
@@ -567,7 +561,7 @@ transform.sequence failures(propagate) {
   %0 = transform.structured.match ops{["func.func"]} in %arg1
     : (!pdl.operation) -> !pdl.operation
   transform.structured.hoist_redundant_tensor_subsets %0
-    : (!pdl.operation) -> ()
+    : (!pdl.operation) -> !pdl.operation
 }
 
 // -----
@@ -680,5 +674,5 @@ transform.sequence failures(propagate) {
   %0 = transform.structured.match ops{["func.func"]} in %arg1
     : (!pdl.operation) -> !pdl.operation
   transform.structured.hoist_redundant_tensor_subsets %0
-    : (!pdl.operation) -> ()
+    : (!pdl.operation) -> !pdl.operation
 }

diff  --git a/mlir/test/Dialect/Linalg/transform-op-vectorize.mlir b/mlir/test/Dialect/Linalg/transform-op-vectorize.mlir
index b31df69456f24..155b0785d2ec7 100644
--- a/mlir/test/Dialect/Linalg/transform-op-vectorize.mlir
+++ b/mlir/test/Dialect/Linalg/transform-op-vectorize.mlir
@@ -20,7 +20,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 }
 
 // -----
@@ -66,7 +66,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 }
 
 // -----
@@ -114,9 +114,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 {vectorize_padding} : (!pdl.operation) -> ()
-  // Apply transform twice to ensure %1 is not consumed.
-  transform.structured.vectorize %1 {vectorize_padding} : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1 {vectorize_padding}
 }
 
 // -----
@@ -133,5 +131,5 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   // expected-error @below {{op requires isolated-from-above targets}}
-  transform.structured.vectorize %0 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %0
 }

diff  --git a/mlir/test/Dialect/Linalg/vectorization.mlir b/mlir/test/Dialect/Linalg/vectorization.mlir
index 3b1b51e347d1d..26e27c108ce81 100644
--- a/mlir/test/Dialect/Linalg/vectorization.mlir
+++ b/mlir/test/Dialect/Linalg/vectorization.mlir
@@ -14,8 +14,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.dot"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
-    : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1  { disable_multi_reduction_to_contract_patterns }
 }
 
 // -----
@@ -34,8 +33,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.matvec"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
-    : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1  { disable_multi_reduction_to_contract_patterns }
 }
 
 // -----
@@ -53,8 +51,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
-    : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1  { disable_multi_reduction_to_contract_patterns }
 }
 
 // -----
@@ -73,8 +70,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.batch_matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
-    : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1  { disable_multi_reduction_to_contract_patterns }
 }
 
 // -----
@@ -114,8 +110,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
-    : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1  { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
 }
 
 // -----
@@ -155,8 +150,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
-    : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1  { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
 }
 
 // -----
@@ -183,8 +177,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
-    : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1  { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
 }
 
 // -----
@@ -224,8 +217,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
-    : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1  { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
 }
 
 // -----
@@ -245,8 +237,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
-    : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1  { disable_multi_reduction_to_contract_patterns }
 }
 
 // -----
@@ -270,7 +261,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 }
 
 // -----
@@ -294,7 +285,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 }
 
 // -----
@@ -339,8 +330,7 @@ transform.sequence failures(propagate) {
  ^bb1(%arg1: !pdl.operation):
    %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
    %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-   transform.structured.vectorize %1 { vectorize_nd_extract }
-    : (!pdl.operation) -> ()
+   %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
 }
 
 // -----
@@ -357,7 +347,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 }
 
 // -----
@@ -375,7 +365,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 }
 
 // -----
@@ -392,7 +382,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["memref.copy"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 }
 
 // -----
@@ -412,7 +402,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["memref.copy"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 }
 
 // -----
@@ -428,7 +418,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["memref.copy"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 }
 
 // -----
@@ -456,7 +446,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 }
 
 // -----
@@ -485,7 +475,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 }
 
 // -----
@@ -570,8 +560,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns }
-    : (!pdl.operation) -> () 
+  %2 = transform.structured.vectorize %1  { disable_transfer_permutation_map_lowering_patterns }
 }
 
 // -----
@@ -662,8 +651,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns }
-    : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns }
 }
 
 // -----
@@ -707,8 +695,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns }
-    : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1  { disable_transfer_permutation_map_lowering_patterns }
 }
 
 // -----
@@ -751,8 +738,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns }
-    : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1  { disable_transfer_permutation_map_lowering_patterns }
 }
 
 // -----
@@ -784,8 +770,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
-    : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1  { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
 }
 
 // -----
@@ -814,7 +799,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { vectorize_padding } : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1 { vectorize_padding }
 }
 
 // -----
@@ -843,7 +828,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { vectorize_padding } : (!pdl.operation) -> () 
+  %2 = transform.structured.vectorize %1  { vectorize_padding }
 }
 
 
@@ -880,7 +865,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { vectorize_padding } : (!pdl.operation) -> () 
+  %2 = transform.structured.vectorize %1  { vectorize_padding }
 }
 
 // -----
@@ -900,7 +885,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { vectorize_padding } : (!pdl.operation) -> () 
+  %2 = transform.structured.vectorize %1  { vectorize_padding }
 }
 
 // -----
@@ -930,7 +915,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { vectorize_padding } : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1 { vectorize_padding }
 }
 
 // -----
@@ -963,7 +948,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %3 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %4 { vectorize_padding } : (!pdl.operation) -> ()
+  %5 = transform.structured.vectorize %4  { vectorize_padding }
 }
 
 
@@ -1000,7 +985,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %3 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %4 { vectorize_padding } : (!pdl.operation) -> ()
+  %5 = transform.structured.vectorize %4 { vectorize_padding }
 }
 
 
@@ -1034,7 +1019,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %3 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %4  { vectorize_padding } : (!pdl.operation) -> ()
+  %5 = transform.structured.vectorize %4  { vectorize_padding }
 }
 
 
@@ -1062,7 +1047,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %3 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %4 : (!pdl.operation) -> ()
+  %5 = transform.structured.vectorize %4
 }
 
 // -----
@@ -1099,7 +1084,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %3 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %4  { vectorize_padding } : (!pdl.operation) -> ()
+  %5 = transform.structured.vectorize %4  { vectorize_padding }
 }
 
 // -----
@@ -1134,7 +1119,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %4 : (!pdl.operation) -> ()
+  %5 = transform.structured.vectorize %4
 }
 
 // -----
@@ -1179,8 +1164,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %4  { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
-    : (!pdl.operation) -> ()
+  %5 = transform.structured.vectorize %4  { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
 }
 
 // -----
@@ -1210,7 +1194,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %4 { vectorize_padding } : (!pdl.operation) -> ()
+  %5 = transform.structured.vectorize %4 { vectorize_padding }
 }
 
 // -----
@@ -1241,7 +1225,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %4 : (!pdl.operation) -> ()
+  %5 = transform.structured.vectorize %4
 }
 
 // -----
@@ -1271,7 +1255,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %4 : (!pdl.operation) -> ()
+  %5 = transform.structured.vectorize %4
 }
 
 // -----
@@ -1301,7 +1285,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %4 : (!pdl.operation) -> ()
+  %5 = transform.structured.vectorize %4
 }
 
 // -----
@@ -1331,7 +1315,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %4 : (!pdl.operation) -> ()
+  %5 = transform.structured.vectorize %4
 }
 
 // -----
@@ -1361,7 +1345,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %4 : (!pdl.operation) -> ()
+  %5 = transform.structured.vectorize %4
 }
 
 // -----
@@ -1395,7 +1379,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %4 : (!pdl.operation) -> ()
+  %5 = transform.structured.vectorize %4
 }
 
 // -----
@@ -1433,11 +1417,11 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 
   %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %4 : (!pdl.operation) -> ()
+  %5 = transform.structured.vectorize %4
 }
 
 // -----
@@ -1480,7 +1464,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 }
 
 
@@ -1511,7 +1495,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 }
 
 // -----
@@ -1550,8 +1534,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
-    : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1  { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
 }
 
 // -----
@@ -1587,7 +1570,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 }
 
 // -----
@@ -1623,7 +1606,7 @@ transform.sequence failures(propagate) {
  ^bb1(%arg1: !pdl.operation):
    %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
    %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-   transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
+   %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
  }
 
 // -----
@@ -1662,7 +1645,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
 }
 
  // -----
@@ -1712,7 +1695,7 @@ transform.sequence failures(propagate) {
  ^bb1(%arg1: !pdl.operation):
    %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
    %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-   transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
+   %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
  }
 
 // -----
@@ -1760,7 +1743,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
 }
 // -----
 
@@ -1804,7 +1787,7 @@ transform.sequence failures(propagate) {
  ^bb1(%arg1: !pdl.operation):
    %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
    %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-   transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
+   %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
  }
 
 // -----
@@ -1846,7 +1829,7 @@ transform.sequence failures(propagate) {
  ^bb1(%arg1: !pdl.operation):
    %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
    %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-   transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
+   %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
  }
 
 // -----
@@ -1890,7 +1873,7 @@ transform.sequence failures(propagate) {
  ^bb1(%arg1: !pdl.operation):
    %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
    %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-   transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
+   %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
  }
 
 // -----
@@ -1930,7 +1913,7 @@ transform.sequence failures(propagate) {
  ^bb1(%arg1: !pdl.operation):
    %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
    %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-   transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
+   %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
  }
 
 // -----
@@ -1970,7 +1953,7 @@ transform.sequence failures(propagate) {
  ^bb1(%arg1: !pdl.operation):
    %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
    %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-   transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
+   %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
  }
 
 // -----
@@ -2009,7 +1992,7 @@ transform.sequence failures(propagate) {
  ^bb1(%arg1: !pdl.operation):
    %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
    %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-   transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
+   %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
  }
 
 
@@ -2034,7 +2017,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.map"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 }
 
 // -----
@@ -2053,7 +2036,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.transpose"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 }
 
 // -----
@@ -2076,7 +2059,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.reduce"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 }
 
 // -----
@@ -2327,7 +2310,7 @@ func.func @not_vectorizable(%arg0: tensor<1x?xf32>, %arg1: index, %arg2: index,
 transform.sequence failures(propagate) {
 ^bb0(%arg0: !pdl.operation):
   %0 = transform.structured.match ops{["func.func"]} in %arg0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %0 : (!pdl.operation) -> ()
+  %1 = transform.structured.vectorize %0
 }
 
 // -----
@@ -2362,7 +2345,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 }
 
 // CHECK-LABEL: @wrong_reduction_detection
@@ -2391,7 +2374,7 @@ transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
   %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %1 : (!pdl.operation) -> ()
+  %2 = transform.structured.vectorize %1
 }
 
 // -----

diff  --git a/mlir/test/Dialect/Transform/selective-targeting.mlir b/mlir/test/Dialect/Transform/selective-targeting.mlir
index c0a6d6b7a8dc0..231ff3099d175 100644
--- a/mlir/test/Dialect/Transform/selective-targeting.mlir
+++ b/mlir/test/Dialect/Transform/selective-targeting.mlir
@@ -80,7 +80,7 @@ transform.with_pdl_patterns {
     transform.structured.tile %0 [4, 4, 4] : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
     %1 = pdl_match @pdl_target_attrC in %arg1 : (!pdl.operation) -> !pdl.operation
     %2 = transform.get_closest_isolated_parent %1 : (!pdl.operation) -> !pdl.operation
-    transform.structured.vectorize %2 : (!pdl.operation) -> ()
+    transform.structured.vectorize %2
   }
 }
 
@@ -125,7 +125,7 @@ transform.with_pdl_patterns {
   ^bb1(%arg1: !pdl.operation):
     %0 = pdl_match @pdl_target in %arg1 : (!pdl.operation) -> !pdl.operation
     %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
-    transform.structured.vectorize %1 : (!pdl.operation) -> ()
+    transform.structured.vectorize %1
   }
 }
 
@@ -150,5 +150,5 @@ func.func @vectorize_all(
 
 transform.sequence failures(propagate) {
 ^bb0(%arg0: !pdl.operation):
-  transform.structured.vectorize %arg0  : (!pdl.operation) -> ()
+  transform.structured.vectorize %arg0
 }

diff  --git a/mlir/test/Dialect/Vector/transform-vector.mlir b/mlir/test/Dialect/Vector/transform-vector.mlir
index ce920e18885d4..cf3738f2e9b5e 100644
--- a/mlir/test/Dialect/Vector/transform-vector.mlir
+++ b/mlir/test/Dialect/Vector/transform-vector.mlir
@@ -18,10 +18,9 @@ transform.sequence failures(propagate) {
   %0 = transform.structured.match ops{["linalg.matmul"]} in %module_op : (!pdl.operation) -> !pdl.operation
   %1, %loops:3 = transform.structured.tile %0 [8, 4, 2] : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
   %2 = get_closest_isolated_parent %1 : (!pdl.operation) -> !pdl.operation
-  transform.structured.vectorize %2 : (!pdl.operation) -> ()
+  transform.structured.vectorize %2
   transform.bufferization.one_shot_bufferize %module_op
 
   %func = transform.structured.match ops{["func.func"]} in %module_op : (!pdl.operation) -> !pdl.operation
   transform.vector.lower_vectors %func multireduction_lowering = "innerreduction"
-    : (!pdl.operation) -> ()
 }

diff  --git a/mlir/test/python/dialects/transform_structured_ext.py b/mlir/test/python/dialects/transform_structured_ext.py
index d88fe2cc0505a..9684bfb47f1b0 100644
--- a/mlir/test/python/dialects/transform_structured_ext.py
+++ b/mlir/test/python/dialects/transform_structured_ext.py
@@ -206,5 +206,5 @@ def testVectorize():
     transform.YieldOp()
   # CHECK-LABEL: TEST: testVectorize
   # CHECK: transform.sequence
-  # CHECK: transform.structured.vectorize
+  # CHECK: = transform.structured.vectorize
   # CHECK: {vectorize_padding}


        


More information about the Mlir-commits mailing list