diff --git a/mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.h b/mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.h --- a/mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.h +++ b/mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.h @@ -938,30 +938,6 @@ static LogicalResult verifyTrait(Operation *op); }; -/// Trait implementing the applyToOne function required by TransformEachOpTrait -/// by greedily applying a set of patterns to each target payload operation. -/// This requires the transform operation to implement TransformEachOpTrait and -/// to provide the following method: -/// - void populatePatterns(RewritePatternSet &) -/// that populates the given object with the patterns to apply. This is an -/// instance method that can depend on the transform operation attributes. -/// -/// The payload operation is expected to have the IsolatedFromAboveTrait, which -/// is a requirement of the pattern rewriter. If it does not, or if pattern -/// application fails, the transform fails definitively as the rewriter will -/// have likely left the payload IR in some intermediate state that precludes -/// further transformation. -template -class TransformWithPatternsOpTrait - : public OpTrait::TraitBase { -public: - DiagnosedSilenceableFailure applyToOne(Operation *target, - ApplyToEachResultList &results, - TransformState &state); - - static LogicalResult verifyTrait(Operation *op); -}; - /// Side effect resource corresponding to the mapping between Transform IR /// values and Payload IR operations. An Allocate effect from this resource /// means creating a new mapping entry, it is always accompanied by a Write @@ -1253,14 +1229,6 @@ return DiagnosedSilenceableFailure::success(); } -/// Applies patterns configured by `populatePatterns` greedily to the contents -/// of `target`. Reports (definite) errors at the location of `transformOp`. -/// Sets up `results` to point to `target` after pattern application on success. -DiagnosedSilenceableFailure transformWithPatternsApply( - Operation *transformOp, Operation *target, ApplyToEachResultList &results, - TransformState &state, - function_ref populatePatterns); - } // namespace detail } // namespace transform } // namespace mlir @@ -1322,26 +1290,4 @@ return success(); } -template -mlir::DiagnosedSilenceableFailure -mlir::transform::TransformWithPatternsOpTrait::applyToOne( - Operation *target, ApplyToEachResultList &results, TransformState &state) { - return detail::transformWithPatternsApply( - this->getOperation(), target, results, state, - [this](RewritePatternSet &patterns) { - cast(this->getOperation()).populatePatterns(patterns); - }); -} - -template -mlir::LogicalResult -mlir::transform::TransformWithPatternsOpTrait::verifyTrait( - Operation *op) { - if (!op->hasTrait()) { - return op->emitOpError() - << "TransformWithPatternsOpTrait requires TransformEachOpTrait"; - } - return success(); -} - #endif // DIALECT_TRANSFORM_IR_TRANSFORMINTERFACES_H diff --git a/mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.td b/mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.td --- a/mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.td +++ b/mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.td @@ -181,10 +181,6 @@ let cppNamespace = "::mlir::transform"; } -def TransformWithPatternsOpTrait : NativeOpTrait<"TransformWithPatternsOpTrait"> { - let cppNamespace = "::mlir::transform"; -} - def NavigationTransformOpTrait : NativeOpTrait<"NavigationTransformOpTrait"> { let cppNamespace = "::mlir::transform"; } diff --git a/mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.td b/mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.td --- a/mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.td +++ b/mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.td @@ -15,339 +15,257 @@ include "mlir/Interfaces/SideEffectInterfaces.td" include "mlir/IR/OpBase.td" -// TODO: not isolated from above and better targetability of the op. -// TODO: not a functional-style transform. -class TransformWithPatternsOp traits = []> - : Op { - let extraClassDeclaration = [{ - void populatePatterns(RewritePatternSet &patterns); - }]; -} - -def ApplyRankReducingSubviewPatternsOp : - TransformWithPatternsOp<"vector.apply_rank_reducing_subview_patterns"> { +def ApplyRankReducingSubviewPatternsOp : Op]> { let description = [{ Apply opt-in vector transfer permutation patterns that include: - TransferReadDropUnitDimsPattern - TransferWriteDropUnitDimsPattern - - These patterns have the effect of rewriting a vector.transfer with unit + + These patterns have the effect of rewriting a vector.transfer with unit dimensions into a rank-reduced version thanks to subview operations. This is complemented by shape_cast folding patterns. }]; - let arguments = (ins TransformHandleTypeInterface:$target); - let results = (outs TransformHandleTypeInterface:$results); - - let assemblyFormat = [{ - $target - attr-dict - `:` functional-type($target, results) - }]; + let assemblyFormat = "attr-dict"; } -def ApplyTransferPermutationPatternsOp : - TransformWithPatternsOp<"vector.apply_transfer_permutation_patterns"> { +def ApplyTransferPermutationPatternsOp : Op]> { let description = [{ Apply opt-in vector transfer permutation patterns that include: - TransferReadPermutationLowering - TransferWritePermutationLowering - TransferOpReduceRank - TransferWriteNonPermutationLowering - - These patterns have the effect of rewriting a vector.transfer with an - arbitrary permutation_map to a vector.transfer with a permutation_map that is - a minor identity followed by a vector.transpose. + + These patterns have the effect of rewriting a vector.transfer with an + arbitrary permutation_map to a vector.transfer with a permutation_map that + is a minor identity followed by a vector.transpose. In other words, this makes the vector.transfer contiguous on the most minor dimensions and materializes the permutation_map as a vector.transpose. }]; - let arguments = (ins TransformHandleTypeInterface:$target); - let results = (outs TransformHandleTypeInterface:$results); - - let assemblyFormat = [{ - $target - attr-dict - `:` functional-type($target, results) - }]; + let assemblyFormat = "attr-dict"; } -def LowerBroadcastOp : TransformWithPatternsOp<"vector.lower_broadcast"> { +def LowerBroadcastOp : Op]> { let description = [{ - Indicates that the vector outerproduct operations nested under the isolated - from above op `target` should be lowered to finer-grained vector primitives. + Indicates that vector broadcast operations should be lowered to + finer-grained vector primitives. This is usally a late step that is run after bufferization as part of the process of lowering to e.g. LLVM or NVVM. }]; - let arguments = (ins TransformHandleTypeInterface:$target); - let results = (outs TransformHandleTypeInterface:$results); - - let assemblyFormat = [{ - $target - attr-dict - `:` functional-type($target, results) - }]; + let assemblyFormat = "attr-dict"; } // TODO: evolve lowering_strategy to proper enums. -def LowerContractionOp : TransformWithPatternsOp<"vector.lower_contraction"> { +def LowerContractionOp : Op]> { let description = [{ - Indicates that the vector contraction-like operations nested under the - isolated from above op `target` should be lowered to finer-grained vector - primitives. + Indicates that vector contraction-like operations should be lowered to + finer-grained vector primitives. This is usually a late step that is run after bufferization as part of the process of lowering to e.g. LLVM or NVVM. }]; - let arguments = (ins TransformHandleTypeInterface:$target, - DefaultValuedAttr:$lowering_strategy + let arguments = (ins DefaultValuedAttr:$lowering_strategy ); - let results = (outs TransformHandleTypeInterface:$results); - let assemblyFormat = [{ - $target - (`lowering_strategy` `=` $lowering_strategy^)? - attr-dict - `:` functional-type($target, results) + (`lowering_strategy` `=` $lowering_strategy^)? attr-dict }]; } -def LowerMasksOp : TransformWithPatternsOp<"vector.lower_masks"> { +def LowerMasksOp : Op]> { let description = [{ - Indicates that the vector.create_mask and vector.constant_mask operations - nested under the isolated from above op `target` should be lowered to - finer-grained vector primitives. + Indicates that vector.create_mask and vector.constant_mask operations + should be lowered to finer-grained vector primitives. This is usually a late step that is run after bufferization as part of the process of lowering to e.g. LLVM or NVVM. }]; - let arguments = (ins TransformHandleTypeInterface:$target); - let results = (outs TransformHandleTypeInterface:$results); - - let assemblyFormat = [{ - $target - attr-dict - `:` functional-type($target, results) - }]; + let assemblyFormat = "attr-dict"; } -def LowerMaskedTransfersOp : TransformWithPatternsOp<"vector.lower_masked_transfers"> { +def LowerMaskedTransfersOp : Op]> { let description = [{ - Indicates that masked vector.transfer and vector.gather operations nested - under the isolated from above op `target` should be lowered to finer-grained - vector primitives. + Indicates that masked vector.transfer and vector.gather operations should + be lowered to finer-grained vector primitives. This is usually a late step that is run after bufferization as part of the process of lowering to e.g. LLVM or NVVM. }]; - let arguments = (ins TransformHandleTypeInterface:$target); - let results = (outs TransformHandleTypeInterface:$results); - - let assemblyFormat = [{ - $target - attr-dict - `:` functional-type($target, results) - }]; + let assemblyFormat = "attr-dict"; } -def MaterializeMasksOp : TransformWithPatternsOp<"vector.materialize_masks"> { +def MaterializeMasksOp : Op]> { let description = [{ - Indicates that mask operations nested under the isolated from above op - `target` should be lowered to fine-grained arithemtic operations. + Indicates that mask operations should be lowered to fine-grained arithemtic + operations. This is usually the last step that is run after bufferization as part of the process of lowering to e.g. LLVM or NVVM. }]; - let arguments = (ins TransformHandleTypeInterface:$target); - let results = (outs TransformHandleTypeInterface:$results); - - let assemblyFormat = [{ - $target - attr-dict - `:` functional-type($target, results) - }]; + let assemblyFormat = "attr-dict"; } // TODO: evolve lowering_strategy to proper enums. -def LowerMultiReductionOp - : TransformWithPatternsOp<"vector.lower_multi_reduction"> { +def LowerMultiReductionOp : Op]> { let description = [{ - Indicates that the vector multi_reduction-like operations nested under the - isolated from above op `target` should be lowered to finer-grained vector - primitives. + Indicates that vector multi_reduction-like operations should be lowered to + finer-grained vector primitives. This is usually a late step that is run after bufferization as part of the process of lowering to e.g. LLVM or NVVM. }]; - let arguments = (ins TransformHandleTypeInterface:$target, - DefaultValuedAttr: - $lowering_strategy + let arguments = (ins DefaultValuedAttr:$lowering_strategy ); - let results = (outs TransformHandleTypeInterface:$results); let assemblyFormat = [{ - $target - (`lowering_strategy` `=` $lowering_strategy^)? - attr-dict - `:` functional-type($target, results) + (`lowering_strategy` `=` $lowering_strategy^)? attr-dict }]; } -def LowerOuterProductOp : TransformWithPatternsOp<"vector.lower_outerproduct"> { +def LowerOuterProductOp : Op]> { let description = [{ - Indicates that the vector outerproduct operations nested under the isolated - from above op `target` should be lowered to finer-grained vector primitives. + Indicates that the vector outerproduct operations should be lowered to + finer-grained vector primitives. This is usually a late step that is run after bufferization as part of the process of lowering to e.g. LLVM or NVVM. }]; - let arguments = (ins TransformHandleTypeInterface:$target); - let results = (outs TransformHandleTypeInterface:$results); - - let assemblyFormat = [{ - $target - attr-dict - `:` functional-type($target, results) - }]; + let assemblyFormat = "attr-dict"; } -def LowerShapeCastOp : TransformWithPatternsOp<"vector.lower_shape_cast"> { +def LowerShapeCastOp : Op]> { let description = [{ - Indicates that the vector shape_cast operations nested under the - isolated from above op `target` should be lowered to finer-grained vector - primitives. + Indicates that vector shape_cast operations should be lowered to + finer-grained vector primitives. This is usually a late step that is run after bufferization as part of the process of lowering to e.g. LLVM or NVVM. }]; - let arguments = (ins TransformHandleTypeInterface:$target); - let results = (outs TransformHandleTypeInterface:$results); - - let assemblyFormat = [{ - $target - attr-dict - `:` functional-type($target, results) - }]; + let assemblyFormat = "attr-dict"; } -def LowerTransferOp : TransformWithPatternsOp<"vector.lower_transfer"> { +def LowerTransferOp : Op]> { let description = [{ - Indicates that the vector transfer operations nested under the - isolated from above op `target` should be lowered to finer-grained vector - primitives. + Indicates that vector transfer operations should be lowered to finer-grained + vector primitives. This is usually a late step that is run after bufferization as part of the process of lowering to e.g. LLVM or NVVM. }]; - let arguments = (ins TransformHandleTypeInterface:$target, - DefaultValuedAttr:$max_transfer_rank - ); - let results = (outs TransformHandleTypeInterface:$results); + let arguments = (ins DefaultValuedAttr:$max_transfer_rank); let assemblyFormat = [{ - $target - (`max_transfer_rank` `=` $max_transfer_rank^)? - attr-dict - `:` functional-type($target, results) + (`max_transfer_rank` `=` $max_transfer_rank^)? attr-dict }]; } // TODO: evolve lowering_strategy to proper enums. -def LowerTransposeOp : TransformWithPatternsOp<"vector.lower_transpose"> { +def LowerTransposeOp : Op]> { let description = [{ - Indicates that the vector transpose-like operations nested under the - isolated from above op `target` should be lowered to finer-grained vector - primitives. + Indicates that vector transpose-like operations should be lowered to + finer-grained vector primitives. This is usually a late step that is run after bufferization as part of the process of lowering to e.g. LLVM or NVVM. }]; - let arguments = (ins TransformHandleTypeInterface:$target, + let arguments = (ins DefaultValuedAttr:$lowering_strategy, DefaultValuedAttr:$avx2_lowering_strategy ); - let results = (outs TransformHandleTypeInterface:$results); let assemblyFormat = [{ - $target oilist ( `lowering_strategy` `=` $lowering_strategy | `avx2_lowering_strategy` `=` $avx2_lowering_strategy ) attr-dict - `:` functional-type($target, results) }]; } // TODO: evolve split_transfer_strategy to proper enums. -def SplitTransferFullPartialOp - : TransformWithPatternsOp<"vector.split_transfer_full_partial"> { +def SplitTransferFullPartialOp : Op]> { let description = [{ - Indicates that the vector transfer operations nested under the - isolated from above op `target` should be split to full and partial parts. + Indicates that vector transfer operations should be split to full and + partial parts. This is usually a late step that is run after bufferization as part of the process of lowering to e.g. LLVM or NVVM. }]; - let arguments = (ins TransformHandleTypeInterface:$target, + let arguments = (ins DefaultValuedAttr:$split_transfer_strategy ); - let results = (outs TransformHandleTypeInterface:$results); let assemblyFormat = [{ - $target - (`split_transfer_strategy` `=` $split_transfer_strategy^)? - attr-dict - `:` functional-type($target, results) + (`split_transfer_strategy` `=` $split_transfer_strategy^)? attr-dict }]; } -def TransferToScfOp : TransformWithPatternsOp<"vector.transfer_to_scf"> { +def TransferToScfOp : Op]> { let description = [{ - Indicates that the vector transfer operations nested under the - isolated from above op `target` should be rewritten with scf.for loops over - finer-grained vector primitives. + Indicates that vector transfer operations should be rewritten with scf.for + loops over finer-grained vector primitives. This is usually a late step that is run after bufferization as part of the process of lowering to e.g. LLVM or NVVM. }]; - let arguments = (ins TransformHandleTypeInterface:$target, + let arguments = (ins DefaultValuedAttr:$max_transfer_rank, DefaultValuedAttr:$full_unroll ); - let results = (outs TransformHandleTypeInterface:$results); let assemblyFormat = [{ - $target oilist ( `max_transfer_rank` `=` $max_transfer_rank | `full_unroll` `=` $full_unroll ) attr-dict - `:` functional-type($target, results) }]; } diff --git a/mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp b/mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp --- a/mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp +++ b/mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp @@ -1501,24 +1501,6 @@ return success(); } -DiagnosedSilenceableFailure transform::detail::transformWithPatternsApply( - Operation *transformOp, Operation *target, ApplyToEachResultList &results, - TransformState &state, - function_ref populatePatterns) { - if (!target->hasTrait()) { - return emitDefiniteFailure(transformOp) - << "applies only to isolated-from-above targets because it needs to " - "apply patterns greedily"; - } - RewritePatternSet patterns(transformOp->getContext()); - populatePatterns(patterns); - if (failed(applyPatternsAndFoldGreedily(target, std::move(patterns)))) - return emitDefiniteFailure(transformOp) << "failed to apply patterns"; - - results.push_back(target); - return DiagnosedSilenceableFailure::success(); -} - //===----------------------------------------------------------------------===// // Memory effects. //===----------------------------------------------------------------------===// diff --git a/mlir/lib/Dialect/Transform/IR/TransformOps.cpp b/mlir/lib/Dialect/Transform/IR/TransformOps.cpp --- a/mlir/lib/Dialect/Transform/IR/TransformOps.cpp +++ b/mlir/lib/Dialect/Transform/IR/TransformOps.cpp @@ -457,16 +457,25 @@ GreedyRewriteConfig config; config.listener = &listener; - // Manually gather list of ops because the other GreedyPatternRewriteDriver - // overloads only accepts ops that are isolated from above. This way, patterns - // can be applied to ops that are not isolated from above. - SmallVector ops; - target->walk([&](Operation *nestedOp) { - if (target != nestedOp) - ops.push_back(nestedOp); - }); - LogicalResult result = - applyOpPatternsAndFold(ops, std::move(patterns), config); + LogicalResult result = failure(); + if (target->hasTrait()) { + // Op is isolated from above. Apply patterns and also perform region + // simplification. + result = applyPatternsAndFoldGreedily(target, std::move(patterns), config); + } else { + // Manually gather list of ops because the other GreedyPatternRewriteDriver + // overloads only accepts ops that are isolated from above. This way, + // patterns can be applied to ops that are not isolated from above. Regions + // are not being simplified. Furthermore, only a single greedy rewrite + // iteration is performed. + SmallVector ops; + target->walk([&](Operation *nestedOp) { + if (target != nestedOp) + ops.push_back(nestedOp); + }); + result = applyOpPatternsAndFold(ops, std::move(patterns), config); + } + // A failure typically indicates that the pattern application did not // converge. if (failed(result)) { diff --git a/mlir/test/Dialect/LLVM/transform-e2e.mlir b/mlir/test/Dialect/LLVM/transform-e2e.mlir --- a/mlir/test/Dialect/LLVM/transform-e2e.mlir +++ b/mlir/test/Dialect/LLVM/transform-e2e.mlir @@ -27,33 +27,35 @@ // TODO: group these lower-level controls into various properly named vector // lowering TD macros. - %func = transform.vector.lower_contraction %f - lowering_strategy = "outerproduct" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_contraction lowering_strategy = "outerproduct" + } : !transform.any_op - %func_2 = transform.vector.apply_transfer_permutation_patterns %func - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.apply_transfer_permutation_patterns + } : !transform.any_op - %func_3 = transform.vector.lower_multi_reduction %func_2 - lowering_strategy = "innerparallel" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_multi_reduction lowering_strategy = "innerparallel" + } : !transform.any_op - %func_4 = transform.vector.split_transfer_full_partial %func_3 - split_transfer_strategy = "linalg-copy" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "linalg-copy" + } : !transform.any_op - %func_5 = transform.vector.transfer_to_scf %func_4 - max_transfer_rank = 1 full_unroll = true - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.transfer_to_scf max_transfer_rank = 1 full_unroll = true + } : !transform.any_op - %func_6 = transform.vector.lower_transfer %func_5 - max_transfer_rank = 1 - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_transfer max_transfer_rank = 1 + } : !transform.any_op - %func_7 = transform.vector.lower_shape_cast %func_6 - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_shape_cast + } : !transform.any_op - %func_8 = transform.vector.lower_transpose %func_7 - lowering_strategy = "shuffle_1d" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_transpose lowering_strategy = "shuffle_1d" + } : !transform.any_op } diff --git a/mlir/test/Dialect/Linalg/transform-op-matmul-to-outerproduct.mlir b/mlir/test/Dialect/Linalg/transform-op-matmul-to-outerproduct.mlir --- a/mlir/test/Dialect/Linalg/transform-op-matmul-to-outerproduct.mlir +++ b/mlir/test/Dialect/Linalg/transform-op-matmul-to-outerproduct.mlir @@ -32,5 +32,7 @@ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op %1 = get_closest_isolated_parent %0 : (!transform.any_op) -> !transform.any_op %2 = transform.structured.vectorize %1 : (!transform.any_op) -> !transform.any_op - transform.vector.lower_contraction %2 lowering_strategy = "outerproduct" : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %2 { + transform.apply_patterns.vector.lower_contraction lowering_strategy = "outerproduct" + } : !transform.any_op } diff --git a/mlir/test/Dialect/Vector/transform-vector.mlir b/mlir/test/Dialect/Vector/transform-vector.mlir --- a/mlir/test/Dialect/Vector/transform-vector.mlir +++ b/mlir/test/Dialect/Vector/transform-vector.mlir @@ -30,33 +30,35 @@ // TODO: group these lower-level controls into various properly named vector // lowering TD macros. - %func = transform.vector.lower_contraction %f - lowering_strategy = "outerproduct" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_contraction lowering_strategy = "outerproduct" + } : !transform.any_op - %func_2 = transform.vector.apply_transfer_permutation_patterns %func - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.apply_transfer_permutation_patterns + } : !transform.any_op - %func_3 = transform.vector.lower_multi_reduction %func_2 - lowering_strategy = "innerparallel" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_multi_reduction lowering_strategy = "innerparallel" + } : !transform.any_op - %func_4 = transform.vector.split_transfer_full_partial %func_3 - split_transfer_strategy = "linalg-copy" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "linalg-copy" + } : !transform.any_op - %func_5 = transform.vector.transfer_to_scf %func_4 - max_transfer_rank = 1 full_unroll = true - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.transfer_to_scf max_transfer_rank = 1 full_unroll = true + } : !transform.any_op - %func_6 = transform.vector.lower_transfer %func_5 - max_transfer_rank = 1 - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_transfer max_transfer_rank = 1 + } : !transform.any_op - %func_7 = transform.vector.lower_shape_cast %func_6 - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_shape_cast + } : !transform.any_op - %func_8 = transform.vector.lower_transpose %func_7 - lowering_strategy = "shuffle_1d" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_transpose lowering_strategy = "shuffle_1d" + } : !transform.any_op } diff --git a/mlir/test/Dialect/Vector/vector-broadcast-lowering-transforms.mlir b/mlir/test/Dialect/Vector/vector-broadcast-lowering-transforms.mlir --- a/mlir/test/Dialect/Vector/vector-broadcast-lowering-transforms.mlir +++ b/mlir/test/Dialect/Vector/vector-broadcast-lowering-transforms.mlir @@ -167,6 +167,7 @@ %f = transform.structured.match ops{["func.func"]} in %module_op : (!transform.any_op) -> !transform.any_op - transform.vector.lower_broadcast %f - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_broadcast + } : !transform.any_op } diff --git a/mlir/test/Dialect/Vector/vector-contract-matvec-transforms.mlir b/mlir/test/Dialect/Vector/vector-contract-matvec-transforms.mlir --- a/mlir/test/Dialect/Vector/vector-contract-matvec-transforms.mlir +++ b/mlir/test/Dialect/Vector/vector-contract-matvec-transforms.mlir @@ -210,7 +210,7 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - transform.vector.lower_contraction %module_op - lowering_strategy = "outerproduct" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.lower_contraction lowering_strategy = "outerproduct" + } : !transform.any_op } diff --git a/mlir/test/Dialect/Vector/vector-contract-to-dot-transforms.mlir b/mlir/test/Dialect/Vector/vector-contract-to-dot-transforms.mlir --- a/mlir/test/Dialect/Vector/vector-contract-to-dot-transforms.mlir +++ b/mlir/test/Dialect/Vector/vector-contract-to-dot-transforms.mlir @@ -300,7 +300,7 @@ %f = transform.structured.match ops{["func.func"]} in %module_op : (!transform.any_op) -> !transform.any_op - %f2 = transform.vector.lower_contraction %f - lowering_strategy = "dot" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_contraction lowering_strategy = "dot" + } : !transform.any_op } diff --git a/mlir/test/Dialect/Vector/vector-contract-to-matrix-intrinsics-transforms.mlir b/mlir/test/Dialect/Vector/vector-contract-to-matrix-intrinsics-transforms.mlir --- a/mlir/test/Dialect/Vector/vector-contract-to-matrix-intrinsics-transforms.mlir +++ b/mlir/test/Dialect/Vector/vector-contract-to-matrix-intrinsics-transforms.mlir @@ -48,10 +48,11 @@ %f = transform.structured.match ops{["func.func"]} in %module_op : (!transform.any_op) -> !transform.any_op - %f2 = transform.vector.lower_contraction %f - lowering_strategy = "matmulintrinsics" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_contraction lowering_strategy = "matmulintrinsics" + } : !transform.any_op - %f3 = transform.vector.lower_shape_cast %f2 - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_shape_cast + } : !transform.any_op } diff --git a/mlir/test/Dialect/Vector/vector-contract-to-outerproduct-transforms.mlir b/mlir/test/Dialect/Vector/vector-contract-to-outerproduct-transforms.mlir --- a/mlir/test/Dialect/Vector/vector-contract-to-outerproduct-transforms.mlir +++ b/mlir/test/Dialect/Vector/vector-contract-to-outerproduct-transforms.mlir @@ -347,7 +347,7 @@ %f = transform.structured.match ops{["func.func"]} in %module_op : (!transform.any_op) -> !transform.any_op - %f2 = transform.vector.lower_contraction %f - lowering_strategy = "outerproduct" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_contraction lowering_strategy = "outerproduct" + } : !transform.any_op } diff --git a/mlir/test/Dialect/Vector/vector-contract-to-parallel-arith-transforms.mlir b/mlir/test/Dialect/Vector/vector-contract-to-parallel-arith-transforms.mlir --- a/mlir/test/Dialect/Vector/vector-contract-to-parallel-arith-transforms.mlir +++ b/mlir/test/Dialect/Vector/vector-contract-to-parallel-arith-transforms.mlir @@ -56,7 +56,7 @@ %f = transform.structured.match ops{["func.func"]} in %module_op : (!transform.any_op) -> !transform.any_op - %f2 = transform.vector.lower_contraction %f - lowering_strategy = "parallelarith" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_contraction lowering_strategy = "parallelarith" + } : !transform.any_op } diff --git a/mlir/test/Dialect/Vector/vector-mask-lowering-transforms.mlir b/mlir/test/Dialect/Vector/vector-mask-lowering-transforms.mlir --- a/mlir/test/Dialect/Vector/vector-mask-lowering-transforms.mlir +++ b/mlir/test/Dialect/Vector/vector-mask-lowering-transforms.mlir @@ -96,8 +96,9 @@ %f = transform.structured.match ops{["func.func"]} in %module_op : (!transform.any_op) -> !transform.any_op - transform.vector.lower_masks %f - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_masks + } : !transform.any_op } // ----- @@ -126,6 +127,7 @@ %f = transform.structured.match ops{["func.func"]} in %module_op : (!transform.any_op) -> !transform.any_op - transform.vector.lower_masked_transfers %f - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_masked_transfers + } : !transform.any_op } diff --git a/mlir/test/Dialect/Vector/vector-multi-reduction-lowering.mlir b/mlir/test/Dialect/Vector/vector-multi-reduction-lowering.mlir --- a/mlir/test/Dialect/Vector/vector-multi-reduction-lowering.mlir +++ b/mlir/test/Dialect/Vector/vector-multi-reduction-lowering.mlir @@ -267,7 +267,7 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - transform.vector.lower_multi_reduction %module_op - lowering_strategy = "innerreduction" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.lower_multi_reduction lowering_strategy = "innerreduction" + } : !transform.any_op } diff --git a/mlir/test/Dialect/Vector/vector-multi-reduction-outer-lowering.mlir b/mlir/test/Dialect/Vector/vector-multi-reduction-outer-lowering.mlir --- a/mlir/test/Dialect/Vector/vector-multi-reduction-outer-lowering.mlir +++ b/mlir/test/Dialect/Vector/vector-multi-reduction-outer-lowering.mlir @@ -190,7 +190,7 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - transform.vector.lower_multi_reduction %module_op - lowering_strategy = "innerparallel" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.lower_multi_reduction lowering_strategy = "innerparallel" + } : !transform.any_op } diff --git a/mlir/test/Dialect/Vector/vector-outerproduct-lowering-transforms.mlir b/mlir/test/Dialect/Vector/vector-outerproduct-lowering-transforms.mlir --- a/mlir/test/Dialect/Vector/vector-outerproduct-lowering-transforms.mlir +++ b/mlir/test/Dialect/Vector/vector-outerproduct-lowering-transforms.mlir @@ -15,7 +15,7 @@ // CHECK: return %[[T7]] : vector<2x3xf32> func.func @outerproduct_noacc(%arg0: vector<2xf32>, - %arg1: vector<3xf32>) -> vector<2x3xf32> { + %arg1: vector<3xf32>) -> vector<2x3xf32> { %0 = vector.outerproduct %arg0, %arg1 : vector<2xf32>, vector<3xf32> return %0: vector<2x3xf32> } @@ -38,8 +38,8 @@ // CHECK: return %[[T9]] : vector<2x3xf32> func.func @outerproduct_acc(%arg0: vector<2xf32>, - %arg1: vector<3xf32>, - %arg2: vector<2x3xf32>) -> vector<2x3xf32> { + %arg1: vector<3xf32>, + %arg2: vector<2x3xf32>) -> vector<2x3xf32> { %0 = vector.outerproduct %arg0, %arg1, %arg2 : vector<2xf32>, vector<3xf32> return %0: vector<2x3xf32> } @@ -58,7 +58,7 @@ // CHECK: %[[T7:.*]] = vector.insert %[[T6]], %[[T3]] [1] : vector<3xi32> into vector<2x3xi32> // CHECK: return %[[T7]] : vector<2x3xi32> func.func @outerproduct_noacc_int(%arg0: vector<2xi32>, - %arg1: vector<3xi32>) -> vector<2x3xi32> { + %arg1: vector<3xi32>) -> vector<2x3xi32> { %0 = vector.outerproduct %arg0, %arg1 : vector<2xi32>, vector<3xi32> return %0: vector<2x3xi32> } @@ -82,8 +82,8 @@ // CHECK: %[[T11:.*]] = vector.insert %[[T10]], %[[T5]] [1] : vector<3xi32> into vector<2x3xi32> // CHECK: return %[[T11]] : vector<2x3xi32> func.func @outerproduct_acc_int(%arg0: vector<2xi32>, - %arg1: vector<3xi32>, - %arg2: vector<2x3xi32>) -> vector<2x3xi32> { + %arg1: vector<3xi32>, + %arg2: vector<2x3xi32>) -> vector<2x3xi32> { %0 = vector.outerproduct %arg0, %arg1, %arg2 : vector<2xi32>, vector<3xi32> return %0: vector<2x3xi32> } @@ -95,8 +95,8 @@ // CHECK: %[[T1:.*]] = arith.mulf %[[A]], %[[T0]] : vector<16xf32> // CHECK: return %[[T1]] : vector<16xf32> func.func @axpy_fp(%arg0: vector<16xf32>, %arg1: f32) -> vector<16xf32> { - %0 = vector.outerproduct %arg0, %arg1: vector<16xf32>, f32 - return %0: vector<16xf32> + %0 = vector.outerproduct %arg0, %arg1: vector<16xf32>, f32 + return %0: vector<16xf32> } // CHECK-LABEL: func @axpy_fp_add( @@ -107,8 +107,8 @@ // CHECK: %[[T1:.*]] = vector.fma %[[A]], %[[T0]], %[[C]] : vector<16xf32> // CHECK: return %[[T1]] : vector<16xf32> func.func @axpy_fp_add(%arg0: vector<16xf32>, %arg1: f32, %arg2 : vector<16xf32>) -> vector<16xf32> { - %0 = vector.outerproduct %arg0, %arg1, %arg2: vector<16xf32>, f32 - return %0: vector<16xf32> + %0 = vector.outerproduct %arg0, %arg1, %arg2: vector<16xf32>, f32 + return %0: vector<16xf32> } // CHECK-LABEL: func @axpy_int( @@ -118,8 +118,8 @@ // CHECK: %[[T1:.*]] = arith.muli %[[A]], %[[T0]] : vector<16xi32> // CHECK: return %[[T1]] : vector<16xi32> func.func @axpy_int(%arg0: vector<16xi32>, %arg1: i32) -> vector<16xi32> { - %0 = vector.outerproduct %arg0, %arg1: vector<16xi32>, i32 - return %0: vector<16xi32> + %0 = vector.outerproduct %arg0, %arg1: vector<16xi32>, i32 + return %0: vector<16xi32> } // CHECK-LABEL: func @axpy_int_add( @@ -131,8 +131,8 @@ // CHECK: %[[T2:.*]] = arith.addi %[[T1]], %[[C]] : vector<16xi32> // CHECK: return %[[T2]] : vector<16xi32> func.func @axpy_int_add(%arg0: vector<16xi32>, %arg1: i32, %arg2: vector<16xi32>) -> vector<16xi32> { - %0 = vector.outerproduct %arg0, %arg1, %arg2: vector<16xi32>, i32 - return %0: vector<16xi32> + %0 = vector.outerproduct %arg0, %arg1, %arg2: vector<16xi32>, i32 + return %0: vector<16xi32> } transform.sequence failures(propagate) { @@ -140,9 +140,11 @@ %f = transform.structured.match ops{["func.func"]} in %module_op : (!transform.any_op) -> !transform.any_op - %f2 = transform.vector.lower_outerproduct %f - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_outerproduct + } : !transform.any_op - %f3 = transform.vector.lower_broadcast %f2 - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_broadcast + } : !transform.any_op } diff --git a/mlir/test/Dialect/Vector/vector-shape-cast-lowering-transforms.mlir b/mlir/test/Dialect/Vector/vector-shape-cast-lowering-transforms.mlir --- a/mlir/test/Dialect/Vector/vector-shape-cast-lowering-transforms.mlir +++ b/mlir/test/Dialect/Vector/vector-shape-cast-lowering-transforms.mlir @@ -154,6 +154,7 @@ %f = transform.structured.match ops{["func.func"]} in %module_op : (!transform.any_op) -> !transform.any_op - %f2 = transform.vector.lower_shape_cast %f - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %f { + transform.apply_patterns.vector.lower_shape_cast + } : !transform.any_op } diff --git a/mlir/test/Dialect/Vector/vector-transfer-drop-unit-dims-patterns.mlir b/mlir/test/Dialect/Vector/vector-transfer-drop-unit-dims-patterns.mlir --- a/mlir/test/Dialect/Vector/vector-transfer-drop-unit-dims-patterns.mlir +++ b/mlir/test/Dialect/Vector/vector-transfer-drop-unit-dims-patterns.mlir @@ -16,9 +16,10 @@ // CHECK: vector.transfer_read %[[SUBVIEW]] transform.sequence failures(propagate) { -^bb1(%module_op: !pdl.operation): - transform.vector.apply_rank_reducing_subview_patterns %module_op - : (!pdl.operation) -> !pdl.operation +^bb1(%module_op: !transform.any_op): + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.apply_rank_reducing_subview_patterns + } : !transform.any_op } // ----- @@ -37,9 +38,10 @@ // CHECK: vector.transfer_write %{{.*}}, %[[SUBVIEW]] transform.sequence failures(propagate) { -^bb1(%module_op: !pdl.operation): - transform.vector.apply_rank_reducing_subview_patterns %module_op - : (!pdl.operation) -> !pdl.operation +^bb1(%module_op: !transform.any_op): + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.apply_rank_reducing_subview_patterns + } : !transform.any_op } // ----- @@ -60,9 +62,10 @@ // CHECK: vector.transfer_read %[[SUBVIEW]]{{.*}} {in_bounds = [true, true]} : memref<3x2xf32>, vector<3x2xf32> transform.sequence failures(propagate) { -^bb1(%module_op: !pdl.operation): - transform.vector.apply_rank_reducing_subview_patterns %module_op - : (!pdl.operation) -> !pdl.operation +^bb1(%module_op: !transform.any_op): + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.apply_rank_reducing_subview_patterns + } : !transform.any_op } // ----- @@ -84,8 +87,9 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - transform.vector.apply_rank_reducing_subview_patterns %module_op - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.apply_rank_reducing_subview_patterns + } : !transform.any_op } // ----- @@ -106,9 +110,10 @@ // CHECK: vector.shape_cast %[[READ]] : vector to vector<1x1x1xf32> transform.sequence failures(propagate) { -^bb1(%module_op: !pdl.operation): - transform.vector.apply_rank_reducing_subview_patterns %module_op - : (!pdl.operation) -> !pdl.operation +^bb1(%module_op: !transform.any_op): + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.apply_rank_reducing_subview_patterns + } : !transform.any_op } // ----- @@ -130,6 +135,7 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - transform.vector.apply_rank_reducing_subview_patterns %module_op - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.apply_rank_reducing_subview_patterns + } : !transform.any_op } 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 --- 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 @@ -108,9 +108,9 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - transform.vector.split_transfer_full_partial %module_op - split_transfer_strategy = "linalg-copy" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "linalg-copy" + } : !transform.any_op } // ----- @@ -169,9 +169,9 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - transform.vector.split_transfer_full_partial %module_op - split_transfer_strategy = "linalg-copy" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "linalg-copy" + } : !transform.any_op } // ----- @@ -237,7 +237,7 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - transform.vector.split_transfer_full_partial %module_op - split_transfer_strategy = "linalg-copy" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "linalg-copy" + } : !transform.any_op } diff --git a/mlir/test/Dialect/Vector/vector-transfer-full-partial-split.mlir b/mlir/test/Dialect/Vector/vector-transfer-full-partial-split.mlir --- a/mlir/test/Dialect/Vector/vector-transfer-full-partial-split.mlir +++ b/mlir/test/Dialect/Vector/vector-transfer-full-partial-split.mlir @@ -103,9 +103,9 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - transform.vector.split_transfer_full_partial %module_op - split_transfer_strategy = "vector-transfer" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "vector-transfer" + } : !transform.any_op } // ----- @@ -161,9 +161,9 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - transform.vector.split_transfer_full_partial %module_op - split_transfer_strategy = "vector-transfer" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "vector-transfer" + } : !transform.any_op } // ----- @@ -223,9 +223,9 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - transform.vector.split_transfer_full_partial %module_op - split_transfer_strategy = "vector-transfer" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "vector-transfer" + } : !transform.any_op } // ----- @@ -265,7 +265,7 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - transform.vector.split_transfer_full_partial %module_op - split_transfer_strategy = "vector-transfer" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.split_transfer_full_partial split_transfer_strategy = "vector-transfer" + } : !transform.any_op } diff --git a/mlir/test/Dialect/Vector/vector-transfer-to-vector-load-store.mlir b/mlir/test/Dialect/Vector/vector-transfer-to-vector-load-store.mlir --- a/mlir/test/Dialect/Vector/vector-transfer-to-vector-load-store.mlir +++ b/mlir/test/Dialect/Vector/vector-transfer-to-vector-load-store.mlir @@ -240,11 +240,10 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - %m2 = transform.vector.lower_transfer %module_op - max_transfer_rank = 99 - : (!transform.any_op) -> !transform.any_op - transform.vector.apply_transfer_permutation_patterns %m2 - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.lower_transfer max_transfer_rank = 99 + transform.apply_patterns.vector.apply_transfer_permutation_patterns + } : !transform.any_op } // ----- @@ -363,9 +362,8 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - %m2 = transform.vector.lower_transfer %module_op - max_transfer_rank = 99 - : (!transform.any_op) -> !transform.any_op - transform.vector.apply_transfer_permutation_patterns %m2 - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.lower_transfer max_transfer_rank = 99 + transform.apply_patterns.vector.apply_transfer_permutation_patterns + } : !transform.any_op } diff --git a/mlir/test/Dialect/Vector/vector-transpose-lowering.mlir b/mlir/test/Dialect/Vector/vector-transpose-lowering.mlir --- a/mlir/test/Dialect/Vector/vector-transpose-lowering.mlir +++ b/mlir/test/Dialect/Vector/vector-transpose-lowering.mlir @@ -76,9 +76,9 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - transform.vector.lower_transpose %module_op - lowering_strategy = "eltwise" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.lower_transpose lowering_strategy = "eltwise" + } : !transform.any_op } // ----- @@ -99,9 +99,9 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - transform.vector.lower_transpose %module_op - lowering_strategy = "shuffle_1d" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.lower_transpose lowering_strategy = "shuffle_1d" + } : !transform.any_op } // ----- @@ -118,9 +118,9 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - transform.vector.lower_transpose %module_op - lowering_strategy = "flat_transpose" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.lower_transpose lowering_strategy = "flat_transpose" + } : !transform.any_op } // ----- @@ -605,9 +605,9 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - transform.vector.lower_transpose %module_op - avx2_lowering_strategy = true - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.lower_transpose avx2_lowering_strategy = true + } : !transform.any_op } // ----- @@ -683,9 +683,9 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - transform.vector.lower_transpose %module_op - lowering_strategy = "shuffle_16x16" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.lower_transpose lowering_strategy = "shuffle_16x16" + } : !transform.any_op } // ----- @@ -762,7 +762,7 @@ transform.sequence failures(propagate) { ^bb1(%module_op: !transform.any_op): - transform.vector.lower_transpose %module_op - lowering_strategy = "shuffle_16x16" - : (!transform.any_op) -> !transform.any_op + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.lower_transpose lowering_strategy = "shuffle_16x16" + } : !transform.any_op } diff --git a/mlir/test/Integration/Dialect/Vector/CPU/test-shuffle16x16.mlir b/mlir/test/Integration/Dialect/Vector/CPU/test-shuffle16x16.mlir --- a/mlir/test/Integration/Dialect/Vector/CPU/test-shuffle16x16.mlir +++ b/mlir/test/Integration/Dialect/Vector/CPU/test-shuffle16x16.mlir @@ -30,9 +30,9 @@ } transform.sequence failures(propagate) { -^bb1(%module_op: !pdl.operation): - transform.vector.lower_transpose %module_op - lowering_strategy = "shuffle_16x16" - : (!pdl.operation) -> !pdl.operation +^bb1(%module_op: !transform.any_op): + transform.apply_patterns [] to %module_op { + transform.apply_patterns.vector.lower_transpose lowering_strategy = "shuffle_16x16" + } : !transform.any_op }