def MapNestedForallToThreads :
Op<Transform_Dialect, "gpu.map_nested_forall_to_threads",
- [FunctionalStyleTransformOpTrait,
- MemoryEffectsOpInterface,
+ [DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
TransformEachOpTrait,
TransformOpInterface]> {
let description = [{
scf.forall operations with mappings other than gpu.thread are
ignored.
- 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.
+ This operation returns nothing.
#### Example:
```
}];
- let arguments = (ins PDL_Operation:$target,
+ let arguments = (ins TransformHandleTypeInterface:$target,
DefaultValuedAttr<DenseI64ArrayAttr, "{}">:$block_dims,
DefaultValuedOptionalAttr<DenseI64ArrayAttr, "{}">:$warp_dims,
DefaultValuedAttr<BoolAttr, "true">:$sync_after_distribute);
- let results = (outs PDL_Operation:$result);
+ let results = (outs);
let assemblyFormat = [{
$target
(`warp_dims` `=` $warp_dims^)?
(`sync_after_distribute` `=` $sync_after_distribute^)?
attr-dict
+ `:` functional-type(operands, results)
}];
let extraClassDeclaration = [{
::mlir::DiagnosedSilenceableFailure applyToOne(
//===----------------------------------------------------------------------===//
def VectorizeOp : Op<Transform_Dialect, "structured.vectorize",
- [FunctionalStyleTransformOpTrait, MemoryEffectsOpInterface,
- TransformEachOpTrait, TransformOpInterface]> {
+ [DeclareOpInterfaceMethods<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
This operation produces `definiteFailure` if vectorization fails for any
reason.
- The operation always returns the handle to the target op that is expected
- to be isolated from above.
+ This operation returns nothing.
}];
- let arguments = (ins PDL_Operation:$target,
+ let arguments = (ins TransformHandleTypeInterface:$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 PDL_Operation:$transformed);
+ let results = (outs);
- let assemblyFormat = "$target attr-dict";
+ let assemblyFormat = [{
+ $target
+ attr-dict
+ `:` functional-type(operands, results)
+ }];
- let builders = [
- OpBuilder<(ins "Value":$target,
- CArg<"bool", "false">:$vectorizePadding,
- CArg<"bool", "false">:$vectorizeNDExtract)>,
- ];
let extraClassDeclaration = [{
::mlir::DiagnosedSilenceableFailure applyToOne(
::mlir::Operation *target,
}];
}
+//===----------------------------------------------------------------------===//
+// MaskedVectorizeOp
+//===----------------------------------------------------------------------===//
+
def MaskedVectorizeOp : Op<Transform_Dialect, "structured.masked_vectorize",
[DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
TransformOpInterface]> {
def HoistRedundantVectorTransfersOp :
Op<Transform_Dialect, "structured.hoist_redundant_vector_transfers",
- [FunctionalStyleTransformOpTrait, MemoryEffectsOpInterface,
- TransformEachOpTrait, TransformOpInterface]> {
+ [DeclareOpInterfaceMethods<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:
#### Return modes:
- The operation always succeeds and returns a handle to the transformed
- function op.
+ The operation always succeeds and returns nothing.
}];
let arguments = (ins TransformHandleTypeInterface:$target);
- let results = (outs TransformHandleTypeInterface:$transformed);
-
- let assemblyFormat = "$target attr-dict `:` functional-type(operands, results) ";
+ let results = (outs);
+ let assemblyFormat = [{
+ $target
+ attr-dict
+ `:` functional-type(operands, results)
+ }];
- let builders = [
- OpBuilder<(ins "Value":$target)>,
- ];
let extraClassDeclaration = [{
::mlir::DiagnosedSilenceableFailure applyToOne(
::mlir::func::FuncOp target,
def HoistRedundantTensorSubsetsOp :
Op<Transform_Dialect, "structured.hoist_redundant_tensor_subsets",
- [FunctionalStyleTransformOpTrait, MemoryEffectsOpInterface,
- TransformEachOpTrait, TransformOpInterface]> {
+ [DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
+ TransformEachOpTrait,
+ TransformOpInterface]> {
let description = [{
Hoists supported tensor subset extract/insert operation pairs out of
immediately enclosing loop iteratively, if the following conditions
#### Return modes:
- The operation always succeeds and returns a handle to the transformed
- function op.
+ The operation always succeeds and returns nothing.
}];
let arguments = (ins TransformHandleTypeInterface:$target);
- let results = (outs TransformHandleTypeInterface:$transformed);
+ let results = (outs);
- 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,
include "mlir/IR/OpBase.td"
def LowerVectorsOp : Op<Transform_Dialect, "vector.lower_vectors",
- [DeclareOpInterfaceMethods<TransformOpInterface>,
- DeclareOpInterfaceMethods<MemoryEffectsOpInterface>]> {
+ [DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
+ TransformEachOpTrait,
+ TransformOpInterface]> {
let description = [{
Indicates that the vector operations nested under the isolated from above op
`target` 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.
+
+ #### Return modes:
+
+ The operation returns nothing.
}];
// TODO: evolve this to proper enums.
- let arguments = (ins PDL_Operation:$target,
+ let arguments = (ins TransformHandleTypeInterface:$target,
DefaultValuedAttr<VectorContractLoweringAttr,
"vector::VectorContractLowering::OuterProduct">:$contraction_lowering,
DefaultValuedAttr<VectorMultiReductionLoweringAttr,
DefaultValuedAttr<BoolAttr, "false">:$transpose_avx2_lowering,
DefaultValuedAttr<BoolAttr, "true">:$unroll_vector_transfers
);
- let results = (outs PDL_Operation:$results);
+ let results = (outs);
let builders = [
OpBuilder<(ins "Type":$resultType, "Value":$target,
| `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);
}];
}
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);
mapNestedForallToThreadsImpl(rewriter, transformOp, gpuLaunch, blockDims,
getWarpDims(), getSyncAfterDistribute());
- results.push_back(gpuLaunch.getOperation());
return diag;
}
}
//===---------------------------------------------------------------------===//
-// HoistPadOp
+// PadOp
//===---------------------------------------------------------------------===//
DiagnosedSilenceableFailure
// 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.
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
//===----------------------------------------------------------------------===//
}
//===----------------------------------------------------------------------===//
-// 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.
//===----------------------------------------------------------------------===//
IRRewriter rewriter(target->getContext());
auto forOp = dyn_cast<scf::ForOp>(target);
if (forOp) {
- scf::ForOp newForOp =
- linalg::hoistRedundantSubsetExtractInsert(rewriter, forOp);
- results.push_back(newForOp);
+ linalg::hoistRedundantSubsetExtractInsert(rewriter, forOp);
return DiagnosedSilenceableFailure::success();
}
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
//===----------------------------------------------------------------------===//
void transform::LowerVectorsOp::getEffects(
SmallVectorImpl<MemoryEffects::EffectInstance> &effects) {
- consumesHandle(getTarget(), effects);
- producesHandle(getResults(), effects);
+ onlyReadsHandle(getTarget(), effects);
modifiesPayload(effects);
}
-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);
+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");
}
- transformResults.set(getResults().cast<OpResult>(), results);
+ 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();
+
return DiagnosedSilenceableFailure::success();
}
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,
^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}}
- %1 = transform.gpu.map_nested_forall_to_threads %funcop block_dims = [1, 1, 1]
+ transform.gpu.map_nested_forall_to_threads %funcop block_dims = [1, 1, 1]
+ : (!pdl.operation) -> ()
}
// -----
// 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) -> ()
}
// -----
%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) -> ()
}
// -----
%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) -> ()
}
// -----
%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) -> ()
}
// -----
%funcop = transform.structured.match ops{["gpu.launch"]} in %arg0 : (!pdl.operation) -> !pdl.operation
// expected-error @below {{duplicated attribute, cannot map different loops to the same processor}}
transform.gpu.map_nested_forall_to_threads %funcop block_dims = [32, 32, 1]
+ : (!pdl.operation) -> ()
}
// -----
^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) -> ()
}
// -----
%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) -> ()
}
// -----
^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) -> ()
}
// -----
^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) -> ()
}
// -----
^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) -> ()
}
// -----
%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 = [2, 2, 1]
+ : (!pdl.operation) -> ()
}
%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
+ transform.structured.vectorize %2 : (!pdl.operation) -> ()
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"
+ transform.vector.lower_vectors %func multireduction_lowering = "innerreduction"
+ : (!pdl.operation) -> ()
}
%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) -> ()
+ // Test we can call the op twice without consuming the handle.
+ transform.structured.hoist_redundant_vector_transfers %0
+ : (!pdl.operation) -> ()
}
// -----
%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) -> ()
}
// -----
%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) -> ()
}
// -----
%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) -> ()
+ // Test we can call the op twice without consuming the handle.
+ transform.structured.hoist_redundant_tensor_subsets %0
+ : (!pdl.operation) -> ()
}
// -----
%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) -> ()
}
// -----
%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) -> ()
}
// -----
%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) -> ()
}
// -----
%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) -> ()
}
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 {vectorize_padding}
+ 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) -> ()
}
// -----
^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}}
- %2 = transform.structured.vectorize %0
+ transform.structured.vectorize %0 : (!pdl.operation) -> ()
}
^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
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
+ transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
+ : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
+ transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
+ : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
+ transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
+ : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
+ transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
+ : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+ transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+ : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+ transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+ : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+ transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+ : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+ transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+ : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
+ transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
+ : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ transform.structured.vectorize %1 { vectorize_nd_extract }
+ : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns }
+ transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns }
+ : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns }
+ transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns }
+ : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns }
+ transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns }
+ : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns }
+ transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns }
+ : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+ transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+ : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { vectorize_padding }
+ transform.structured.vectorize %1 { vectorize_padding } : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { vectorize_padding }
+ transform.structured.vectorize %1 { vectorize_padding } : (!pdl.operation) -> ()
}
^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
- %2 = transform.structured.vectorize %1 { vectorize_padding }
+ transform.structured.vectorize %1 { vectorize_padding } : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { vectorize_padding }
+ transform.structured.vectorize %1 { vectorize_padding } : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { vectorize_padding }
+ transform.structured.vectorize %1 { vectorize_padding } : (!pdl.operation) -> ()
}
// -----
^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
- %5 = transform.structured.vectorize %4 { vectorize_padding }
+ transform.structured.vectorize %4 { vectorize_padding } : (!pdl.operation) -> ()
}
^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
- %5 = transform.structured.vectorize %4 { vectorize_padding }
+ transform.structured.vectorize %4 { vectorize_padding } : (!pdl.operation) -> ()
}
^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
- %5 = transform.structured.vectorize %4 { vectorize_padding }
+ transform.structured.vectorize %4 { vectorize_padding } : (!pdl.operation) -> ()
}
^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
- %5 = transform.structured.vectorize %4
+ transform.structured.vectorize %4 : (!pdl.operation) -> ()
}
// -----
^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
- %5 = transform.structured.vectorize %4 { vectorize_padding }
+ transform.structured.vectorize %4 { vectorize_padding } : (!pdl.operation) -> ()
}
// -----
^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
- %5 = transform.structured.vectorize %4
+ transform.structured.vectorize %4 : (!pdl.operation) -> ()
}
// -----
^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
- %5 = transform.structured.vectorize %4 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+ transform.structured.vectorize %4 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+ : (!pdl.operation) -> ()
}
// -----
^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
- %5 = transform.structured.vectorize %4 { vectorize_padding }
+ transform.structured.vectorize %4 { vectorize_padding } : (!pdl.operation) -> ()
}
// -----
^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
- %5 = transform.structured.vectorize %4
+ transform.structured.vectorize %4 : (!pdl.operation) -> ()
}
// -----
^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
- %5 = transform.structured.vectorize %4
+ transform.structured.vectorize %4 : (!pdl.operation) -> ()
}
// -----
^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
- %5 = transform.structured.vectorize %4
+ transform.structured.vectorize %4 : (!pdl.operation) -> ()
}
// -----
^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
- %5 = transform.structured.vectorize %4
+ transform.structured.vectorize %4 : (!pdl.operation) -> ()
}
// -----
^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
- %5 = transform.structured.vectorize %4
+ transform.structured.vectorize %4 : (!pdl.operation) -> ()
}
// -----
^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
- %5 = transform.structured.vectorize %4
+ transform.structured.vectorize %4 : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!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
- %5 = transform.structured.vectorize %4
+ transform.structured.vectorize %4 : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+ transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+ : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ transform.structured.vectorize %1 { vectorize_nd_extract } : (!pdl.operation) -> ()
}
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
// -----
transform.sequence failures(propagate) {
^bb0(%arg0: !pdl.operation):
%0 = transform.structured.match ops{["func.func"]} in %arg0 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.vectorize %0
+ transform.structured.vectorize %0 : (!pdl.operation) -> ()
}
// -----
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
// CHECK-LABEL: @wrong_reduction_detection
^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
- %2 = transform.structured.vectorize %1
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
// -----
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
+ transform.structured.vectorize %2 : (!pdl.operation) -> ()
}
}
^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
+ transform.structured.vectorize %1 : (!pdl.operation) -> ()
}
}
transform.sequence failures(propagate) {
^bb0(%arg0: !pdl.operation):
- transform.structured.vectorize %arg0
+ transform.structured.vectorize %arg0 : (!pdl.operation) -> ()
}
%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
+ transform.structured.vectorize %2 : (!pdl.operation) -> ()
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) -> ()
}
transform.YieldOp()
# CHECK-LABEL: TEST: testVectorize
# CHECK: transform.sequence
- # CHECK: = transform.structured.vectorize
+ # CHECK: transform.structured.vectorize
# CHECK: {vectorize_padding}