include "mlir/Dialect/Transform/IR/TransformDialect.td"
include "mlir/Dialect/Transform/IR/TransformInterfaces.td"
include "mlir/Dialect/Transform/IR/TransformTypes.td"
-include "mlir/Dialect/PDL/IR/PDLTypes.td"
include "mlir/Dialect/SCF/IR/DeviceMappingInterface.td"
include "mlir/Interfaces/SideEffectInterfaces.td"
include "mlir/IR/OpBase.td"
#### Return modes
This operation ignores non-Linalg ops and drops them in the return.
- If all the operations referred to by the `target` PDLOperation decompose
+ If all the operations referred to by the `target` handle decompose
properly, the transform succeeds. Otherwise the transform silently fails.
The return handle points to only the subset of successfully produced
computational operations, which can be empty.
}];
- let arguments = (ins PDL_Operation:$target);
- let results = (outs PDL_Operation:$transformed);
- let assemblyFormat = "$target attr-dict";
+ let arguments = (ins TransformHandleTypeInterface:$target);
+ let results = (outs TransformHandleTypeInterface:$transformed);
+ let assemblyFormat =
+ "$target attr-dict `:` functional-type(operands, results)";
let extraClassDeclaration = [{
::mlir::DiagnosedSilenceableFailure applyToOne(
}];
let arguments =
- (ins PDL_Operation:$target,
+ (ins TransformHandleTypeInterface:$target,
DefaultValuedAttr<I64ArrayAttr, "{}">:$tile_sizes,
DefaultValuedAttr<I64ArrayAttr, "{}">:$tile_interchange);
- let results = (outs PDL_Operation:$transformed,
- Variadic<PDL_Operation>:$loops);
+ let results = (outs TransformHandleTypeInterface:$transformed,
+ Variadic<TransformHandleTypeInterface>:$loops);
let hasCustomAssemblyFormat = 1;
let hasVerifier = 1;
This operation only reads the containing op handle.
}];
- let arguments = (ins PDL_Operation:$producer_op,
- PDL_Operation:$containing_op);
- let results = (outs PDL_Operation:$fused_op);
- let assemblyFormat = "$producer_op `into` $containing_op attr-dict";
+ let arguments = (ins TransformHandleTypeInterface:$producer_op,
+ TransformHandleTypeInterface:$containing_op);
+ let results = (outs TransformHandleTypeInterface:$fused_op);
+ let assemblyFormat = "$producer_op `into` $containing_op attr-dict "
+ " `:` functional-type(operands, results)";
let builders = [
OpBuilder<(ins "Value":$producerOp, "Value":$containingOp)>
#### Return modes
This operation ignores non-Linalg ops and drops them in the return.
- If all the operations referred to by the `target` PDLOperation generalize
+ If all the operations referred to by the `target` handle generalize
properly, the transform succeeds. Otherwise the transform silently fails.
The return handle points to only the subset of successfully produced
equivalent generic operations, which can be empty or contain the original
ops if they were already in generic form.
}];
- let arguments = (ins PDL_Operation:$target);
- let results = (outs PDL_Operation:$transformed);
- let assemblyFormat = "$target attr-dict";
+ let arguments = (ins TransformHandleTypeInterface:$target);
+ let results = (outs TransformHandleTypeInterface:$transformed);
+ let assemblyFormat =
+ "$target attr-dict `:` "
+ "custom<SemiFunctionType>(type($target), type($transformed))";
let extraClassDeclaration = [{
::mlir::DiagnosedSilenceableFailure applyToOne(
This operation ignores non-linalg::Generic ops and drops them in the return.
This operation fails if the interchange attribute is invalid.
- If all the operations referred to by the `target` PDLOperation interchange
+ If all the operations referred to by the `target` handle interchange
properly, the transform succeeds.
If any interchange fails, the transform definitely fails.
The return handle points to only the subset of successfully produced
}];
let arguments =
- (ins PDL_Operation:$target,
+ (ins TransformHandleTypeInterface:$target,
ConfinedAttr<DefaultValuedOptionalAttr<DenseI64ArrayAttr, "{}">,
[DenseArrayNonNegative<DenseI64ArrayAttr>]>:$iterator_interchange);
- let results = (outs PDL_Operation:$transformed);
+ let results = (outs TransformHandleTypeInterface:$transformed);
let assemblyFormat = [{
$target
(`iterator_interchange` `=` $iterator_interchange^)? attr-dict
+ `:` custom<SemiFunctionType>(type($target), type($transformed))
}];
let hasVerifier = 1;
}];
let arguments = (ins TransformHandleTypeInterface:$target,
- Variadic<PDL_Operation>:$packed_sizes,
+ Variadic<TransformHandleTypeInterface>:$packed_sizes,
DefaultValuedAttr<DenseI64ArrayAttr, "{}">:$static_packed_sizes);
let results = (outs TransformHandleTypeInterface:$packed_op);
let assemblyFormat = [{
$target
`packed_sizes` `=` custom<DynamicIndexList>($packed_sizes,
- $static_packed_sizes)
+ $static_packed_sizes,
+ type($packed_sizes))
attr-dict
`:` functional-type($target, results)
}];
// TODO: Transform_ConcreteOpType<linalg::LinalgOp> needs interface.
let arguments = (ins TransformHandleTypeInterface:$target,
- Variadic<PDL_Operation>:$matmul_packed_sizes,
+ Variadic<TransformHandleTypeInterface>:$matmul_packed_sizes,
ConfinedAttr<DefaultValuedAttr<DenseI64ArrayAttr, "{}">,
[DenseArrayCount<3>]>:$static_matmul_packed_sizes,
ConfinedAttr<DefaultValuedAttr<DenseI64ArrayAttr, "{}">,
$target
oilist(
`matmul_packed_sizes` `=` custom<DynamicIndexList>($matmul_packed_sizes,
- $static_matmul_packed_sizes)
+ $static_matmul_packed_sizes,
+ type($matmul_packed_sizes))
(`matmul_padded_sizes_next_multiple_of` `=`
$matmul_padded_sizes_next_multiple_of^)?
`matmul_inner_dims_order` `=` $matmul_inner_dims_order
This operation ignores non-Linalg ops and drops them in the return.
This operation may produce a definiteFailure if the padding fails for any
reason.
- If all the operations referred to by the `target` PDLOperation pad
+ If all the operations referred to by the `target` handle pad
properly, the transform succeeds. Otherwise the transform silently fails.
The return handle points to only the subset of successfully produced
padded operations, which can be empty.
}];
let arguments =
- (ins PDL_Operation:$target,
+ (ins TransformHandleTypeInterface:$target,
DefaultValuedAttr<ArrayAttr, "{}">:$padding_values,
DefaultValuedAttr<I64ArrayAttr, "{}">:$padding_dimensions,
DefaultValuedAttr<I64ArrayAttr, "{}">:$pack_paddings,
DefaultValuedAttr<
TypedArrayAttrBase<I64ArrayAttr, "array of arrays of i64">,
"{}">:$transpose_paddings);
- let results = (outs PDL_Operation:$transformed);
+ let results = (outs TransformHandleTypeInterface:$transformed);
- let assemblyFormat = "$target attr-dict";
+ let assemblyFormat =
+ "$target attr-dict `:` "
+ "custom<SemiFunctionType>(type($target), type($transformed))";
let hasVerifier = 1;
let extraClassDeclaration = [{
This operation applies to a single Linalg op that satisfies the
`promoteSubviewsPrecondition`, otherwise it fails.
- If the operations referred to by the `target` PDLOperation promote
+ If the operations referred to by the `target` handle promote
properly, the transform succeeds.
When successful, the return handle points to the $target operation that
was modified inplace.
}];
- let arguments = (ins PDL_Operation:$target,
+ let arguments = (ins TransformHandleTypeInterface:$target,
DefaultValuedAttr<I64ArrayAttr, "{}">:$operands_to_promote,
DefaultValuedAttr<BoolArrayAttr, "{}">:$use_full_tile_buffers,
UnitAttr:$use_full_tiles_by_default,
UnitAttr:$use_alloca,
OptionalAttr<DeviceMappingArrayAttr>:$mapping,
OptionalAttr<I64Attr>:$alignment);
- let results = (outs PDL_Operation:$transformed);
+ let results = (outs TransformHandleTypeInterface:$transformed);
- let assemblyFormat = "$target attr-dict";
+ let assemblyFormat =
+ "$target attr-dict `:`"
+ "custom<SemiFunctionType>(type($target), type($transformed))";
let extraClassDeclaration = [{
::mlir::DiagnosedSilenceableFailure applyToOne(
This operation consumes the `target` handle.
}];
- let arguments = (ins PDL_Operation:$target);
- let results = (outs PDL_Operation:$replacement);
+ let arguments = (ins TransformHandleTypeInterface:$target);
+ let results = (outs TransformHandleTypeInterface:$replacement);
let regions = (region SizedRegion<1>:$bodyRegion);
- let assemblyFormat = "$target attr-dict-with-keyword regions";
+ let assemblyFormat =
+ "$target attr-dict-with-keyword regions `:` "
+ "custom<SemiFunctionType>(type($target), type($replacement))";
let hasVerifier = 1;
}
This operation ignores non-Linalg ops and drops them in the return.
This operation produces `definiteFailure` if the scalarization fails for any
reason.
- If all the operations referred to by the `target` PDLOperation scalarize
+ If all the operations referred to by the `target` handle scalarize
properly, the transform succeeds. Otherwise the transform silently fails.
The return handle points to only the subset of successfully produced
needed.
}];
- let arguments = (ins PDL_Operation:$target);
- let results = (outs PDL_Operation:$result);
+ let arguments = (ins TransformHandleTypeInterface:$target);
+ let results = (outs TransformHandleTypeInterface:$result);
- let assemblyFormat = "$target attr-dict";
+ let assemblyFormat =
+ "$target attr-dict `:`"
+ "custom<SemiFunctionType>(type($target), type($result))";
let extraClassDeclaration = [{
::mlir::DiagnosedSilenceableFailure applyToOne(
#### Return modes
This operation ignores non-unsupported ops and drops them from the return.
- If all the operations referred to by the `target` PDLOperation generalize
+ If all the operations referred to by the `target` handle generalize
properly, the transform succeeds. Otherwise the transform silently fails.
The return handle points to a subset of successfully produced operations:
- - tensor.pad case, the returned handle points to the tensor.insert_slice.
- - tensor.generate case, the returned handle points to the linalg.generic.
- - tensor.from_elements case, the returned handle points to the last
- tensor.insert.
+ - `tensor.pad` case, the returned handle points to the tensor.insert_slice.
+ - `tensor.generate` case, the returned handle points to the linalg.generic.
+ - `tensor.from_elements` case, the returned handle points to the last
+ `tensor.insert`.
}];
let arguments = (ins TransformHandleTypeInterface:$target);
This operation produces `definiteFailure` if the splitting fails for any
reason.
- If all the operations referred to by the `target` PDLOperation split
+ If all the operations referred to by the `target` handle split
properly, the transform succeeds. Otherwise the transform silently fails.
The 4 returned handles points to only the subset of successfully produced
computational operations, which can all be empty.
```
}];
- let arguments = (ins PDL_Operation:$target,
+ let arguments = (ins TransformHandleTypeInterface:$target,
DefaultValuedAttr<I64Attr, "{}">:$split_factor,
DefaultValuedAttr<I64Attr, "{}">:$insert_split_dimension,
UnitAttr:$inner_parallel,
UnitAttr:$use_scaling_algorithm,
UnitAttr:$use_alloc);
- let results = (outs PDL_Operation:$init_or_alloc_op,
- PDL_Operation:$fill_op,
- PDL_Operation:$split_linalg_op,
- PDL_Operation:$combining_linalg_op);
+ let results = (outs TransformHandleTypeInterface:$init_or_alloc_op,
+ TransformHandleTypeInterface:$fill_op,
+ TransformHandleTypeInterface:$split_linalg_op,
+ TransformHandleTypeInterface:$combining_linalg_op);
- let assemblyFormat = "$target attr-dict";
+ let assemblyFormat =
+ "$target attr-dict `:`"
+ "functional-type(operands, results)";
let builders = [
OpBuilder<(ins "Value":$target,
}];
// TODO: support mixed static-dynamic (see TileToForallOp).
- let arguments = (ins PDL_Operation:$target,
+ let arguments = (ins TransformHandleTypeInterface:$target,
DefaultValuedAttr<DenseI64ArrayAttr, "{}">:$tile_sizes);
- let results = (outs PDL_Operation:$for_op,
- PDL_Operation:$fill_op,
- PDL_Operation:$split_linalg_op,
- PDL_Operation:$combining_linalg_op);
+ let results = (outs TransformHandleTypeInterface:$for_op,
+ TransformHandleTypeInterface:$fill_op,
+ TransformHandleTypeInterface:$split_linalg_op,
+ TransformHandleTypeInterface:$combining_linalg_op);
let builders = [
OpBuilder<(ins "Value":$target,
$target
`by` `tile_sizes` `=` $tile_sizes
attr-dict
+ `:` functional-type(operands, results)
}];
let extraClassDeclaration = [{
}];
// TODO: support mixed static-dynamic (see TileToForallOp).
- let arguments = (ins PDL_Operation:$target,
+ let arguments = (ins TransformHandleTypeInterface:$target,
DefaultValuedAttr<DenseI64ArrayAttr, "{}">:$num_threads,
DefaultValuedAttr<DenseI64ArrayAttr, "{}">:$tile_sizes,
OptionalAttr<DeviceMappingArrayAttr>:$mapping);
- let results = (outs PDL_Operation:$forall_op,
- PDL_Operation:$fill_op,
- PDL_Operation:$split_linalg_op,
- PDL_Operation:$combining_linalg_op);
+ let results = (outs TransformHandleTypeInterface:$forall_op,
+ TransformHandleTypeInterface:$fill_op,
+ TransformHandleTypeInterface:$split_linalg_op,
+ TransformHandleTypeInterface:$combining_linalg_op);
let builders = [
OpBuilder<(ins "Value":$target,
(`,` `tile_sizes` `=` $tile_sizes^)?
(`,` `mapping` `=` $mapping^)?
attr-dict
+ `:` functional-type(operands, results)
}];
let extraClassDeclaration = [{
This operation ignores ops that do not implement the TilingInterface and
drops them in the return.
- If all the operations referred to by the `target` PDLOperation tile
+ If all the operations referred to by the `target` handle tile
successfully, the transform succeeds.
Otherwise the transform silently fails.
```
}];
- let arguments = (ins PDL_Operation:$target,
- Variadic<PDL_Operation>:$num_threads,
- Variadic<PDL_Operation>:$tile_sizes,
- Optional<PDL_Operation>:$packed_num_threads,
- Optional<PDL_Operation>:$packed_tile_sizes,
+ let arguments = (ins TransformHandleTypeInterface:$target,
+ Variadic<TransformHandleTypeInterface>:$num_threads,
+ Variadic<TransformHandleTypeInterface>:$tile_sizes,
+ Optional<TransformHandleTypeInterface>:$packed_num_threads,
+ Optional<TransformHandleTypeInterface>:$packed_tile_sizes,
DefaultValuedOptionalAttr<DenseI64ArrayAttr, "{}">:$static_num_threads,
DefaultValuedOptionalAttr<DenseI64ArrayAttr, "{}">:$static_tile_sizes,
OptionalAttr<DeviceMappingArrayAttr>:$mapping);
- let results = (outs PDL_Operation:$forall_op,
- PDL_Operation:$tiled_op);
+ let results = (outs TransformHandleTypeInterface:$forall_op,
+ TransformHandleTypeInterface:$tiled_op);
let builders = [
OpBuilder<(ins "Value":$target,
let assemblyFormat = [{
$target oilist(
`num_threads` custom<PackedOrDynamicIndexList>($packed_num_threads,
+ type($packed_num_threads),
$num_threads,
+ type($num_threads),
$static_num_threads) |
`tile_sizes` custom<PackedOrDynamicIndexList>($packed_tile_sizes,
+ type($packed_tile_sizes),
$tile_sizes,
+ type($tile_sizes),
$static_tile_sizes))
(`(` `mapping` `=` $mapping^ `)`)? attr-dict
+ `:` functional-type($target, results)
}];
let hasVerifier = 1;
produces a definite failure.
}];
- let arguments = (ins PDL_Operation:$target,
- Variadic<PDL_Operation>:$dynamic_sizes,
+ let arguments = (ins TransformHandleTypeInterface:$target,
+ Variadic<TransformHandleTypeInterface>:$dynamic_sizes,
DefaultValuedOptionalAttr<DenseI64ArrayAttr, "{}">:$static_sizes,
DefaultValuedOptionalAttr<DenseI64ArrayAttr, "{}">:$interchange);
- let results = (outs PDL_Operation:$tiled_linalg_op,
- Variadic<PDL_Operation>:$loops);
+ let results = (outs TransformHandleTypeInterface:$tiled_linalg_op,
+ Variadic<TransformHandleTypeInterface>:$loops);
let builders = [
OpBuilder<(ins "Value":$target,
- `disable_transfer_permutation_map_lowering_patterns`: a UnitAttr to
deactivate the rewrite of `vector.transfer` with permutation maps into
explicit `vector.transpose` operations. This is intended to be used in
- tests only but may be promotoed to a first class attribute in the future.
+ tests only but may be promoted to a first class attribute in the future.
#### Return modes:
to be isolated from above.
}];
- 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 TransformHandleTypeInterface:$transformed);
- let assemblyFormat = "$target attr-dict";
+ let assemblyFormat =
+ "$target attr-dict `:`"
+ "functional-type(operands, results)";
let builders = [
OpBuilder<(ins "Value":$target,
#### Return modes:
This operation produces a definite failure if the dynamic vector sizes (SSA
- values) do not satify the constraints mentioned above. It produces a
+ values) do not satisfy the constraints mentioned above. It produces a
silenceable failure if at least one target op is not a Linalg op or fails to
vectorize.
}];
- let arguments = (ins PDL_Operation:$target,
- Variadic<PDL_Operation>:$vector_sizes,
+ let arguments = (ins TransformHandleTypeInterface:$target,
+ Variadic<TransformHandleTypeInterface>:$vector_sizes,
UnitAttr:$vectorize_nd_extract,
DefaultValuedOptionalAttr<DenseI64ArrayAttr, "{}">:
$static_vector_sizes);
let assemblyFormat = [{
$target
`vector_sizes` custom<DynamicIndexList>($vector_sizes,
- $static_vector_sizes)
+ $static_vector_sizes,
+ type($vector_sizes))
attr-dict
+ `:` type($target)
}];
let extraClassDeclaration = [{
--- /dev/null
+//===- Syntax.h - Custom syntax for Linalg transform ops --------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_DIALECT_LINALG_TRANSFORMOPS_SYNTAX_H
+#define MLIR_DIALECT_LINALG_TRANSFORMOPS_SYNTAX_H
+
+#include "mlir/Support/LLVM.h"
+
+namespace mlir {
+class ParseResult;
+class OpAsmParser;
+class OpAsmPrinter;
+class Type;
+class TypeRange;
+class Operation;
+
+/// Parses a single non-function type or a function type with at least one
+/// argument. This allows for the following syntax:
+///
+/// - type: just the argument type;
+/// - `(` type `)` `->` type: one argument and one result type;
+/// - `(` type `)` `->` `(` comma-separated-type-list `)`: one argument and
+/// multiple result types.
+///
+/// Unlike FunctionType, this allows and requires one to omit the parens around
+/// the argument type in absence of result types, and does not accept the
+/// trailing `-> ()` construct, which makes the syntax nicer for operations.
+ParseResult parseSemiFunctionType(OpAsmParser &parser, Type &argumentType,
+ Type &resultType);
+ParseResult parseSemiFunctionType(OpAsmParser &parser, Type &argumentType,
+ SmallVectorImpl<Type> &resultTypes);
+
+/// Prints argument and result types in a syntax similar to that of FunctionType
+/// but allowing and requiring one to omit the parens around the argument type
+/// in absence of result types, and without the trailing `-> ()`.
+void printSemiFunctionType(OpAsmPrinter &printer, Operation *op,
+ Type argumentType, TypeRange resultType);
+void printSemiFunctionType(OpAsmPrinter &printer, Operation *op,
+ Type argumentType, Type resultType);
+} // namespace mlir
+
+#endif // MLIR_DIALECT_LINALG_TRANSFORMOPS_SYNTAX_H
/// Printer hook for custom directive in assemblyFormat.
///
-/// custom<PackedOrDynamicIndexList>($packed, $values, $integers)
+/// custom<PackedOrDynamicIndexList>($packed, type($packed), $values,
+/// type($values), $integers)
///
/// where `values` are variadic Index values, `integers` is an `I64ArrayAttr`
/// and `packed` is a single transform dialect handle who's mapped payload ops
/// or the other two parameters may be specified.
///
/// This allows idiomatic printing of mixed value and integer attributes in a
-/// list or with a single handle. E.g., `[%arg0, 7, 42, %arg42]` or just `%h`.
+/// list or with a single handle. E.g., `[%arg0 : !transform.any_op, 7, 42,
+/// %arg42 : !transform.param<i64>]` or just `%h : !transform.any_op`.
void printPackedOrDynamicIndexList(OpAsmPrinter &printer, Operation *op,
- Value packed, OperandRange values,
+ Value packed, Type packedType,
+ OperandRange values, TypeRange valueTypes,
ArrayRef<int64_t> integers);
-/// Pasrer hook for custom directive in assemblyFormat.
+/// Parser hook for custom directive in assemblyFormat.
///
-/// custom<PackedOrDynamicIndexList>($packed, $values, $integers)
+/// custom<PackedOrDynamicIndexList>($packed, type($packed), $values,
+/// type($values), $integers)
///
/// See `printPackedOrDynamicIndexList` for details.
ParseResult parsePackedOrDynamicIndexList(
OpAsmParser &parser, std::optional<OpAsmParser::UnresolvedOperand> &packed,
- SmallVectorImpl<OpAsmParser::UnresolvedOperand> &values,
- DenseI64ArrayAttr &integers);
+ Type &packedType, SmallVectorImpl<OpAsmParser::UnresolvedOperand> &values,
+ SmallVectorImpl<Type> &valueTypes, DenseI64ArrayAttr &integers);
} // namespace transform
} // namespace mlir
/// Printer hook for custom directive in assemblyFormat.
///
/// custom<DynamicIndexList>($values, $integers)
+/// custom<DynamicIndexList>($values, $integers, type($values))
///
-/// where `values` is of ODS type `Variadic<Index>` and `integers` is of ODS
+/// where `values` is of ODS type `Variadic<*>` and `integers` is of ODS
/// type `I64ArrayAttr`. Prints a list with either (1) the static integer value
-/// in `integers` is `dynVal` or (2) the next value otherwise. This allows
-/// idiomatic printing of mixed value and integer attributes in a list. E.g.
-/// `[%arg0, 7, 42, %arg42]`.
+/// in `integers` is `kDynamic` or (2) the next value otherwise. If `valueTypes`
+/// is non-empty, it is expected to contain as many elements as `values`
+/// indicating their types. This allows idiomatic printing of mixed value and
+/// integer attributes in a list. E.g.
+/// `[%arg0 : index, 7, 42, %arg42 : i32]`.
void printDynamicIndexList(
OpAsmPrinter &printer, Operation *op, OperandRange values,
- ArrayRef<int64_t> integers,
+ ArrayRef<int64_t> integers, TypeRange valueTypes = TypeRange(),
AsmParser::Delimiter delimiter = AsmParser::Delimiter::Square);
-/// Pasrer hook for custom directive in assemblyFormat.
+/// Parser hook for custom directive in assemblyFormat.
///
/// custom<DynamicIndexList>($values, $integers)
+/// custom<DynamicIndexList>($values, $integers, type($values))
///
-/// where `values` is of ODS type `Variadic<Index>` and `integers` is of ODS
+/// where `values` is of ODS type `Variadic<*>` and `integers` is of ODS
/// type `I64ArrayAttr`. Parse a mixed list with either (1) static integer
/// values or (2) SSA values. Fill `integers` with the integer ArrayAttr, where
-/// `dynVal` encodes the position of SSA values. Add the parsed SSA values
-/// to `values` in-order.
-//
-/// E.g. after parsing "[%arg0, 7, 42, %arg42]":
-/// 1. `result` is filled with the i64 ArrayAttr "[`dynVal`, 7, 42, `dynVal`]"
+/// `kDynamic` encodes the position of SSA values. Add the parsed SSA values
+/// to `values` in-order. If `valueTypes` is non-null, fill it with types
+/// corresponding to values; otherwise the caller must handle the types.
+///
+/// E.g. after parsing "[%arg0 : index, 7, 42, %arg42 : i32]":
+/// 1. `result` is filled with the i64 ArrayAttr "[`kDynamic`, 7, 42,
+/// `kDynamic`]"
/// 2. `ssa` is filled with "[%arg0, %arg1]".
ParseResult parseDynamicIndexList(
OpAsmParser &parser,
SmallVectorImpl<OpAsmParser::UnresolvedOperand> &values,
- DenseI64ArrayAttr &integers,
+ DenseI64ArrayAttr &integers, SmallVectorImpl<Type> *valueTypes = nullptr,
AsmParser::Delimiter delimiter = AsmParser::Delimiter::Square);
+inline ParseResult parseDynamicIndexList(
+ OpAsmParser &parser,
+ SmallVectorImpl<OpAsmParser::UnresolvedOperand> &values,
+ DenseI64ArrayAttr &integers, SmallVectorImpl<Type> &valueTypes,
+ AsmParser::Delimiter delimiter = AsmParser::Delimiter::Square) {
+ return parseDynamicIndexList(parser, values, integers, &valueTypes,
+ delimiter);
+}
/// Verify that a the `values` has as many elements as the number of entries in
/// `attr` for which `isDynamic` evaluates to true.
DialectExtension.cpp
LinalgMatchOps.cpp
LinalgTransformOps.cpp
+ Syntax.cpp
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Linalg/TransformOps
MLIRLinalgDialect
MLIRLinalgTransforms
MLIRParser
- MLIRPDLDialect
MLIRSCFDialect
MLIRSideEffectInterfaces
MLIRTransformDialect
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/Linalg/TransformOps/LinalgMatchOps.h"
#include "mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.h"
-#include "mlir/Dialect/PDL/IR/PDL.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Dialect/Transform/IR/TransformDialect.h"
using Base::Base;
void init() {
- declareDependentDialect<pdl::PDLDialect>();
declareDependentDialect<linalg::LinalgDialect>();
declareGeneratedDialect<affine::AffineDialect>();
#include "mlir/Dialect/Linalg/TransformOps/LinalgMatchOps.h"
#include "mlir/Analysis/SliceAnalysis.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
+#include "mlir/Dialect/Linalg/TransformOps/Syntax.h"
#include "mlir/Dialect/Transform/IR/MatchInterfaces.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/FunctionImplementation.h"
printer << ")";
}
}
-/// Parses a single non-function type or a function type with at least one
-/// argument. This allows for the following syntax:
-///
-/// - type: just the argument type;
-/// - `(` type `)` `->` type: one argument and one result type;
-/// - `(` type `)` `->` `(` comma-separated-type-list `)`: one argument and
-/// multiple result types.
-///
-/// Unlike FunctionType, this allows and requires one to omit the parens around
-/// the argument type in absence of result types, and does not accept the
-/// trailing `-> ()` construct, which makes the syntax nicer for operations.
-static ParseResult parseSemiFunctionType(OpAsmParser &parser,
- Type &argumentType, Type &resultType) {
- argumentType = resultType = nullptr;
- bool hasLParen = parser.parseOptionalLParen().succeeded();
- if (parser.parseType(argumentType).failed())
- return failure();
- if (!hasLParen)
- return success();
-
- return failure(parser.parseRParen().failed() ||
- parser.parseArrow().failed() ||
- parser.parseType(resultType).failed());
-}
-static ParseResult parseSemiFunctionType(OpAsmParser &parser,
- Type &argumentType,
- SmallVectorImpl<Type> &resultTypes) {
- argumentType = nullptr;
- bool hasLParen = parser.parseOptionalLParen().succeeded();
- if (parser.parseType(argumentType).failed())
- return failure();
- if (!hasLParen)
- return success();
-
- if (parser.parseRParen().failed() || parser.parseArrow().failed())
- return failure();
-
- if (parser.parseOptionalLParen().failed()) {
- Type type;
- if (parser.parseType(type).failed())
- return failure();
- resultTypes.push_back(type);
- return success();
- }
- if (parser.parseTypeList(resultTypes).failed() ||
- parser.parseRParen().failed()) {
- resultTypes.clear();
- return failure();
- }
- return success();
-}
-
-/// Prints argument and result types in a syntax similar to that of FunctionType
-/// but allowing and requiring one to omit the parens around the argument type
-/// in absence of result types, and without the trailing `-> ()`.
-static void printSemiFunctionType(OpAsmPrinter &printer, Operation *op,
- Type argumentType, TypeRange resultType) {
- if (!resultType.empty())
- printer << "(";
- printer << argumentType;
- if (resultType.empty())
- return;
- printer << ") -> ";
-
- if (resultType.size() > 1)
- printer << "(";
- llvm::interleaveComma(resultType, printer.getStream());
- if (resultType.size() > 1)
- printer << ")";
-}
-static void printSemiFunctionType(OpAsmPrinter &printer, Operation *op,
- Type argumentType, Type resultType) {
- return printSemiFunctionType(printer, op, argumentType,
- resultType ? TypeRange(resultType)
- : TypeRange());
-}
#define GET_OP_CLASSES
#include "mlir/Dialect/Linalg/TransformOps/LinalgMatchOps.cpp.inc"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/GPU/IR/GPUDialect.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
+#include "mlir/Dialect/Linalg/TransformOps/Syntax.h"
#include "mlir/Dialect/Linalg/Transforms/Hoisting.h"
#include "mlir/Dialect/Linalg/Transforms/Transforms.h"
#include "mlir/Dialect/Linalg/Utils/Utils.h"
-#include "mlir/Dialect/PDL/IR/PDL.h"
-#include "mlir/Dialect/PDL/IR/PDLTypes.h"
#include "mlir/Dialect/SCF/Transforms/TileUsingInterface.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Dialect/Tensor/Utils/Utils.h"
/// Assuming that `ofr` is an index attr or a transform dialect handle mapped
/// to exactly one op with one index result, return that value.
-static DiagnosedSilenceableFailure unpackSingleIndexResultPDLOperations(
+static DiagnosedSilenceableFailure unpackSingleIndexResultPayloadOperations(
transform::TransformState &state, TransformOpInterface transformOp,
SmallVector<OpFoldResult> &result, ArrayRef<OpFoldResult> ofrs) {
for (OpFoldResult ofr : ofrs) {
// replaced with the first (and only) OpResult of that payload op. (There
// must be exactly one mapped payload op and it must have exactly one
// index result.)
-static DiagnosedSilenceableFailure unpackSingleIndexResultPDLOperations(
+static DiagnosedSilenceableFailure unpackSingleIndexResultPayloadOperations(
transform::TransformState &state, TransformOpInterface transformOp,
SmallVector<OpFoldResult> &result, Value packedHandle) {
for (Operation *op : state.getPayloadOps(packedHandle)) {
return success();
}
-/// Parse a tiling-like operation that returns the tiled op as well as the
-/// created tile loops. The function counts the non-zero tile sizes to compute
-/// the number of results.
-static ParseResult parseTileLikeOp(OpAsmParser &parser, OperationState &result,
- StringRef sizesAttrName) {
- OpAsmParser::UnresolvedOperand targetOperand;
- SMLoc opLoc = parser.getCurrentLocation();
- if (parser.parseOperand(targetOperand) ||
- parser.parseOptionalAttrDict(result.attributes))
- return failure();
- Attribute sizesAttr = result.attributes.get(sizesAttrName);
- if (!sizesAttr)
- return parser.emitError(opLoc)
- << "expected '" << sizesAttrName << "' attribute";
- auto sizesArrayAttr = dyn_cast<ArrayAttr>(sizesAttr);
- if (!sizesArrayAttr)
- return parser.emitError(opLoc)
- << "'" << sizesAttrName << "' attribute must be an array";
- Type pdlOpType = parser.getBuilder().getType<pdl::OperationType>();
- size_t numExpectedLoops =
- sizesArrayAttr.size() -
- llvm::count(extractFromI64ArrayAttr(sizesArrayAttr), 0);
- result.addTypes(SmallVector<Type>(numExpectedLoops + 1, pdlOpType));
- if (parser.resolveOperand(targetOperand, pdlOpType, result.operands))
- return failure();
- return success();
-}
-
DiagnosedSilenceableFailure
transform::FuseOp::apply(mlir::transform::TransformResults &transformResults,
mlir::transform::TransformState &state) {
ParseResult transform::FuseOp::parse(OpAsmParser &parser,
OperationState &result) {
- return parseTileLikeOp(
- parser, result,
- transform::FuseOp::getTileSizesAttrName(result.name).getValue());
+ OpAsmParser::UnresolvedOperand targetOperand;
+ if (parser.parseOperand(targetOperand) ||
+ parser.parseOptionalAttrDict(result.attributes))
+ return failure();
+
+ FunctionType trailingType;
+ SMLoc typeLoc;
+ if (parser.getCurrentLocation(&typeLoc) ||
+ parser.parseColonType(trailingType)) {
+ return failure();
+ }
+ if (trailingType.getNumInputs() != 1)
+ return parser.emitError(typeLoc) << "expected one input type";
+
+ result.addTypes(trailingType.getResults());
+ if (parser.resolveOperand(targetOperand, trailingType.getInput(0),
+ result.operands))
+ return failure();
+ return success();
}
void transform::FuseOp::print(OpAsmPrinter &p) {
p << ' ';
p << getTarget();
p.printOptionalAttrDict((*this)->getAttrs());
+ p << " : ";
+ p.printFunctionalType(TypeRange(getOperand().getType()),
+ getResults().getTypes());
}
LogicalResult transform::FuseOp::verify() {
return emitOpError() << "expects interchange to be a permutation, found "
<< getTileInterchange();
}
+
+ SmallVector<int64_t> sizes = extractFromI64ArrayAttr(getTileSizes());
+ size_t numExpectedLoops = sizes.size() - llvm::count(sizes, 0);
+ if (numExpectedLoops != getNumResults() - 1)
+ return emitOpError() << "expects " << numExpectedLoops << " loop results";
+
return success();
}
Value producerOp,
Value containingOp) {
result.addOperands({producerOp, containingOp});
- result.addTypes(pdl::OperationType::get(builder.getContext()));
+ result.addTypes(transform::AnyOpType::get(builder.getContext()));
}
/// Find the first "extract" user of `producerOp` and tile it right before its
result.addOperands(target);
result.addAttribute(MatchOp::getOpsAttrName(result.name),
builder.getStrArrayAttr(opNames));
- result.addTypes(pdl::OperationType::get(builder.getContext()));
+ result.addTypes(transform::AnyOpType::get(builder.getContext()));
}
void transform::MatchOp::build(OpBuilder &builder, OperationState &result,
// Unpack handles to constants or actual SSA index values.
SmallVector<OpFoldResult> packedSizes;
- DiagnosedSilenceableFailure status = unpackSingleIndexResultPDLOperations(
+ DiagnosedSilenceableFailure status = unpackSingleIndexResultPayloadOperations(
state, *this, packedSizes, getMixedPackedSizes());
TrackingListener listener(state, *this);
result.addAttribute(SplitReductionOp::getUseAllocAttrName(result.name),
builder.getUnitAttr());
}
- auto resultType = pdl::OperationType::get(ctx);
+ auto resultType = transform::AnyOpType::get(ctx);
result.addTypes({resultType, resultType, resultType, resultType});
}
// In the absence of this, horrible bugs ensue.
// TODO: support mixed static-dynamic (see TileToForallOp).
MLIRContext *ctx = builder.getContext();
- auto opTy = pdl::OperationType::get(ctx);
+ auto opTy = transform::AnyOpType::get(ctx);
auto staticTileSizesAttr = builder.getDenseI64ArrayAttr(staticTileSizes);
build(builder, result,
/*resultTypes=*/TypeRange{opTy, opTy, opTy, opTy},
// In the absence of this, horrible bugs ensue.
// TODO: support mixed static-dynamic (see TileToForallOp).
MLIRContext *ctx = builder.getContext();
- auto opTy = pdl::OperationType::get(ctx);
+ auto opTy = transform::AnyOpType::get(ctx);
auto staticNumThreadsAttr = builder.getDenseI64ArrayAttr(staticNumThreads);
auto staticTileSizesAttr = builder.getDenseI64ArrayAttr(staticTileSizes);
build(builder, result,
// attributes for multiple variadic operands. In the absence of this,
// horrible bugs ensue.
MLIRContext *ctx = builder.getContext();
- auto operationType = pdl::OperationType::get(ctx);
+ auto operationType = transform::AnyOpType::get(ctx);
auto staticTileSizesAttr = builder.getDenseI64ArrayAttr(staticTileSizes);
build(builder, result,
/*resultTypes=*/TypeRange{operationType, operationType},
// attributes for multiple variadic operands. In the absence of this,
// horrible bugs ensue.
MLIRContext *ctx = builder.getContext();
- auto operationType = pdl::OperationType::get(ctx);
+ auto operationType = transform::AnyOpType::get(ctx);
auto staticNumThreadsAttr = builder.getDenseI64ArrayAttr(staticNumThreads);
build(builder, result,
/*resultTypes=*/TypeRange{operationType, operationType},
SmallVector<OpFoldResult> mixedNumThreads;
DiagnosedSilenceableFailure status =
getPackedNumThreads()
- ? unpackSingleIndexResultPDLOperations(
+ ? unpackSingleIndexResultPayloadOperations(
state, transformOp, mixedNumThreads, getPackedNumThreads())
- : unpackSingleIndexResultPDLOperations(
+ : unpackSingleIndexResultPayloadOperations(
state, transformOp, mixedNumThreads, getMixedNumThreads());
if (!status.succeeded())
return status;
SmallVector<OpFoldResult> mixedTileSizes;
status = getPackedTileSizes()
- ? unpackSingleIndexResultPDLOperations(
+ ? unpackSingleIndexResultPayloadOperations(
state, transformOp, mixedTileSizes, getPackedTileSizes())
- : unpackSingleIndexResultPDLOperations(
+ : unpackSingleIndexResultPayloadOperations(
state, transformOp, mixedTileSizes, getMixedTileSizes());
if (!status.succeeded())
return status;
auto staticTileSizesAttr = builder.getDenseI64ArrayAttr(staticTileSizes);
int64_t numExpectedLoops =
staticTileSizes.size() - llvm::count(staticTileSizes, 0);
- SmallVector<Type> resultTypes(numExpectedLoops,
- pdl::OperationType::get(builder.getContext()));
+ SmallVector<Type> resultTypes(
+ numExpectedLoops, transform::AnyOpType::get(builder.getContext()));
build(builder, result,
/*tiled_linalg_op=*/target.getType(),
/*loops=*/resultTypes,
OpAsmParser::UnresolvedOperand target;
SmallVector<OpAsmParser::UnresolvedOperand> dynamicSizes;
DenseI64ArrayAttr staticSizes;
- auto pdlOperationType = pdl::OperationType::get(parser.getContext());
+ FunctionType trailingType;
+ llvm::SMLoc typeLoc;
if (parser.parseOperand(target) ||
- parser.resolveOperand(target, pdlOperationType, result.operands) ||
parseDynamicIndexList(parser, dynamicSizes, staticSizes) ||
- parser.resolveOperands(dynamicSizes, pdlOperationType, result.operands))
+ parseOptionalInterchange(parser, result) ||
+ parser.parseOptionalAttrDict(result.attributes) ||
+ parser.getCurrentLocation(&typeLoc) ||
+ parser.parseColonType(trailingType)) {
return ParseResult::failure();
+ }
- // Parse optional interchange.
- if (failed(parseOptionalInterchange(parser, result)))
- return ParseResult::failure();
result.addAttribute(getStaticSizesAttrName(result.name), staticSizes);
size_t numExpectedLoops =
staticSizes.size() - llvm::count(staticSizes.asArrayRef(), 0);
- result.addTypes(SmallVector<Type>(numExpectedLoops + 1, pdlOperationType));
+
+ unsigned numExpectedInputTypes = 1 + dynamicSizes.size();
+ if (trailingType.getNumInputs() != numExpectedInputTypes) {
+ return parser.emitError(typeLoc)
+ << "expected " << numExpectedInputTypes << " operand types, got "
+ << trailingType.getNumInputs();
+ }
+
+ unsigned numExpectedOutputTypes = 1 + numExpectedLoops;
+ if (trailingType.getNumResults() != numExpectedOutputTypes) {
+ return parser.emitError(typeLoc)
+ << "expected " << numExpectedOutputTypes << " result types, got "
+ << trailingType.getNumResults();
+ }
+
+ if (parser.resolveOperand(target, trailingType.getInput(0),
+ result.operands) ||
+ parser.resolveOperands(dynamicSizes,
+ trailingType.getInputs().drop_front(), typeLoc,
+ result.operands) ||
+ parser.addTypesToList(trailingType.getResults(), result.types)) {
+ return failure();
+ }
return success();
}
p << ' ' << getTarget();
printDynamicIndexList(p, getOperation(), getDynamicSizes(), getStaticSizes());
printOptionalInterchange(p, getInterchange());
+ p.printOptionalAttrDict(getOperation()->getAttrs(), getAttributeNames());
+ p << " : ";
+ p.printFunctionalType(getOperation());
}
void transform::TileToScfForOp::getEffects(
result.addAttribute(VectorizeOp::getVectorizeNdExtractAttrName(result.name),
builder.getUnitAttr());
}
- result.addTypes(pdl::OperationType::get(builder.getContext()));
+ result.addTypes(transform::AnyOpType::get(builder.getContext()));
}
namespace {
--- /dev/null
+//===- Syntax.cpp - Custom syntax for Linalg transform ops ----------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Dialect/Linalg/TransformOps/Syntax.h"
+#include "mlir/IR/OpImplementation.h"
+
+using namespace mlir;
+
+ParseResult mlir::parseSemiFunctionType(OpAsmParser &parser, Type &argumentType,
+ Type &resultType) {
+ argumentType = resultType = nullptr;
+ bool hasLParen = parser.parseOptionalLParen().succeeded();
+ if (parser.parseType(argumentType).failed())
+ return failure();
+ if (!hasLParen)
+ return success();
+
+ return failure(parser.parseRParen().failed() ||
+ parser.parseArrow().failed() ||
+ parser.parseType(resultType).failed());
+}
+
+ParseResult mlir::parseSemiFunctionType(OpAsmParser &parser, Type &argumentType,
+ SmallVectorImpl<Type> &resultTypes) {
+ argumentType = nullptr;
+ bool hasLParen = parser.parseOptionalLParen().succeeded();
+ if (parser.parseType(argumentType).failed())
+ return failure();
+ if (!hasLParen)
+ return success();
+
+ if (parser.parseRParen().failed() || parser.parseArrow().failed())
+ return failure();
+
+ if (parser.parseOptionalLParen().failed()) {
+ Type type;
+ if (parser.parseType(type).failed())
+ return failure();
+ resultTypes.push_back(type);
+ return success();
+ }
+ if (parser.parseTypeList(resultTypes).failed() ||
+ parser.parseRParen().failed()) {
+ resultTypes.clear();
+ return failure();
+ }
+ return success();
+}
+
+void mlir::printSemiFunctionType(OpAsmPrinter &printer, Operation *op,
+ Type argumentType, TypeRange resultType) {
+ if (!resultType.empty())
+ printer << "(";
+ printer << argumentType;
+ if (resultType.empty())
+ return;
+ printer << ") -> ";
+
+ if (resultType.size() > 1)
+ printer << "(";
+ llvm::interleaveComma(resultType, printer.getStream());
+ if (resultType.size() > 1)
+ printer << ")";
+}
+
+void mlir::printSemiFunctionType(OpAsmPrinter &printer, Operation *op,
+ Type argumentType, Type resultType) {
+ return printSemiFunctionType(printer, op, argumentType,
+ resultType ? TypeRange(resultType)
+ : TypeRange());
+}
if (isNormalized()) {
p << ") in ";
printDynamicIndexList(p, op, getDynamicUpperBound(), getStaticUpperBound(),
- OpAsmParser::Delimiter::Paren);
+ /*valueTypes=*/{}, OpAsmParser::Delimiter::Paren);
} else {
p << ") = ";
printDynamicIndexList(p, op, getDynamicLowerBound(), getStaticLowerBound(),
- OpAsmParser::Delimiter::Paren);
+ /*valueTypes=*/{}, OpAsmParser::Delimiter::Paren);
p << " to ";
printDynamicIndexList(p, op, getDynamicUpperBound(), getStaticUpperBound(),
- OpAsmParser::Delimiter::Paren);
+ /*valueTypes=*/{}, OpAsmParser::Delimiter::Paren);
p << " step ";
printDynamicIndexList(p, op, getDynamicStep(), getStaticStep(),
- OpAsmParser::Delimiter::Paren);
+ /*valueTypes=*/{}, OpAsmParser::Delimiter::Paren);
}
printInitializationList(p, getRegionOutArgs(), getOutputs(), " shared_outs");
p << " ";
if (succeeded(parser.parseOptionalKeyword("in"))) {
// Parse upper bounds.
if (parseDynamicIndexList(parser, dynamicUbs, staticUbs,
+ /*valueTypes=*/nullptr,
OpAsmParser::Delimiter::Paren) ||
parser.resolveOperands(dynamicUbs, indexType, result.operands))
return failure();
// Parse lower bounds.
if (parser.parseEqual() ||
parseDynamicIndexList(parser, dynamicLbs, staticLbs,
+ /*valueTypes=*/nullptr,
OpAsmParser::Delimiter::Paren) ||
parser.resolveOperands(dynamicLbs, indexType, result.operands))
// Parse upper bounds.
if (parser.parseKeyword("to") ||
parseDynamicIndexList(parser, dynamicUbs, staticUbs,
+ /*valueTypes=*/nullptr,
OpAsmParser::Delimiter::Paren) ||
parser.resolveOperands(dynamicUbs, indexType, result.operands))
return failure();
// Parse step values.
if (parser.parseKeyword("step") ||
parseDynamicIndexList(parser, dynamicSteps, staticSteps,
+ /*valueTypes=*/nullptr,
OpAsmParser::Delimiter::Paren) ||
parser.resolveOperands(dynamicSteps, indexType, result.operands))
return failure();
using namespace mlir::transform;
void mlir::transform::printPackedOrDynamicIndexList(
- OpAsmPrinter &printer, Operation *op, Value packed, OperandRange values,
- ArrayRef<int64_t> integers) {
+ OpAsmPrinter &printer, Operation *op, Value packed, Type packedType,
+ OperandRange values, TypeRange valueTypes, ArrayRef<int64_t> integers) {
if (packed) {
assert(values.empty() && integers.empty() && "expected no values/integers");
- printer << packed;
+ printer << "*(" << packed << " : " << packedType << ")";
return;
}
- printDynamicIndexList(printer, op, values, integers);
+ printDynamicIndexList(printer, op, values, integers, valueTypes);
}
ParseResult mlir::transform::parsePackedOrDynamicIndexList(
OpAsmParser &parser, std::optional<OpAsmParser::UnresolvedOperand> &packed,
- SmallVectorImpl<OpAsmParser::UnresolvedOperand> &values,
- DenseI64ArrayAttr &integers) {
+ Type &packedType, SmallVectorImpl<OpAsmParser::UnresolvedOperand> &values,
+ SmallVectorImpl<Type> &valueTypes, DenseI64ArrayAttr &integers) {
OpAsmParser::UnresolvedOperand packedOperand;
- if (parser.parseOptionalOperand(packedOperand).has_value()) {
+ if (parser.parseOptionalStar().succeeded()) {
+ if (parser.parseLParen().failed() ||
+ parser.parseOperand(packedOperand).failed() ||
+ parser.parseColonType(packedType).failed() ||
+ parser.parseRParen().failed()) {
+ return failure();
+ }
packed.emplace(packedOperand);
integers = parser.getBuilder().getDenseI64ArrayAttr({});
return success();
}
- return parseDynamicIndexList(parser, values, integers);
+
+ return parseDynamicIndexList(parser, values, integers, &valueTypes);
}
void mlir::printDynamicIndexList(OpAsmPrinter &printer, Operation *op,
OperandRange values,
ArrayRef<int64_t> integers,
+ TypeRange valueTypes,
AsmParser::Delimiter delimiter) {
char leftDelimiter = getLeftDelimiter(delimiter);
char rightDelimiter = getRightDelimiter(delimiter);
}
unsigned idx = 0;
llvm::interleaveComma(integers, printer, [&](int64_t integer) {
- if (ShapedType::isDynamic(integer))
- printer << values[idx++];
- else
+ if (ShapedType::isDynamic(integer)) {
+ printer << values[idx];
+ if (!valueTypes.empty())
+ printer << " : " << valueTypes[idx];
+ ++idx;
+ } else {
printer << integer;
+ }
});
printer << rightDelimiter;
}
ParseResult mlir::parseDynamicIndexList(
OpAsmParser &parser,
SmallVectorImpl<OpAsmParser::UnresolvedOperand> &values,
- DenseI64ArrayAttr &integers, AsmParser::Delimiter delimiter) {
+ DenseI64ArrayAttr &integers, SmallVectorImpl<Type> *valueTypes,
+ AsmParser::Delimiter delimiter) {
SmallVector<int64_t, 4> integerVals;
auto parseIntegerOrValue = [&]() {
if (res.has_value() && succeeded(res.value())) {
values.push_back(operand);
integerVals.push_back(ShapedType::kDynamic);
+ if (valueTypes && parser.parseColonType(valueTypes->emplace_back()))
+ return failure();
} else {
int64_t integer;
if (failed(parser.parseInteger(integer)))
}
transform.sequence failures(propagate) {
-^bb1(%arg0: !pdl.operation):
- %matmul = transform.structured.match ops{["linalg.matmul"]} in %arg0 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg0: !transform.any_op):
+ %matmul = transform.structured.match ops{["linalg.matmul"]} in %arg0 : (!transform.any_op) -> !transform.any_op
%forall, %tiled = transform.structured.tile_to_forall_op %matmul num_threads [10, 20, 30] (mapping = [ #gpu.thread<y>, #gpu.thread<x>, #gpu.thread<z> ] )
- %funcop = transform.structured.match ops{["gpu.launch"]} in %arg0 : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
+ %funcop = transform.structured.match ops{["gpu.launch"]} in %arg0 : (!transform.any_op) -> !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]
}
}
transform.sequence failures(propagate) {
-^bb1(%arg0: !pdl.operation):
- %matmul = transform.structured.match ops{["linalg.generic"]} in %arg0 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg0: !transform.any_op):
+ %matmul = transform.structured.match ops{["linalg.generic"]} in %arg0 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{transform.structured.tile_to_forall_op failed to apply}}
%forall, %tiled = transform.structured.tile_to_forall_op %matmul num_threads [10, 20, 30] (mapping = [ #gpu.thread<y>, #gpu.thread<x>, #gpu.thread<z> ] )
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !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
+^bb1(%module_op: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %module_op : (!transform.any_op) -> !transform.any_op
+ %1, %loops:3 = transform.structured.tile %0 [2, 2, 2] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
+ %2 = get_closest_isolated_parent %1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.vectorize %2 : (!transform.any_op) -> !transform.any_op
%b = transform.bufferization.one_shot_bufferize layout{IdentityLayoutMap}
%module_op {bufferize_function_boundaries = true}
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
%f = transform.structured.match ops{["func.func"]} in %b
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
// TODO: group these lower-level controls into various properly named vector
// lowering TD macros.
%func = transform.vector.lower_contraction %f
- lowering_strategy = "outerproduct"
- : (!pdl.operation) -> !pdl.operation
+ lowering_strategy = "outerproduct"
+ : (!transform.any_op) -> !transform.any_op
%func_2 = transform.vector.apply_transfer_permutation_patterns %func
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
%func_3 = transform.vector.lower_multi_reduction %func_2
lowering_strategy = "innerparallel"
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
%func_4 = transform.vector.split_transfer_full_partial %func_3
split_transfer_strategy = "linalg-copy"
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
%func_5 = transform.vector.transfer_to_scf %func_4
max_transfer_rank = 1 full_unroll = true
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
%func_6 = transform.vector.lower_transfer %func_5
max_transfer_rank = 1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
%func_7 = transform.vector.lower_shape_cast %func_6
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
%func_8 = transform.vector.lower_transpose %func_7
lowering_strategy = "shuffle_1d"
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
}
// CHECK: %{{.+}} = tensor.insert_slice %[[TRANSP]] into %{{.+}}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:4 = transform.structured.tile_to_scf_for %0 [1, 1, 1, 1]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:4 = transform.structured.tile_to_scf_for %0 [1, 1, 1, 1] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
// CHECK: %{{.+}} = tensor.insert_slice %[[TRANSP]] into %{{.+}}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:2 = transform.structured.tile_to_scf_for %0 [1, 1]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:2 = transform.structured.tile_to_scf_for %0 [1, 1] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
// CHECK: %{{.+}} = tensor.insert_slice %[[SUB_ITER]] into %{{[a-zA-Z0-9]+}}
// CHECK-SAME: [%[[C]], %[[K]], 0, 0] [1, 1, 32, 8] [1, 1, 1, 1] : tensor<1x1x32x8xf32> into tensor<32x4x32x8xf32>
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:2 = transform.structured.tile_to_scf_for %0 [1, 1]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:2 = transform.structured.tile_to_scf_for %0 [1, 1] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:4 = transform.structured.tile_to_scf_for %0 [1, 1, 32, 8]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:4 = transform.structured.tile_to_scf_for %0 [1, 1, 32, 8] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// CHECK-DAG: #[[MAP0:.+]] = affine_map<(d0) -> (d0 floordiv 32)>
// CHECK-DAG: #[[MAP1:.+]] = affine_map<(d0) -> (d0 floordiv 8)>
// CHECK-SAME: [%[[I]], %[[J]]] [%[[OUT_I_SZ]], %[[OUT_J_SZ]]] [1, 1]
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:2 = transform.structured.tile_to_scf_for %0 [8, 2]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:2 = transform.structured.tile_to_scf_for %0 [8, 2] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:2 = transform.structured.tile_to_scf_for %0 [32, 8]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:2 = transform.structured.tile_to_scf_for %0 [32, 8] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// CHECK-NOT: memref.dealloc %[[tmpC]] : memref<24xi8>
transform.sequence failures(propagate) {
-^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.promote %0 { use_alloca }
+^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.promote %0 { use_alloca } : (!transform.any_op) -> !transform.any_op
}
// -----
// CHECK: memref.dealloc %[[tmpC_f64]] : memref<48xi8>
transform.sequence failures(propagate) {
-^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.promote %0
+^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.promote %0 : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:3 = transform.structured.tile %0 [16, 16, 16] : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
- %2 = transform.structured.promote %1 { operands_to_promote = [0, 1], mapping = [#gpu.memory_space<workgroup>] }
+^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:3 = transform.structured.tile %0 [16, 16, 16] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
+ %2 = transform.structured.promote %1 { operands_to_promote = [0, 1], mapping = [#gpu.memory_space<workgroup>] } : (!transform.any_op) -> !transform.any_op
}
transform.sequence failures(propagate) {
-^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:3 = transform.structured.tile %0 [16, 16, 16] : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
- %2 = transform.structured.promote %1 { operands_to_promote = [0, 1], mapping = [#gpu.memory_space<private>] }
+^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:3 = transform.structured.tile %0 [16, 16, 16] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
+ %2 = transform.structured.promote %1 { operands_to_promote = [0, 1], mapping = [#gpu.memory_space<private>] } : (!transform.any_op) -> !transform.any_op
}
}
transform.sequence failures(propagate) {
-^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match interface{LinalgOp} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.promote %0
+^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match interface{LinalgOp} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.promote %0 : (!transform.any_op) -> !transform.any_op
}
// CHECK: memref.dealloc %[[tmpC]]
transform.sequence failures(propagate) {
-^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:3 = transform.structured.tile %0 [16, 16, 16] : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
- %2 = transform.structured.promote %1 { operands_to_promote = [0, 2], force_full_tiles = [false, false], use_full_tiles_by_default }
+^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:3 = transform.structured.tile %0 [16, 16, 16] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
+ %2 = transform.structured.promote %1 { operands_to_promote = [0, 2], force_full_tiles = [false, false], use_full_tiles_by_default } : (!transform.any_op) -> !transform.any_op
}
}
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1:2 = transform.structured.tile_to_forall_op %0 num_threads [10, 20] (mapping = [ #gpu.thread<y>, #gpu.thread<x> ] )
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %sz = transform.structured.match ops{["test.dummy"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1:2 = transform.structured.tile_to_forall_op %0 tile_sizes %sz
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %sz = transform.structured.match ops{["test.dummy"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1:2 = transform.structured.tile_to_forall_op %0 tile_sizes *(%sz : !transform.any_op)
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1:2 = transform.structured.tile_to_forall_op %0 num_threads [10, 21]
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1:2 = transform.structured.tile_to_forall_op %0 tile_sizes [10, 20]
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1:2 = transform.structured.tile_to_forall_op %0 tile_sizes [10, 21]
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1:2 = transform.structured.tile_to_forall_op %0 num_threads [2] ( mapping = [#gpu.thread<x>])
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
}
// CHECK-DAG: #[[$map0:.+]] = affine_map<(d0) -> (d0 * 2)>
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %sz = transform.structured.match ops{["test.dummy"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1:2 = transform.structured.tile_to_forall_op %0 tile_sizes [%sz, 20]
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %sz = transform.structured.match ops{["test.dummy"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1:2 = transform.structured.tile_to_forall_op %0 tile_sizes [%sz : !transform.any_op, 20]
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%forall, %tiled_generic = transform.structured.tile_to_forall_op %0 num_threads [7]
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb1(%IN_MAT2: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %IN_MAT2 : (!pdl.operation) -> !pdl.operation
+ ^bb1(%IN_MAT2: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %IN_MAT2 : (!transform.any_op) -> !transform.any_op
%forall, %tiled_generic = transform.structured.tile_to_forall_op %0 num_threads [4]
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match interface{LinalgOp} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.decompose %0
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match interface{LinalgOp} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.decompose %0 : (!transform.any_op) -> !transform.any_op
}
func.func @dummy3() { return }
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.match ops{["scf.forall"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!transform.any_op) -> !transform.op<"linalg.fill">
+ %1 = transform.structured.match ops{["scf.forall"]} in %arg1 : (!transform.any_op) -> !transform.op<"scf.forall">
// linalg.fill is tileable. The op is tiled and fused.
transform.structured.fuse_into_containing_op %0 into %1
+ : (!transform.op<"linalg.fill">, !transform.op<"scf.forall">) -> !transform.any_op
}
}
}
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.empty"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.match ops{["scf.forall"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.empty"]} in %arg1 : (!transform.any_op) -> !transform.op<"tensor.empty">
+ %1 = transform.structured.match ops{["scf.forall"]} in %arg1 : (!transform.any_op) -> !transform.op<"scf.forall">
// tensor.empty is not tileable. The op is cloned and fused.
transform.structured.fuse_into_containing_op %0 into %1
+ : (!transform.op<"tensor.empty">, !transform.op<"scf.forall">) -> !transform.any_op
}
}
}
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.match ops{["scf.forall"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!transform.any_op) -> !transform.op<"linalg.fill">
+ %1 = transform.structured.match ops{["scf.forall"]} in %arg1 : (!transform.any_op) -> !transform.op<"scf.forall">
// linalg.fill is tileable. The op is tiled and fused.
transform.structured.fuse_into_containing_op %0 into %1
+ : (!transform.op<"linalg.fill">, !transform.op<"scf.forall">) -> !transform.any_op
}
}
}
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.match ops{["scf.forall"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.match ops{["scf.forall"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// linalg.fill is tileable. The op is tiled and fused.
transform.structured.fuse_into_containing_op %0 into %1
+ : (!transform.any_op, !transform.any_op) -> !transform.any_op
}
}
}
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.match ops{["scf.forall"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.op<"linalg.generic">
+ %1 = transform.structured.match ops{["scf.forall"]} in %arg1 : (!transform.any_op) -> !transform.op<"scf.forall">
// linalg.generic is tileable. The op is tiled and fused.
transform.structured.fuse_into_containing_op %0 into %1
+ : (!transform.op<"linalg.generic">, !transform.op<"scf.forall">) -> !transform.any_op
}
}
transform.sequence failures(propagate) {
^bb1(%arg1: !transform.any_op):
- %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!transform.any_op) -> !pdl.operation
- %1 = transform.structured.match ops{["scf.forall"]} in %arg1 : (!transform.any_op) -> !pdl.operation
+ %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.match ops{["scf.forall"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// Create a new handle that points to `linalg.fill` twice.
- %2 = transform.merge_handles %0, %0 : !pdl.operation
+ %2 = transform.merge_handles %0, %0 : !transform.any_op
// It shouldn't be a problem to fuse this handle.
- transform.structured.fuse_into_containing_op %2 into %1
+ transform.structured.fuse_into_containing_op %2 into %1 : (!transform.any_op, !transform.any_op) -> !transform.any_op
}
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.elemwise_binary"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.elemwise_binary"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1, %loops:2 = transform.structured.fuse %0 {tile_sizes = [32, 32], tile_interchange = [0, 1]}
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.elemwise_binary"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.elemwise_binary"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1, %loops:2 = transform.structured.fuse %0 {tile_sizes = [32, 32], tile_interchange = [0, 1]}
- %loop = transform.cast %loops#0 : !pdl.operation to !transform.op<"scf.for">
- transform.loop.peel %loop : (!transform.op<"scf.for">) -> !pdl.operation
+ : (!transform.any_op) -> (!transform.any_op, !transform.op<"scf.for">, !transform.any_op)
+ transform.loop.peel %loops#0 : (!transform.op<"scf.for">) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1, %loops:2 = transform.structured.fuse %0 {tile_sizes = [5, 0, 7], tile_interchange = [0, 2, 1]}
- %2, %loops_2 = transform.structured.tile %1 [0, 4] : (!pdl.operation) -> (!pdl.operation, !pdl.operation)
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
+ %2, %loops_2 = transform.structured.tile %1 [0, 4]
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.elemwise_unary"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.elemwise_unary"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1, %loops:2 = transform.structured.fuse %0 {tile_sizes = [16, 32], tile_interchange = [0, 1]}
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
func.return %reduce : tensor<16x64xf32>
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match interface{LinalgOp} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.generalize %0
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match interface{LinalgOp} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.generalize %0 : (!transform.any_op) -> !transform.any_op
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%matmul = transform.structured.match ops{["linalg.matmul"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
- %matmul_l1, %loops_l1 = transform.structured.tile_to_scf_for %matmul [5]
+ %matmul_l1, %loops_l1 = transform.structured.tile_to_scf_for %matmul [5] : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
%matmul_padded = transform.structured.pad %matmul_l1 {
padding_values=[0.0: f32, 0.0 : f32, 0.0 : f32],
padding_dimensions=[0, 1, 2]
- }
+ } : (!transform.any_op) -> !transform.any_op
// In this case, the pad op is actually empty: we only tile the first dimension
// and it does not have an impact on the RHS operand.
%pad = transform.get_producer_of_operand %matmul_padded[1]
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
// expected-error @below {{requires exactly 2 non-null handles}}
transform.structured.hoist_pad.build_packing_loop_nest %pad above %loops_l1
- : (!pdl.operation, !pdl.operation) -> !pdl.operation
+ : (!transform.any_op, !transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%matmul = transform.structured.match ops{["linalg.matmul"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
- %matmul_l1, %loops_l1 = transform.structured.tile_to_scf_for %matmul [5]
+ %matmul_l1, %loops_l1 = transform.structured.tile_to_scf_for %matmul [5] : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
%matmul_padded = transform.structured.pad %matmul_l1 {
padding_values=[0.0: f32, 0.0 : f32, 0.0 : f32],
padding_dimensions=[0, 1, 2]
- }
+ } : (!transform.any_op) -> !transform.any_op
%pad = transform.get_producer_of_operand %matmul_padded[2]
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
// We do not know yet how to hoist the init.
// expected-error @below {{could not build packing loop nest}}
transform.structured.hoist_pad.build_packing_loop_nest %pad above %loops_l1
- : (!pdl.operation, !pdl.operation) -> !pdl.operation
+ : (!transform.any_op, !transform.any_op) -> !transform.any_op
}
// -----
// BUILD-PACKING-LOOP-NEST: %[[PACKED:.*]] = scf.for %{{.*}} -> (tensor<?x5x12xf32>) {
// BUILD-PACKING-LOOP-NEST: tensor.pad %{{.*}}
// BUILD-PACKING-LOOP-NEST: : tensor<?x12xf32> to tensor<5x12xf32>
- // BUILD-PACKING-LOOP-NEST: tensor.insert_slice %{{.*}} into %{{.*}}[%{{.*}}, 0, 0] [1, 5, 12] [1, 1, 1]
+ // BUILD-PACKING-LOOP-NEST: tensor.insert_slice %{{.*}} into %{{.*}}[%{{.*}}, 0, 0] [1, 5, 12] [1, 1, 1]
// BUILD-PACKING-LOOP-NEST-SAME: : tensor<5x12xf32> into tensor<?x5x12xf32>
// BUILD-PACKING-LOOP-NEST: scf.for %{{.*}} -> (tensor<24x25xf32>)
%0 = linalg.matmul ins(%arg0, %arg1 : tensor<24x12xf32>, tensor<12x25xf32>) outs(%arg2 : tensor<24x25xf32>) -> tensor<24x25xf32>
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%matmul = transform.structured.match ops{["linalg.matmul"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
- %matmul_l1, %loops_l1 = transform.structured.tile_to_scf_for %matmul [5]
+ %matmul_l1, %loops_l1 = transform.structured.tile_to_scf_for %matmul [5] : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
%matmul_padded = transform.structured.pad %matmul_l1 {
padding_values=[0.0: f32, 0.0 : f32, 0.0 : f32],
padding_dimensions=[0, 1, 2]
- }
+ } : (!transform.any_op) -> !transform.any_op
%pad = transform.get_producer_of_operand %matmul_padded[0]
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.hoist_pad.build_packing_loop_nest %pad above %loops_l1
- : (!pdl.operation, !pdl.operation) -> !pdl.operation
+ : (!transform.any_op, !transform.any_op) -> !transform.any_op
}
// -----
-> tensor<24x25xf32>
{
// BUILD-PACKING-LOOP-NEST: %[[PACKED:.*]] = scf.for %{{.*}} -> (tensor<?x12x5xf32>) {
- // BUILD-PACKING-LOOP-NEST: tensor.pad %{{.*}}
+ // BUILD-PACKING-LOOP-NEST: tensor.pad %{{.*}}
// BUILD-PACKING-LOOP-NEST: : tensor<?x12xf32> to tensor<5x12xf32>
// BUILD-PACKING-LOOP-NEST: linalg.generic
// BUILD-PACKING-LOOP-NEST: -> tensor<12x5xf32>
- // BUILD-PACKING-LOOP-NEST: tensor.insert_slice %{{.*}} into %{{.*}}[%{{.*}}, 0, 0] [1, 12, 5] [1, 1, 1]
+ // BUILD-PACKING-LOOP-NEST: tensor.insert_slice %{{.*}} into %{{.*}}[%{{.*}}, 0, 0] [1, 12, 5] [1, 1, 1]
// BUILD-PACKING-LOOP-NEST-SAME: : tensor<12x5xf32> into tensor<?x12x5xf32>
// BUILD-PACKING-LOOP-NEST: scf.for %{{.*}} -> (tensor<24x25xf32>)
%0 = linalg.matmul ins(%arg0, %arg1 : tensor<24x12xf32>, tensor<12x25xf32>) outs(%arg2 : tensor<24x25xf32>) -> tensor<24x25xf32>
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%matmul = transform.structured.match ops{["linalg.matmul"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
- %matmul_l1, %loops_l1 = transform.structured.tile_to_scf_for %matmul [5]
+ %matmul_l1, %loops_l1 = transform.structured.tile_to_scf_for %matmul [5] : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
%matmul_padded = transform.structured.pad %matmul_l1 {
padding_values=[0.0: f32, 0.0 : f32, 0.0 : f32],
padding_dimensions=[0, 1, 2]
- }
+ } : (!transform.any_op) -> !transform.any_op
%pad = transform.get_producer_of_operand %matmul_padded[0]
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.hoist_pad.build_packing_loop_nest %pad above %loops_l1, transpose by [1, 0]
- : (!pdl.operation, !pdl.operation) -> !pdl.operation
+ : (!transform.any_op, !transform.any_op) -> !transform.any_op
}
// -----
// BUILD-PACKING-LOOP-NEST: scf.for %{{.*}} -> (tensor<24x25xf32>) {
// BUILD-PACKING-LOOP-NEST: %[[EXTRACTED_SLICE:.*]] = tensor.extract_slice
- // BUILD-PACKING-LOOP-NEST: %[[PADDED:.*]] = tensor.pad %[[EXTRACTED_SLICE]]
+ // BUILD-PACKING-LOOP-NEST: %[[PADDED:.*]] = tensor.pad %[[EXTRACTED_SLICE]]
// BUILD-PACKING-LOOP-NEST: : tensor<?x25xf32> to tensor<5x25xf32>
// BUILD-PACKING-LOOP-NEST: scf.for %{{.*}} iter_args({{.*}} = %[[EXTRACTED_SLICE]]) -> (tensor<24x25xf32>, tensor<?x25xf32>) {
%0 = linalg.matmul ins(%arg0, %arg1 : tensor<24x12xf32>, tensor<12x25xf32>) outs(%arg2 : tensor<24x25xf32>) -> tensor<24x25xf32>
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%matmul = transform.structured.match ops{["linalg.matmul"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
- %matmul_l1, %loops_l1:2 = transform.structured.tile_to_scf_for %matmul [5, 0, 7]
+ %matmul_l1, %loops_l1:2 = transform.structured.tile_to_scf_for %matmul [5, 0, 7] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
%matmul_padded = transform.structured.pad %matmul_l1 {
padding_values=[0.0: f32, 0.0 : f32, 0.0 : f32],
padding_dimensions=[0, 1, 2]
- }
+ } : (!transform.any_op) -> !transform.any_op
%pad = transform.get_producer_of_operand %matmul_padded[2]
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.hoist_pad.build_packing_loop_nest %pad above %loops_l1#1
- : (!pdl.operation, !pdl.operation) -> !pdl.operation
+ : (!transform.any_op, !transform.any_op) -> !transform.any_op
}
func.func @pad_and_hoist_rhs(
%arg0: tensor<24x12xf32>, %arg1: tensor<12x25xf32>, %arg2: tensor<24x25xf32>)
- -> tensor<24x25xf32>
+ -> tensor<24x25xf32>
{
// expected-note @below {{payload operation}}
%0 = linalg.matmul ins(%arg0, %arg1 : tensor<24x12xf32>, tensor<12x25xf32>) outs(%arg2 : tensor<24x25xf32>) -> tensor<24x25xf32>
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %matmul = transform.structured.match ops{["linalg.matmul"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %matmul = transform.structured.match ops{["linalg.matmul"]} in %arg1
+ : (!transform.any_op) -> !transform.any_op
-
- %matmul_l1, %loops_l1 = transform.structured.tile_to_scf_for %matmul [5]
+
+ %matmul_l1, %loops_l1 = transform.structured.tile_to_scf_for %matmul [5] : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
%matmul_padded = transform.structured.pad %matmul_l1 {
padding_values=[0.0: f32, 0.0 : f32, 0.0 : f32],
padding_dimensions=[0, 1, 2]
- }
+ } : (!transform.any_op) -> !transform.any_op
// In this case, the pad op is actually empty: we only tile the first dimension
// and it does not have an impact on the RHS operand.
// expected-error @below {{incompatible payload operation name}}
%pad = transform.get_producer_of_operand %matmul_padded[1]
- : (!pdl.operation) -> !transform.op<"tensor.pad">
+ : (!transform.any_op) -> !transform.op<"tensor.pad">
// We do not even reach this transform op.
transform.structured.hoist_pad %pad by 1 loops
- : (!transform.op<"tensor.pad">) -> !pdl.operation
+ : (!transform.op<"tensor.pad">) -> !transform.any_op
}
// -----
func.func @pad_and_hoist_init(
%arg0: tensor<24x12xf32>, %arg1: tensor<12x25xf32>, %arg2: tensor<24x25xf32>)
- -> tensor<24x25xf32>
+ -> tensor<24x25xf32>
{
// expected-note @below {{when applied to this op}}
%0 = linalg.matmul ins(%arg0, %arg1 : tensor<24x12xf32>, tensor<12x25xf32>) outs(%arg2 : tensor<24x25xf32>) -> tensor<24x25xf32>
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %matmul = transform.structured.match ops{["linalg.matmul"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %matmul = transform.structured.match ops{["linalg.matmul"]} in %arg1
+ : (!transform.any_op) -> !transform.any_op
+
-
- %matmul_l1, %loops_l1 = transform.structured.tile_to_scf_for %matmul [5]
+ %matmul_l1, %loops_l1 = transform.structured.tile_to_scf_for %matmul [5] : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
%matmul_padded = transform.structured.pad %matmul_l1 {
padding_values=[0.0: f32, 0.0 : f32, 0.0 : f32],
padding_dimensions=[0, 1, 2]
- }
+ } : (!transform.any_op) -> !transform.any_op
%pad = transform.get_producer_of_operand %matmul_padded[2]
- : (!pdl.operation) -> !transform.op<"tensor.pad">
+ : (!transform.any_op) -> !transform.op<"tensor.pad">
// We do not know yet how to hoist the init.
// expected-error @below {{transform.structured.hoist_pad failed to apply}}
transform.structured.hoist_pad %pad by 1 loops
- : (!transform.op<"tensor.pad">) -> !pdl.operation
+ : (!transform.op<"tensor.pad">) -> !transform.any_op
}
// -----
// CHECK-LABEL: pad_and_hoist_lhs(
func.func @pad_and_hoist_lhs(
%arg0: tensor<24x12xf32>, %arg1: tensor<12x25xf32>, %arg2: tensor<24x25xf32>)
- -> tensor<24x25xf32>
+ -> tensor<24x25xf32>
{
// CHECK: %[[PACKED:.*]] = scf.for %{{.*}} -> (tensor<5x5x12xf32>) {
- // CHECK: tensor.pad %{{.*}}
+ // CHECK: tensor.pad %{{.*}}
// CHECK: : tensor<?x12xf32> to tensor<5x12xf32>
- // CHECK: tensor.insert_slice %{{.*}} into %{{.*}}[%{{.*}}, 0, 0] [1, 5, 12] [1, 1, 1]
+ // CHECK: tensor.insert_slice %{{.*}} into %{{.*}}[%{{.*}}, 0, 0] [1, 5, 12] [1, 1, 1]
// CHECK-SAME: : tensor<5x12xf32> into tensor<5x5x12xf32>
// CHECK: scf.for %{{.*}} -> (tensor<24x25xf32>) {
- // CHECK: %[[PADDED:.*]] = tensor.extract_slice %[[PACKED]][%{{.*}}, 0, 0] [1, 5, 12] [1, 1, 1]
+ // CHECK: %[[PADDED:.*]] = tensor.extract_slice %[[PACKED]][%{{.*}}, 0, 0] [1, 5, 12] [1, 1, 1]
// CHECK-SAME: : tensor<5x5x12xf32> to tensor<5x12xf32>
// CHECK: linalg.matmul ins(%[[PADDED]]
%0 = linalg.matmul ins(%arg0, %arg1 : tensor<24x12xf32>, tensor<12x25xf32>) outs(%arg2 : tensor<24x25xf32>) -> tensor<24x25xf32>
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %matmul = transform.structured.match ops{["linalg.matmul"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %matmul = transform.structured.match ops{["linalg.matmul"]} in %arg1
+ : (!transform.any_op) -> !transform.any_op
+
-
- %matmul_l1, %loops_l1 = transform.structured.tile_to_scf_for %matmul [5]
+ %matmul_l1, %loops_l1 = transform.structured.tile_to_scf_for %matmul [5] : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
%matmul_padded = transform.structured.pad %matmul_l1 {
padding_values=[0.0: f32, 0.0 : f32, 0.0 : f32],
padding_dimensions=[0, 1, 2]
- }
+ } : (!transform.any_op) -> !transform.any_op
%pad = transform.get_producer_of_operand %matmul_padded[0]
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.hoist_pad %pad by 1 loops
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
}
// -----
// CHECK-LABEL: pad_and_hoist_lhs_transpose
func.func @pad_and_hoist_lhs_transpose(
%arg0: tensor<24x12xf32>, %arg1: tensor<12x25xf32>, %arg2: tensor<24x25xf32>)
- -> tensor<24x25xf32>
+ -> tensor<24x25xf32>
{
// CHECK: %[[PACKED:.*]] = scf.for %{{.*}} -> (tensor<5x12x5xf32>) {
- // CHECK: tensor.pad %{{.*}}
+ // CHECK: tensor.pad %{{.*}}
// CHECK: : tensor<?x12xf32> to tensor<5x12xf32>
// CHECK: linalg.generic
// CHECK: -> tensor<12x5xf32>
- // CHECK: tensor.insert_slice %{{.*}} into %{{.*}}[%{{.*}}, 0, 0] [1, 12, 5] [1, 1, 1]
+ // CHECK: tensor.insert_slice %{{.*}} into %{{.*}}[%{{.*}}, 0, 0] [1, 12, 5] [1, 1, 1]
// CHECK-SAME: : tensor<12x5xf32> into tensor<5x12x5xf32>
// CHECK: scf.for %{{.*}} -> (tensor<24x25xf32>) {
- // CHECK: %[[PADDED:.*]] = tensor.extract_slice %[[PACKED]][%{{.*}}, 0, 0] [1, 12, 5] [1, 1, 1]
+ // CHECK: %[[PADDED:.*]] = tensor.extract_slice %[[PACKED]][%{{.*}}, 0, 0] [1, 12, 5] [1, 1, 1]
// CHECK-SAME: : tensor<5x12x5xf32> to tensor<12x5xf32>
// CHECK: %[[TRANSPOSED:.*]] = linalg.generic
// CHECK: -> tensor<5x12xf32>
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %matmul = transform.structured.match ops{["linalg.matmul"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %matmul = transform.structured.match ops{["linalg.matmul"]} in %arg1
+ : (!transform.any_op) -> !transform.any_op
-
- %matmul_l1, %loops_l1 = transform.structured.tile_to_scf_for %matmul [5]
+
+ %matmul_l1, %loops_l1 = transform.structured.tile_to_scf_for %matmul [5] : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
%matmul_padded = transform.structured.pad %matmul_l1 {
padding_values=[0.0: f32, 0.0 : f32, 0.0 : f32],
padding_dimensions=[0, 1, 2]
- }
+ } : (!transform.any_op) -> !transform.any_op
%pad = transform.get_producer_of_operand %matmul_padded[0]
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
transform.structured.hoist_pad %pad by 1 loops, transpose by [1, 0]
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
}
// -----
// CHECK-LABEL: pad_and_hoist_init
func.func @pad_and_hoist_init(
%arg0: tensor<24x12xf32>, %arg1: tensor<12x25xf32>, %arg2: tensor<24x25xf32>)
- -> tensor<24x25xf32>
+ -> tensor<24x25xf32>
{
// CHECK: scf.for %{{.*}} -> (tensor<24x25xf32>) {
- // CHECK: %[[PADDED:.*]] = tensor.pad %{{.*}}
+ // CHECK: %[[PADDED:.*]] = tensor.pad %{{.*}}
// CHECK: : tensor<?x25xf32> to tensor<5x25xf32>
// CHECK: %[[SCF_YIELD:.*]] = scf.for %{{.*}} iter_args(%[[INNER_PADDED:[0-9a-zA-Z]*]] = %[[PADDED]]) -> (tensor<5x25xf32>)
// CHECK: %[[RES:.*]] = linalg.matmul {{.*}} outs(%[[INNER_PADDED]]
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %matmul = transform.structured.match ops{["linalg.matmul"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %matmul = transform.structured.match ops{["linalg.matmul"]} in %arg1
+ : (!transform.any_op) -> !transform.any_op
+
-
- %matmul_l1, %loops_l1:2 = transform.structured.tile_to_scf_for %matmul [5, 0, 7]
+ %matmul_l1, %loops_l1:2 = transform.structured.tile_to_scf_for %matmul [5, 0, 7] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
%matmul_padded = transform.structured.pad %matmul_l1 {
padding_values=[0.0: f32, 0.0 : f32, 0.0 : f32],
padding_dimensions=[0, 1, 2]
- }
+ } : (!transform.any_op) -> !transform.any_op
%pad = transform.get_producer_of_operand %matmul_padded[2]
- : (!pdl.operation) -> !transform.op<"tensor.pad">
+ : (!transform.any_op) -> !transform.op<"tensor.pad">
transform.structured.hoist_pad %pad by 1 loops
- : (!transform.op<"tensor.pad">) -> !pdl.operation
+ : (!transform.op<"tensor.pad">) -> !transform.any_op
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.interchange %0 iterator_interchange = [1, 0]
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.interchange %0 iterator_interchange = [1, 0] : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{transform applied to the wrong op kind}}
- transform.structured.interchange %0 iterator_interchange = [1, 0]
+ transform.structured.interchange %0 iterator_interchange = [1, 0] : (!transform.any_op) -> !transform.any_op
}
// CHECK: }
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
- transform.vector.lower_contraction %2 lowering_strategy = "outerproduct" : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %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.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
transform.structured.pack %0 packed_sizes = [0, 4]
- : (!pdl.operation) -> (!transform.op<"linalg.generic">)
+ : (!transform.any_op) -> (!transform.op<"linalg.generic">)
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1 = transform.structured.pack %0 packed_sizes = [4, 0]
- : (!pdl.operation) -> (!transform.op<"linalg.generic">)
+ : (!transform.any_op) -> (!transform.op<"linalg.generic">)
%pack = transform.get_producer_of_operand %1[0]
: (!transform.op<"linalg.generic">) -> (!transform.op<"tensor.pack">)
%2, %pack_2, %empty_unpack_2 =
transform.structured.pack_transpose %pack with_compute_op(%1)
outer_perm = [1, 0]
: (!transform.op<"tensor.pack">, !transform.op<"linalg.generic">)
- -> (!transform.op<"linalg.generic">, !transform.op<"tensor.pack">, !pdl.operation)
+ -> (!transform.op<"linalg.generic">, !transform.op<"tensor.pack">, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
transform.structured.pack %0 packed_sizes = [0, 4]
- : (!pdl.operation) -> (!transform.op<"linalg.generic">)
+ : (!transform.any_op) -> (!transform.op<"linalg.generic">)
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
transform.structured.pack %0 packed_sizes = [3, 4]
- : (!pdl.operation) -> (!transform.op<"linalg.generic">)
+ : (!transform.any_op) -> (!transform.op<"linalg.generic">)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// M N K
%1 = transform.structured.pack %0 packed_sizes = [2, 3, 4]
- : (!pdl.operation) -> (!transform.op<"linalg.generic">)
+ : (!transform.any_op) -> (!transform.op<"linalg.generic">)
%unpack = transform.get_consumers_of_result %1[0]
: (!transform.op<"linalg.generic">) -> (!transform.op<"tensor.unpack">)
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match interface{LinalgOp} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match interface{LinalgOp} in %arg1 : (!transform.any_op) -> !transform.any_op
// N F H W C KH KW
%1 = transform.structured.pack %0 packed_sizes = [0, 4, 0, 0, 8, 0, 0]
- : (!pdl.operation) -> (!transform.op<"linalg.generic">)
+ : (!transform.any_op) -> (!transform.op<"linalg.generic">)
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match interface{LinalgOp} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match interface{LinalgOp} in %arg1 : (!transform.any_op) -> !transform.any_op
// N H W F KH KW C
%1 = transform.structured.pack %0 packed_sizes = [0, 0, 0, 4, 0, 0, 6]
- : (!pdl.operation) -> (!transform.op<"linalg.generic">)
+ : (!transform.any_op) -> (!transform.op<"linalg.generic">)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %sz = transform.structured.match ops{["some_tile_size"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.pack %0 packed_sizes = [0, %sz, %sz]
- : (!pdl.operation) -> (!transform.op<"linalg.generic">)
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %sz = transform.structured.match ops{["some_tile_size"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.pack %0 packed_sizes = [0, %sz : !transform.any_op, %sz : !transform.any_op]
+ : (!transform.any_op) -> (!transform.op<"linalg.generic">)
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match interface{LinalgOp} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match interface{LinalgOp} in %arg1 : (!transform.any_op) -> !transform.any_op
// N F H W C KH KW
// expected-error @below {{data tiling failed}}
%1 = transform.structured.pack %0 packed_sizes = [0, 0, 4, 0, 0, 0, 0]
- : (!pdl.operation) -> (!transform.op<"linalg.generic">)
+ : (!transform.any_op) -> (!transform.op<"linalg.generic">)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{requires target to map to exactly 1 LinalgOp (got 2)}}
%1 = transform.structured.pack %0 packed_sizes = [2, 3, 4]
- : (!pdl.operation) -> (!transform.op<"linalg.generic">)
+ : (!transform.any_op) -> (!transform.op<"linalg.generic">)
}
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{requires number of packed sizes match the number of loops (2 vs 3)}}
%1 = transform.structured.pack %0 packed_sizes = [2, 3]
- : (!pdl.operation) -> (!transform.op<"linalg.generic">)
+ : (!transform.any_op) -> (!transform.op<"linalg.generic">)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{requires target to map to exactly 1 packing op and 1 packed op (got 2 and 1)}}
transform.structured.pack_transpose %0 with_compute_op(%1)
inner_perm = [0]
- : (!pdl.operation, !pdl.operation)
- -> (!pdl.operation, !pdl.operation, !pdl.operation)
+ : (!transform.any_op, !transform.any_op)
+ -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["arith.constant"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.match ops{["tensor.empty"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["arith.constant"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.match ops{["tensor.empty"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{requires target to map to a tensor.pack or tensor.unpack}}
transform.structured.pack_transpose %0 with_compute_op(%1)
inner_perm = [0]
- : (!pdl.operation, !pdl.operation)
- -> (!pdl.operation, !pdl.operation, !pdl.operation)
+ : (!transform.any_op, !transform.any_op)
+ -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.match ops{["arith.constant"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.match ops{["arith.constant"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{requires a LinalgOp target}}
transform.structured.pack_transpose %0 with_compute_op(%1)
inner_perm = [0]
- : (!pdl.operation, !pdl.operation)
- -> (!pdl.operation, !pdl.operation, !pdl.operation)
+ : (!transform.any_op, !transform.any_op)
+ -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{not a single use by the LinalgOp target}}
transform.structured.pack_transpose %0 with_compute_op(%1)
inner_perm = [0]
- : (!pdl.operation, !pdl.operation)
- -> (!pdl.operation, !pdl.operation, !pdl.operation)
+ : (!transform.any_op, !transform.any_op)
+ -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{not produced by the LinalgOp target}}
transform.structured.pack_transpose %0 with_compute_op(%1)
inner_perm = [0]
- : (!pdl.operation, !pdl.operation)
- -> (!pdl.operation, !pdl.operation, !pdl.operation)
+ : (!transform.any_op, !transform.any_op)
+ -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{could not find matching pack op}}
transform.structured.pack_transpose %0 with_compute_op(%1)
inner_perm = [0]
- : (!pdl.operation, !pdl.operation)
- -> (!pdl.operation, !pdl.operation, !pdl.operation)
+ : (!transform.any_op, !transform.any_op)
+ -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1 = transform.structured.pack %0 packed_sizes = [2, 3, 4]
- : (!pdl.operation) -> (!transform.op<"linalg.generic">)
+ : (!transform.any_op) -> (!transform.op<"linalg.generic">)
%unpack = transform.get_consumers_of_result %1[0]
: (!transform.op<"linalg.generic">) -> (!transform.op<"tensor.unpack">)
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1 = transform.structured.pack %0 packed_sizes = [2, 3, 4]
- : (!pdl.operation) -> (!transform.op<"linalg.generic">)
+ : (!transform.any_op) -> (!transform.op<"linalg.generic">)
%unpack = transform.get_consumers_of_result %1[0]
: (!transform.op<"linalg.generic">) -> (!transform.op<"tensor.unpack">)
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1 = transform.structured.pad %0 {
- padding_values=[0.0 : f32, 0.0 : f32, 0.0 : f32],
- padding_dimensions=[0, 1, 2],
+ padding_values=[0.0 : f32, 0.0 : f32, 0.0 : f32],
+ padding_dimensions=[0, 1, 2],
pack_paddings=[1, 1, 0]
- }
+ } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1 = transform.structured.pad %0 {
padding_values=[0.0 : f32, 0.0 : f32, 0.0 : f32],
padding_dimensions=[0, 1, 2],
pack_paddings=[1, 1, 0]
- }
+ } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{op expects a padding value of type 'f32', got 0 : i32}}
%1 = transform.structured.pad %0 {
padding_values=[0: i32, 0.0 : f32, 0.0 : f32],
padding_dimensions=[0, 1, 2],
pack_paddings=[1, 1, 0]
- }
+ } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{expects a padding that parses to 'f32', got "{foo}"}}
%1 = transform.structured.pad %0 {
padding_values=["{foo}", 0.0 : f32, 0.0 : f32],
padding_dimensions=[0, 1, 2],
pack_paddings=[1, 1, 0]
- }
+ } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(suppress) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// This error is silenceable and is not reported by this transform
// {{transform.structured.pad failed to apply}}
%1 = transform.structured.pad %0 {
padding_values=[0.0 : f32, 0.0 : f32, 0.0 : f32],
padding_dimensions=[0, 1, 2],
pack_paddings=[1, 1, 0]
- }
+ } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1 = transform.structured.pad %0 {
padding_values=[0.0 : f32, 0.0 : f32, 0.0 : f32],
padding_dimensions=[0, 1, 2],
pack_paddings=[1, 1, 1]
- }
+ } : (!transform.any_op) -> !transform.any_op
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["func.func"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["func.func"]} in %arg1 : (!transform.any_op) -> !transform.any_op
transform.structured.replace %0 {
func.func @foo() {
"dummy_op"() : () -> ()
}
- }
+ } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["another_op"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["another_op"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @+1 {{expected target without operands}}
transform.structured.replace %0 {
"dummy_op"() : () -> ()
- }
+ } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["another_op"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["another_op"]} in %arg1 : (!transform.any_op) -> !transform.any_op
transform.structured.replace %0 {
^bb0(%a: i1):
// expected-error @+1 {{expected replacement without operands}}
"dummy_op"(%a) : (i1) -> ()
- }
+ } : (!transform.any_op) -> !transform.any_op
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops = transform.structured.tile %0 [10, 0, 0] : (!pdl.operation) -> (!pdl.operation, !pdl.operation)
- %2 = transform.structured.scalarize %1
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops = transform.structured.tile %0 [10, 0, 0] : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
+ %2 = transform.structured.scalarize %1 : (!transform.any_op) -> !transform.any_op
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1:4 = transform.structured.split_reduction %0
{ split_factor = 4, insert_split_dimension = 2, use_scaling_algorithm, use_alloc}
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// CHECK: return %[[R]] : tensor<16x32xf32>
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1:4 = transform.structured.split_reduction %0 { split_factor = 4, insert_split_dimension = 2}
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
// CHECK: return %[[R]] : tensor<f32>
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1:4 = transform.structured.split_reduction %0 { split_factor = 4, insert_split_dimension = 0}
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
// CHECK: return %[[R]] : tensor<5x2xf32>
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1:4 = transform.structured.split_reduction %0 { split_factor = 4, insert_split_dimension = 2}
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
// CHECK: return %[[R]] : tensor<16x32xf32>
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1:4 = transform.structured.split_reduction %0 { split_factor = 4, insert_split_dimension = 2, inner_parallel}
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
// CHECK: return %[[R]] : tensor<f32>
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1:4 = transform.structured.split_reduction %0 { split_factor = 4, insert_split_dimension = 0, inner_parallel}
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
// CHECK: return %[[R]] : tensor<5x2xf32>
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%1:4 = transform.structured.split_reduction %0 { split_factor = 4, insert_split_dimension = 2, inner_parallel}
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// CHECK-LABEL: tile_tensor_pad
func.func @tile_tensor_pad(
- %arg0 : tensor<?x?xf32>, %cst : f32, %low: index, %high: index)
+ %arg0 : tensor<?x?xf32>, %cst : f32, %low: index, %high: index)
-> tensor<20x40xf32>
{
// CHECK: scf.forall
// CHECK: scf.if
// CHECK: tensor.generate
// CHECK: else
- // CHECK: tensor.pad {{.*}} nofold
+ // CHECK: tensor.pad {{.*}} nofold
%0 = tensor.pad %arg0 nofold low[%low, %low] high[%high, %high] {
^bb0(%arg9: index, %arg10: index):
tensor.yield %cst : f32
}
transform.sequence failures(propagate) {
-^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!transform.any_op) -> !transform.any_op
transform.structured.tile_to_forall_op %0 tile_sizes[1, 1]
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %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.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %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.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 {vectorize_padding}
+^bb1(%arg1: !transform.any_op):
+ %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 {vectorize_padding} : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{op requires isolated-from-above targets}}
- %2 = transform.structured.vectorize %0
+ %2 = transform.structured.vectorize %0 : (!transform.any_op) -> !transform.any_op
}
// RUN: mlir-opt %s --split-input-file --verify-diagnostics
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-error@below {{'transform.structured.interchange' op expects iterator_interchange to be a permutation, found 1, 1}}
- transform.structured.interchange %arg0 iterator_interchange = [1, 1]
+ transform.structured.interchange %arg0 iterator_interchange = [1, 1] : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-error@below {{expects padding_dimensions to contain positive integers, found [1, -7]}}
- transform.structured.pad %arg0 {padding_dimensions=[1, -7]}
+ transform.structured.pad %arg0 {padding_dimensions=[1, -7]} : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-error@below {{expects pack_paddings to contain booleans (0/1), found [1, 7]}}
- transform.structured.pad %arg0 {pack_paddings=[1, 7]}
+ transform.structured.pad %arg0 {pack_paddings=[1, 7]} : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-error@below {{expects transpose_paddings to be a permutation, found [1, 1]}}
- transform.structured.pad %arg0 {transpose_paddings=[[1, 1]]}
+ transform.structured.pad %arg0 {transpose_paddings=[[1, 1]]} : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-error@below {{'transform.structured.interchange' op attribute 'iterator_interchange' failed to satisfy constraint: i64 dense array attribute whose value is non-negative}}
- transform.structured.interchange %arg0 iterator_interchange = [-3, 1]
+ transform.structured.interchange %arg0 iterator_interchange = [-3, 1] : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-error@below {{expects all results type to be the same}}
"transform.structured.multitile_sizes"(%arg0) { target_size = 3, divisor = 2, dimension = 0 }
- : (!pdl.operation) -> (!transform.param<i64>, !transform.param<i64>, !transform.param<i32>)
+ : (!transform.any_op) -> (!transform.param<i64>, !transform.param<i64>, !transform.param<i32>)
}
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-error@below {{not a valid permutation}}
transform.structured.pack_greedily %arg0
- matmul_packed_sizes = [8, 0, 32]
+ matmul_packed_sizes = [8, 0, 32]
matmul_inner_dims_order = [1, 1, 0]
- : (!pdl.operation) -> !transform.op<"linalg.generic">
+ : (!transform.any_op) -> !transform.op<"linalg.generic">
}
// -----
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// expected-error@below {{at most one of the packed_size and the padded_sizes_next_multiple_of can be nonzero}}
transform.structured.pack_greedily %arg0
- matmul_packed_sizes = [1, 1, 1]
- matmul_padded_sizes_next_multiple_of = [1, 1, 1]
+ matmul_packed_sizes = [1, 1, 1]
+ matmul_padded_sizes_next_multiple_of = [1, 1, 1]
matmul_inner_dims_order = [0, 1, 2]
- : (!pdl.operation) -> !transform.op<"linalg.generic">
+ : (!transform.any_op) -> !transform.op<"linalg.generic">
}
+
+// -----
+
+transform.sequence failures(propagate) {
+^bb0(%arg0: !transform.any_op):
+ // expected-error @below {{expected 4 result types, got 2}}
+ transform.structured.tile_to_scf_for %arg0 [1, 2, 3] : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
+}
+
+// -----
+
+transform.sequence failures(propagate) {
+^bb0(%arg0: !transform.any_op, %arg1: !transform.any_op):
+ // expected-error @below {{expected 2 operand types, got 1}}
+ transform.structured.tile_to_scf_for %arg0 [%arg1] : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
+}
// RUN: mlir-opt %s | mlir-opt | FileCheck %s
transform.sequence failures(propagate) {
-^bb1(%arg0: !pdl.operation):
+^bb1(%arg0: !transform.any_op):
// CHECK %{{.*}}, %{{.*}}:2 = transform.structured.tile
- %0, %1:2 = transform.structured.tile %arg0 [2, 0, 3] : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation)
+ %0, %1:2 = transform.structured.tile %arg0 [2, 0, 3] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
transform.sequence failures(propagate) {
//===----------------------------------------------------------------------===//
transform.sequence failures(propagate) {
-^bb1(%arg0: !pdl.operation):
+^bb1(%arg0: !transform.any_op):
// CHECK: transform.structured.pad
- %0 = transform.structured.pad %arg0
+ %0 = transform.structured.pad %arg0 : (!transform.any_op) -> !transform.any_op
}
transform.sequence failures(propagate) {
-^bb1(%arg0: !pdl.operation):
+^bb1(%arg0: !transform.any_op):
// CHECK: transform.structured.interchange
- %0 = transform.structured.interchange %arg0
+ %0 = transform.structured.interchange %arg0 : (!transform.any_op) -> !transform.any_op
}
transform.sequence failures(propagate) {
-^bb1(%arg0: !pdl.operation):
+^bb1(%arg0: !transform.any_op):
// CHECK: transform.structured.scalarize
- %0 = transform.structured.scalarize %arg0
+ %0 = transform.structured.scalarize %arg0 : (!transform.any_op) -> !transform.any_op
}
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.dot"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loop = transform.structured.tile %0 [8000] : (!pdl.operation) -> (!pdl.operation, !pdl.operation)
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.dot"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loop = transform.structured.tile %0 [8000] : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
// CHECK-LABEL: func @dot
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matvec"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:2 = transform.structured.tile %0 [5, 6] : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation)
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matvec"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:2 = transform.structured.tile %0 [5, 6] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// CHECK-LABEL: func @matvec
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:3 = transform.structured.tile %0 [2000, 3000, 4000] : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
- %2, %loops_2:3 = transform.structured.tile %1 [200, 300, 400] : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
- %3, %loops_3:3 = transform.structured.tile %2 [20, 30, 40] : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
- %4, %loops_4:3 = transform.structured.tile %3 [2, 3, 4] : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:3 = transform.structured.tile %0 [2000, 3000, 4000] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
+ %2, %loops_2:3 = transform.structured.tile %1 [200, 300, 400] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
+ %3, %loops_3:3 = transform.structured.tile %2 [20, 30, 40] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
+ %4, %loops_4:3 = transform.structured.tile %3 [2, 3, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// CHECK-LABEL: func @matmul
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.interchange %0 iterator_interchange = [1, 2, 0]
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.interchange %0 iterator_interchange = [1, 2, 0] : (!transform.any_op) -> !transform.any_op
}
// CHECK-LABEL: func @permute_generic
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matvec"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:2 = transform.structured.tile %0 [5, 6] {interchange = [1, 0]} : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation)
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matvec"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:2 = transform.structured.tile %0 [5, 6] {interchange = [1, 0]} : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// CHECK-LABEL: func @matvec_perm
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:3 = transform.structured.tile %0 [2000, 3000, 4000] {interchange = [1, 2, 0]} : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
- %2, %loops_2:3 = transform.structured.tile %1 [200, 300, 400] {interchange = [1, 0, 2]} : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
- %3, %loops_3:3 = transform.structured.tile %2 [20, 30, 40] : (!pdl.operation) -> (!pdl.operation, !pdl.operation, !pdl.operation, !pdl.operation)
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:3 = transform.structured.tile %0 [2000, 3000, 4000] {interchange = [1, 2, 0]} : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
+ %2, %loops_2:3 = transform.structured.tile %1 [200, 300, 400] {interchange = [1, 0, 2]} : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
+ %3, %loops_3:3 = transform.structured.tile %2 [20, 30, 40] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// CHECK-LABEL: func @matmul_perm
// CHECK-SAME: outs(%[[v2]] : memref<?x?xf32>)
transform.sequence failures(propagate) {
-^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.promote %0 { operands_to_promote = [0, 1, 2], use_full_tiles_by_default }
+^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.promote %0 { operands_to_promote = [0, 1, 2], use_full_tiles_by_default } : (!transform.any_op) -> !transform.any_op
}
// -----
// CHECK-SAME: outs(%[[s2]] : memref<?x?xf32, strided<[?, ?], offset: ?>>)
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
- sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.promote %0 { operands_to_promote = [0], use_full_tiles_by_default }
+^bb0(%arg0: !transform.any_op):
+ sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.promote %0 { operands_to_promote = [0], use_full_tiles_by_default } : (!transform.any_op) -> !transform.any_op
}
}
%c1 = arith.constant 1 : index
%cf = arith.constant 1.0 : f32
%3 = memref.subview %arg0[%c0, %c0][%c2000, %c4000][%c1, %c1] :
- memref<?x?xf32, strided<[?, 1], offset: ?>> to memref<?x?xf32, strided<[?, ?], offset: ?>>
+ memref<?x?xf32, strided<[?, 1], offset: ?>> to memref<?x?xf32, strided<[?, ?], offset: ?>>
linalg.fill
ins(%cf : f32) outs(%3 : memref<?x?xf32, strided<[?, ?], offset: ?>>)
return
}
// CHECK-LABEL: func @aligned_promote_fill
-// CHECK: %[[cf:.*]] = arith.constant 1.{{.*}} : f32
+// CHECK: %[[cf:.*]] = arith.constant 1.{{.*}} : f32
// CHECK: %[[s0:.*]] = memref.subview {{.*}}: memref<?x?xf32, strided{{.*}}> to memref<?x?xf32, strided{{.*}}>
// CHECK: %[[a0:.*]] = memref.alloc() {alignment = 32 : i64} : memref<32000000xi8>
// CHECK: %[[v0:.*]] = memref.view %[[a0]]{{.*}} : memref<32000000xi8> to memref<?x?xf32>
// CHECK: linalg.fill ins(%[[cf]] : f32) outs(%[[v0]] : memref<?x?xf32>)
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
- sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.promote %0 { operands_to_promote = [1], use_full_tile_buffers = [false, true], alignment = 32}
+^bb0(%arg0: !transform.any_op):
+ sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.promote %0 { operands_to_promote = [1], use_full_tile_buffers = [false, true], alignment = 32} : (!transform.any_op) -> !transform.any_op
}
}
%cf = arith.constant 1.0 : f32
%cc = complex.create %cf, %cf : complex<f32>
%3 = memref.subview %arg0[%c0, %c0][%c2000, %c4000][%c1, %c1] :
- memref<?x?xcomplex<f32>, strided<[?, 1], offset: ?>> to memref<?x?xcomplex<f32>, strided<[?, ?], offset: ?>>
+ memref<?x?xcomplex<f32>, strided<[?, 1], offset: ?>> to memref<?x?xcomplex<f32>, strided<[?, ?], offset: ?>>
linalg.fill ins(%cc : complex<f32>)
outs(%3 : memref<?x?xcomplex<f32>, strided<[?, ?], offset: ?>>)
return
}
// CHECK-LABEL: func @aligned_promote_fill_complex
-// CHECK: %[[cc:.*]] = complex.create {{.*}} : complex<f32>
+// CHECK: %[[cc:.*]] = complex.create {{.*}} : complex<f32>
// CHECK: %[[s0:.*]] = memref.subview {{.*}}: memref<?x?xcomplex<f32>, strided{{.*}}> to memref<?x?xcomplex<f32>, strided{{.*}}>
// CHECK: %[[a0:.*]] = memref.alloc() {alignment = 32 : i64} : memref<64000000xi8>
// CHECK: %[[v0:.*]] = memref.view %[[a0]]{{.*}} : memref<64000000xi8> to memref<?x?xcomplex<f32>>
// CHECK: linalg.fill ins(%[[cc]] : complex<f32>) outs(%[[v0]] : memref<?x?xcomplex<f32>>)
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
- sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = transform.structured.promote %0 { operands_to_promote = [1], use_full_tile_buffers = [false, true], alignment = 32}
+^bb0(%arg0: !transform.any_op):
+ sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.promote %0 { operands_to_promote = [1], use_full_tile_buffers = [false, true], alignment = 32} : (!transform.any_op) -> !transform.any_op
}
}
}
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
+ ^bb1(%arg1: !transform.any_op):
// Find the root and all producers.
- %root = transform.structured.match attributes{"__root__"} in %arg1 : (!pdl.operation) -> !pdl.operation
- %producers = transform.structured.match attributes{"__producer__"} in %arg1 : (!pdl.operation) -> !pdl.operation
+ %root = transform.structured.match attributes{"__root__"} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %producers = transform.structured.match attributes{"__producer__"} in %arg1 : (!transform.any_op) -> !transform.any_op
// Tile the root.
%forall_op, %tiled_op = transform.structured.tile_to_forall_op %root num_threads [10, 20]
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
// Fuse all producers.
transform.structured.fuse_into_containing_op %producers into %forall_op
+ : (!transform.any_op, !transform.any_op) -> !transform.any_op
}
}
}
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
+ ^bb1(%arg1: !transform.any_op):
// Find the root and all producers.
- %root = transform.structured.match attributes{"__root__"} in %arg1 : (!pdl.operation) -> !pdl.operation
- %producers = transform.structured.match attributes{"__producer__"} in %arg1 : (!pdl.operation) -> !pdl.operation
+ %root = transform.structured.match attributes{"__root__"} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %producers = transform.structured.match attributes{"__producer__"} in %arg1 : (!transform.any_op) -> !pdl.operation
%reversed_producers = transform.test_reverse_payload_ops %producers
// Tile the root.
%forall_op, %tiled_op = transform.structured.tile_to_forall_op %root num_threads [10, 20]
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
// Fuse all producers.
transform.structured.fuse_into_containing_op %reversed_producers into %forall_op
+ : (!pdl.operation, !transform.any_op) -> !transform.any_op
}
}
}
transform.sequence failures(propagate) {
-^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%loop, %1, %2, %3 = transform.structured.tile_reduction_using_scf %0
- by tile_sizes = [0, 5]
+ by tile_sizes = [0, 5] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// CHECK-DAG: #[[MAP0:.*]] = affine_map<(d0, d1) -> (d0, d1)>
}
transform.sequence failures(propagate) {
-^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %loop, %1, %2, %3 = transform.structured.tile_reduction_using_scf %0
- by tile_sizes = [5, 0]
+^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %loop, %1, %2, %3 = transform.structured.tile_reduction_using_scf %0
+ by tile_sizes = [5, 0] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// CHECK: func @reduction_tile_transpose
}
transform.sequence failures(propagate) {
-^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%loop, %1, %2, %3 = transform.structured.tile_reduction_using_forall %0
- by num_threads = [0, 5], tile_sizes = []
+ by num_threads = [0, 5], tile_sizes = [] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// CHECK-DAG: #[[MAP0:.*]] = affine_map<(d0)[s0] -> (-(d0 * (s0 ceildiv 5)) + s0, s0 ceildiv 5)>
}
transform.sequence failures(propagate) {
-^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
%loop, %1, %2, %3 = transform.structured.tile_reduction_using_forall %0
- by num_threads = [0, 0, 5], tile_sizes = []
+ by num_threads = [0, 0, 5], tile_sizes = [] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// CHECK-DAG: #[[MAP0:.*]] = affine_map<(d0)[s0] -> (-(d0 * (s0 ceildiv 5)) + s0, s0 ceildiv 5)>
}
transform.sequence failures(propagate) {
-^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %loop, %1, %2, %3 = transform.structured.tile_reduction_using_forall %0
- by num_threads = [0, 5], tile_sizes = [0, 3], mapping = [#gpu.thread<x>]
+^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %loop, %1, %2, %3 = transform.structured.tile_reduction_using_forall %0
+ by num_threads = [0, 5], tile_sizes = [0, 3], mapping = [#gpu.thread<x>] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// CHECK-DAG: #[[MAP0:.*]] = affine_map<()[s0] -> (s0 * 3)>
}
transform.sequence failures(propagate) {
-^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %loop, %1, %2, %3 = transform.structured.tile_reduction_using_forall %0
- by num_threads = [0, 5], tile_sizes = [0, 3], mapping = [#gpu.thread<x>]
-
+^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %loop, %1, %2, %3 = transform.structured.tile_reduction_using_forall %0
+ by num_threads = [0, 5], tile_sizes = [0, 3], mapping = [#gpu.thread<x>] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
+
// CHECK: expecting fill
// CHECK-NEXT: linalg.fill
- transform.print %1 {name = "expecting fill"} : !pdl.operation
+ transform.print %1 {name = "expecting fill"} : !transform.any_op
// CHECK: expecting parallel reduction
// CHECK-NEXT: linalg.generic
// CHECK: iterator_types = ["parallel", "reduction"]
- transform.print %2 {name = "expecting parallel reduction"} : !pdl.operation
+ transform.print %2 {name = "expecting parallel reduction"} : !transform.any_op
// CHECK: expecting parallel reduction
// CHECK-NEXT: linalg.generic
// CHECK: iterator_types = ["parallel", "reduction"]
- transform.print %3 {name = "expecting parallel reduction"} : !pdl.operation
+ transform.print %3 {name = "expecting parallel reduction"} : !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
+^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{could not tile reduction}}
%loop, %1, %2, %3 = transform.structured.tile_reduction_using_forall %0
- by num_threads = [5], tile_sizes = [3], mapping = [#gpu.thread<x>]
+ by num_threads = [5], tile_sizes = [3], mapping = [#gpu.thread<x>] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
return %0 : tensor<?xf32>
}
transform.sequence failures(propagate) {
- ^bb0(%arg0: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg0 : (!pdl.operation) -> !pdl.operation
+ ^bb0(%arg0: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg0 : (!transform.any_op) -> !transform.any_op
// expected-error @below {{transform.structured.tile_reduction_using_scf failed to apply}}
- %for_op, %fill_op, %split_linalg_op, %combining_linalg_op = transform.structured.tile_reduction_using_scf %0 by tile_sizes = [0, 5]
+ %for_op, %fill_op, %split_linalg_op, %combining_linalg_op = transform.structured.tile_reduction_using_scf %0 by tile_sizes = [0, 5] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.dot"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.dot"]} 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 { disable_multi_reduction_to_contract_patterns } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matvec"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matvec"]} 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 { disable_multi_reduction_to_contract_patterns } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
+^bb1(%arg1: !transform.any_op):
+ %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 { disable_multi_reduction_to_contract_patterns } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.batch_matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.batch_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 { disable_multi_reduction_to_contract_patterns } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns }
+^bb1(%arg1: !transform.any_op):
+ %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 { disable_multi_reduction_to_contract_patterns } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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
}
// -----
// CHECK: vector.transfer_write %[[CAST]], %[[EMPTY]][%[[C0:.*]]] {in_bounds = [true]} : vector<5xi32>, tensor<5xi32>
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { vectorize_nd_extract } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.fill"]} 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.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.fill"]} 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.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["memref.copy"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["memref.copy"]} 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.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["memref.copy"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["memref.copy"]} 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.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["memref.copy"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["memref.copy"]} 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.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { disable_transfer_permutation_map_lowering_patterns } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { disable_transfer_permutation_map_lowering_patterns } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { disable_transfer_permutation_map_lowering_patterns } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { disable_transfer_permutation_map_lowering_patterns } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+^bb1(%arg1: !transform.any_op):
+ %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 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns } : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { vectorize_padding }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pad"]} 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 { vectorize_padding } : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { vectorize_padding }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pad"]} 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 { vectorize_padding } : (!transform.any_op) -> !transform.any_op
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { vectorize_padding }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pad"]} 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 { vectorize_padding } : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { vectorize_padding }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pad"]} 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 { vectorize_padding } : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { vectorize_padding }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pad"]} 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 { vectorize_padding } : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %3 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
- %5 = transform.structured.vectorize %4 { vectorize_padding }
+^bb1(%arg1: !transform.any_op):
+ %3 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %4 = get_closest_isolated_parent %3 : (!transform.any_op) -> !transform.any_op
+ %5 = transform.structured.vectorize %4 { vectorize_padding } : (!transform.any_op) -> !transform.any_op
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %3 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
- %5 = transform.structured.vectorize %4 { vectorize_padding }
+^bb1(%arg1: !transform.any_op):
+ %3 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %4 = get_closest_isolated_parent %3 : (!transform.any_op) -> !transform.any_op
+ %5 = transform.structured.vectorize %4 { vectorize_padding } : (!transform.any_op) -> !transform.any_op
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %3 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
- %5 = transform.structured.vectorize %4 { vectorize_padding }
+^bb1(%arg1: !transform.any_op):
+ %3 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %4 = get_closest_isolated_parent %3 : (!transform.any_op) -> !transform.any_op
+ %5 = transform.structured.vectorize %4 { vectorize_padding } : (!transform.any_op) -> !transform.any_op
}
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %3 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
- %5 = transform.structured.vectorize %4
+^bb1(%arg1: !transform.any_op):
+ %3 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %4 = get_closest_isolated_parent %3 : (!transform.any_op) -> !transform.any_op
+ %5 = transform.structured.vectorize %4 : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %3 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
- %5 = transform.structured.vectorize %4 { vectorize_padding }
+^bb1(%arg1: !transform.any_op):
+ %3 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %4 = get_closest_isolated_parent %3 : (!transform.any_op) -> !transform.any_op
+ %5 = transform.structured.vectorize %4 { vectorize_padding } : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
- %5 = transform.structured.vectorize %4
+^bb1(%arg1: !transform.any_op):
+ %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %4 = get_closest_isolated_parent %3 : (!transform.any_op) -> !transform.any_op
+ %5 = transform.structured.vectorize %4 : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
- %5 = transform.structured.vectorize %4 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+^bb1(%arg1: !transform.any_op):
+ %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %4 = get_closest_isolated_parent %3 : (!transform.any_op) -> !transform.any_op
+ %5 = transform.structured.vectorize %4 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns } : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
- %5 = transform.structured.vectorize %4 { vectorize_padding }
+^bb1(%arg1: !transform.any_op):
+ %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %4 = get_closest_isolated_parent %3 : (!transform.any_op) -> !transform.any_op
+ %5 = transform.structured.vectorize %4 { vectorize_padding } : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
- %5 = transform.structured.vectorize %4
+^bb1(%arg1: !transform.any_op):
+ %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %4 = get_closest_isolated_parent %3 : (!transform.any_op) -> !transform.any_op
+ %5 = transform.structured.vectorize %4 : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
- %5 = transform.structured.vectorize %4
+^bb1(%arg1: !transform.any_op):
+ %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %4 = get_closest_isolated_parent %3 : (!transform.any_op) -> !transform.any_op
+ %5 = transform.structured.vectorize %4 : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
- %5 = transform.structured.vectorize %4
+^bb1(%arg1: !transform.any_op):
+ %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %4 = get_closest_isolated_parent %3 : (!transform.any_op) -> !transform.any_op
+ %5 = transform.structured.vectorize %4 : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
- %5 = transform.structured.vectorize %4
+^bb1(%arg1: !transform.any_op):
+ %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %4 = get_closest_isolated_parent %3 : (!transform.any_op) -> !transform.any_op
+ %5 = transform.structured.vectorize %4 : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
- %5 = transform.structured.vectorize %4
+^bb1(%arg1: !transform.any_op):
+ %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %4 = get_closest_isolated_parent %3 : (!transform.any_op) -> !transform.any_op
+ %5 = transform.structured.vectorize %4 : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %4 = get_closest_isolated_parent %3 : (!pdl.operation) -> !pdl.operation
- %5 = transform.structured.vectorize %4
+^bb1(%arg1: !transform.any_op):
+ %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %4 = get_closest_isolated_parent %3 : (!transform.any_op) -> !transform.any_op
+ %5 = transform.structured.vectorize %4 : (!transform.any_op) -> !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.fill"]} 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
- %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
+ %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %4 = get_closest_isolated_parent %3 : (!transform.any_op) -> !transform.any_op
+ %5 = transform.structured.vectorize %4 : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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
}
// -----
// CHECK-DAG: vector.transfer_write %[[ADD]], %[[ARG3]]
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns } : (!transform.any_op) -> !transform.any_op
}
// -----
// CHECK: vector.transfer_write %[[GATHER]]
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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
}
// -----
// CHECK: }
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { vectorize_nd_extract } : (!transform.any_op) -> !transform.any_op
}
// -----
// CHECK: vector.transfer_write %[[READ]], %[[ARG1]][%[[C0]], %[[C0]], %[[C0]]] {in_bounds = [true, true, true]} : vector<1x1x3xf32>, tensor<1x1x3xf32>
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { vectorize_nd_extract } : (!transform.any_op) -> !transform.any_op
}
// -----
// CHECK: %[[VAL_22:.*]] = vector.transfer_write %[[VAL_21]], %[[VAL_5]]{{\[}}%[[VAL_9]], %[[VAL_9]]] {in_bounds = [true, true]} : vector<1x4xf32>, tensor<1x4xf32>
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { vectorize_nd_extract } : (!transform.any_op) -> !transform.any_op
}
// -----
// CHECK: vector.transfer_write %[[GATHER]], %[[ARG4]][%[[C0]], %[[C0]], %[[C0]], %[[C0]]] {in_bounds = [true, true, true, true]} : vector<4x7x3x2xf32>, tensor<4x7x3x2xf32>
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { vectorize_nd_extract } : (!transform.any_op) -> !transform.any_op
}
// -----
// CHECK: return %[[VAL_14]] : tensor<5xf32>
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { vectorize_nd_extract } : (!transform.any_op) -> !transform.any_op
}
// -----
// CHECK: }
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { vectorize_nd_extract } : (!transform.any_op) -> !transform.any_op
}
// -----
// CHECK: }
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { vectorize_nd_extract } : (!transform.any_op) -> !transform.any_op
}
// -----
// CHECK: %[[VAL_22:.*]] = vector.mask %[[VAL_8]] { vector.transfer_write {{.*}} {in_bounds = [true, true]} : vector<1x4xf32>, tensor<1x3xf32> } : vector<1x4xi1> -> tensor<1x3xf32>
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.masked_vectorize %0 vector_sizes [1, 4] { vectorize_nd_extract }
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.masked_vectorize %0 vector_sizes [1, 4] { vectorize_nd_extract } : !transform.any_op
}
// -----
// CHECK: }
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.masked_vectorize %0 vector_sizes [1, 4] { vectorize_nd_extract }
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.masked_vectorize %0 vector_sizes [1, 4] { vectorize_nd_extract } : !transform.any_op
}
// -----
// CHECK: }
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { vectorize_nd_extract } : (!transform.any_op) -> !transform.any_op
}
// -----
// CHECK: %[[VAL_25:.*]] = vector.mask %[[VAL_8]] { vector.transfer_write {{.*}} {in_bounds = [true, true]} : vector<1x4xf32>, tensor<1x3xf32> } : vector<1x4xi1> -> tensor<1x3xf32>
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.masked_vectorize %0 vector_sizes [1, 4] { vectorize_nd_extract }
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.masked_vectorize %0 vector_sizes [1, 4] { vectorize_nd_extract } : !transform.any_op
}
// -----
// CHECK: }
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.masked_vectorize %0 vector_sizes [1, 4] { vectorize_nd_extract }
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.masked_vectorize %0 vector_sizes [1, 4] { vectorize_nd_extract } : !transform.any_op
}
// -----
// CHECK: }
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { vectorize_nd_extract } : (!transform.any_op) -> !transform.any_op
}
// -----
// CHECK: }
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { vectorize_nd_extract } : (!transform.any_op) -> !transform.any_op
}
// -----
// CHECK: }
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { vectorize_nd_extract }
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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 { vectorize_nd_extract } : (!transform.any_op) -> !transform.any_op
}
// CHECK-NEXT: arith.addf %[[LHS]], %[[RHS]] : vector<64xf32>
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.map"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.map"]} 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
}
// -----
// CHECK-SAME: [1, 2, 0] : vector<16x32x64xf32> to vector<32x64x16xf32>
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.transpose"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.transpose"]} 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
}
// -----
// CHECK-SAME: : vector<16x32x64xf32> to vector<16x64xf32>
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.reduce"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.reduce"]} 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
}
// -----
// CHECK: %[[VAL_14:.*]] = vector.mask %[[VAL_7]] { vector.transfer_write %{{.*}} {in_bounds = [true]} : vector<4xf32>, tensor<?xf32> } : vector<4xi1> -> tensor<?xf32>
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.masked_vectorize %0 vector_sizes [4]
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.masked_vectorize %0 vector_sizes [4] : !transform.any_op
}
// -----
// CHECK: %[[VAL_14:.*]] = vector.mask %{{.*}} { vector.transfer_write %[[VAL_13]], {{.*}} {in_bounds = [true]} : vector<4xf32>, tensor<?xf32> } : vector<4xi1> -> tensor<?xf32>
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.masked_vectorize %0 vector_sizes [4]
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.masked_vectorize %0 vector_sizes [4] : !transform.any_op
}
// -----
// CHECK: %[[VAL_17:.*]] = vector.mask %[[VAL_12]] { vector.transfer_write %[[VAL_16]], %{{.*}} {in_bounds = [true, true]} : vector<4x8xf32>, tensor<?x?xf32> } : vector<4x8xi1> -> tensor<?x?xf32>
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.masked_vectorize %0 vector_sizes [4, 8]
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.masked_vectorize %0 vector_sizes [4, 8] : !transform.any_op
}
// -----
// CHECK: %[[VAL_18:.*]] = vector.mask %[[VAL_12]] { vector.transfer_write %{{.*}} {in_bounds = [true, true]} : vector<4x8xf32>, tensor<?x?xf32> } : vector<4x8xi1> -> tensor<?x?xf32>
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.masked_vectorize %0 vector_sizes [4, 8]
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.masked_vectorize %0 vector_sizes [4, 8] : !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.masked_vectorize %0 vector_sizes [4, 8]
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.masked_vectorize %0 vector_sizes [4, 8] : !transform.any_op
}
// CHECK-LABEL: @vectorize_dynamic_reduction(
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.masked_vectorize %0 vector_sizes [4, 8, 16]
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.masked_vectorize %0 vector_sizes [4, 8, 16] : !transform.any_op
}
// CHECK-LABEL: @vectorize_dynamic_transpose_reduction(
// -----
// This is a regression test. This IR cannot be vectorized, but
-// structured.vectorize should nevertheless succeed.
+// structured.vectorize should nevertheless succeed. : (!transform.any_op) -> !transform.any_op
#map = affine_map<(d0) -> (d0)>
// CHECK-LABEL: @not_vectorizable
return %1 : tensor<1x128xf32>
}
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
+^bb0(%arg0: !transform.any_op):
+ %0 = transform.structured.match ops{["func.func"]} in %arg0 : (!transform.any_op) -> !transform.any_op
+ %1 = transform.structured.vectorize %0 : (!transform.any_op) -> !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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
}
// CHECK-LABEL: @wrong_reduction_detection
// -----
-// Don't vectorize tensor<0xf32>
+// Don't vectorize tensor<0xf32> : (!transform.any_op) -> !transform.any_op
// CHECK-LABEL: @tensor_size0
// CHECK: linalg.generic
func.func @tensor_size0(%arg0: tensor<0xf32>,
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} 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.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.masked_vectorize %0 vector_sizes [8, 32]
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.masked_vectorize %0 vector_sizes [8, 32] : !transform.any_op
}
// -----
// CHECK: %[[VAL_24:.*]] = vector.mask %[[VAL_10]] { vector.transfer_write %[[VAL_22]], %[[VAL_1]]{{\[}}%[[VAL_23]], %[[VAL_23]]] {in_bounds = [true, true]} : vector<3x3xf32>, tensor<?x?xf32> } : vector<3x3xi1> -> tensor<?x?xf32>
transform.sequence failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.masked_vectorize %0 vector_sizes [3, 3] { vectorize_nd_extract }
+ ^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.masked_vectorize %0 vector_sizes [3, 3] { vectorize_nd_extract } : !transform.any_op
}
// -----
// CHECK-NOT: vector.mask
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.masked_vectorize %0 vector_sizes [8, 32]
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.masked_vectorize %0 vector_sizes [8, 32] : !transform.any_op
}
// -----
// CHECK: %[[VAL_15:.*]] = vector.mask %[[VAL_7]] { vector.transfer_write %[[VAL_13]], %[[VAL_2]][%[[VAL_14]], %[[VAL_14]]] {in_bounds = [true, true]} : vector<8x32xf32>, tensor<8x30xf32> } : vector<8x32xi1> -> tensor<8x30xf32>
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.masked_vectorize %0 vector_sizes [8, 32]
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.masked_vectorize %0 vector_sizes [8, 32] : !transform.any_op
}
// -----
// CHECK: vector.mask %[[MASK]] { vector.transfer_write %[[BCAST]], {{.*}} {in_bounds = [true, true]} : vector<8x16xf32>, tensor<?x?xf32> } : vector<8x16xi1>
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.masked_vectorize %0 vector_sizes [8, 16]
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.masked_vectorize %0 vector_sizes [8, 16] : !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.copy"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.masked_vectorize %0 vector_sizes [2, 4]
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.copy"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.masked_vectorize %0 vector_sizes [2, 4] : !transform.any_op
}
// -----
}
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
+^bb1(%arg1: !transform.any_op):
%0 = transform.structured.match ops{["tensor.pad"]} in %arg1
- : (!pdl.operation) -> !pdl.operation
- transform.structured.masked_vectorize %0 vector_sizes [2, 4]
+ : (!transform.any_op) -> !transform.any_op
+ transform.structured.masked_vectorize %0 vector_sizes [2, 4] : !transform.any_op
}
// -----
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1 = get_closest_isolated_parent %0 : (!pdl.operation) -> !pdl.operation
- %2 = transform.structured.vectorize %1 { vectorize_padding }
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pad"]} 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 { vectorize_padding } : (!transform.any_op) -> !transform.any_op
}
// -----
// CHECK: }
transform.sequence failures(propagate) {
-^bb1(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- transform.structured.masked_vectorize %0 vector_sizes [8, 16, 4]
+^bb1(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.masked_vectorize %0 vector_sizes [8, 16, 4] : !transform.any_op
}
transform.sequence failures(propagate) {
^bb0(%arg1: !transform.any_op):
- %if = transform.structured.match ops{["scf.if"]} in %arg1
+ %if = transform.structured.match ops{["scf.if"]} in %arg1
: (!transform.any_op) -> !transform.any_op
// expected-error @+1 {{requires an scf.if op with a single-block `else` region}}
- transform.scf.take_assumed_branch %if take_else_branch
+ transform.scf.take_assumed_branch %if take_else_branch
: (!transform.any_op) -> ()
}
transform.sequence failures(propagate) {
^bb0(%arg1: !transform.any_op):
%0 = transform.structured.match ops{["tensor.pad"]} in %arg1
- : (!transform.any_op) -> !pdl.operation
- transform.structured.tile_to_forall_op %0 tile_sizes[1, 1]
+ : (!transform.any_op) -> !transform.any_op
+ transform.structured.tile_to_forall_op %0 tile_sizes[1, 1]
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
%if = transform.structured.match ops{["scf.if"]} in %arg1
: (!transform.any_op) -> !transform.any_op
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 3]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 3] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loop = transform.structured.tile_to_scf_for %0 [0, 3]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loop = transform.structured.tile_to_scf_for %0 [0, 3] : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 3]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 3] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loop = transform.structured.tile_to_scf_for %0 [0, 3]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loop = transform.structured.tile_to_scf_for %0 [0, 3] : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loop = transform.structured.tile_to_scf_for %0 [0, 3]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loop = transform.structured.tile_to_scf_for %0 [0, 3] : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 4]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 4]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 4]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 4]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 4]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 4]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 4]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 4]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 4]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:2 = transform.structured.tile_to_scf_for %0 [2, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:4 = transform.structured.tile_to_scf_for %0 [1, 1, 1, 4]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:4 = transform.structured.tile_to_scf_for %0 [1, 1, 1, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:2 = transform.structured.tile_to_scf_for %0 [4, 8]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.unpack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:2 = transform.structured.tile_to_scf_for %0 [4, 8] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
}
// -----
}
transform.sequence failures(propagate) {
- ^bb0(%arg1: !pdl.operation):
- %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!pdl.operation) -> !pdl.operation
- %1, %loops:4 = transform.structured.tile_to_scf_for %0 [1, 1, 1, 1]
+ ^bb0(%arg1: !transform.any_op):
+ %0 = transform.structured.match ops{["tensor.pack"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1, %loops:4 = transform.structured.tile_to_scf_for %0 [1, 1, 1, 1] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
// Match matmul operations inside @matmul_tensors with test.attrA set.
pdl.pattern @pdl_target_attrA : benefit(1) {
%args = operands
rewrite %0 with "transform.dialect"
}
- transform.sequence %arg0 : !pdl.operation failures(propagate) {
- ^bb1(%arg1: !pdl.operation):
- %0 = pdl_match @pdl_target_attrA in %arg1 : (!pdl.operation) -> !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.sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
+ %0 = pdl_match @pdl_target_attrA in %arg1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.tile %0 [4, 4, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
+ %1 = pdl_match @pdl_target_attrC in %arg1 : (!transform.any_op) -> !transform.any_op
+ %2 = transform.get_closest_isolated_parent %1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.vectorize %2 : (!transform.any_op) -> !transform.any_op
}
}
}
transform.with_pdl_patterns {
-^bb0(%arg0: !pdl.operation):
+^bb0(%arg0: !transform.any_op):
pdl.pattern @pdl_target : benefit(1) {
%args = operands
%results = types
rewrite %0 with "transform.dialect"
}
- transform.sequence %arg0 : !pdl.operation failures(propagate) {
- ^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.sequence %arg0 : !transform.any_op failures(propagate) {
+ ^bb1(%arg1: !transform.any_op):
+ %0 = pdl_match @pdl_target in %arg1 : (!transform.any_op) -> !transform.any_op
+ %1 = get_closest_isolated_parent %0 : (!transform.any_op) -> !transform.any_op
+ transform.structured.vectorize %1 : (!transform.any_op) -> !transform.any_op
}
}
}
transform.sequence failures(propagate) {
-^bb0(%arg0: !pdl.operation):
- transform.structured.vectorize %arg0
+^bb0(%arg0: !transform.any_op):
+ transform.structured.vectorize %arg0 : (!transform.any_op) -> !transform.any_op
}
}
transform.sequence failures(propagate) {
-^bb1(%module_op: !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
+^bb1(%module_op: !transform.any_op):
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %module_op : (!transform.any_op) -> !transform.any_op
+ %1, %loops:3 = transform.structured.tile %0 [8, 4, 2]
+ : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op, !transform.any_op)
+ %2 = get_closest_isolated_parent %1 : (!transform.any_op) -> !transform.any_op
+ transform.structured.vectorize %2 : (!transform.any_op) -> !transform.any_op
%b = transform.bufferization.one_shot_bufferize
layout{IdentityLayoutMap} %module_op
{bufferize_function_boundaries = true, allow_return_allocs = true}
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
%f = transform.structured.match ops{["func.func"]} in %b
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
// TODO: group these lower-level controls into various properly named vector
// lowering TD macros.
%func = transform.vector.lower_contraction %f
lowering_strategy = "outerproduct"
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
%func_2 = transform.vector.apply_transfer_permutation_patterns %func
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
%func_3 = transform.vector.lower_multi_reduction %func_2
lowering_strategy = "innerparallel"
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
%func_4 = transform.vector.split_transfer_full_partial %func_3
split_transfer_strategy = "linalg-copy"
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
%func_5 = transform.vector.transfer_to_scf %func_4
max_transfer_rank = 1 full_unroll = true
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
%func_6 = transform.vector.lower_transfer %func_5
max_transfer_rank = 1
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
%func_7 = transform.vector.lower_shape_cast %func_6
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
%func_8 = transform.vector.lower_transpose %func_7
lowering_strategy = "shuffle_1d"
- : (!pdl.operation) -> !pdl.operation
+ : (!transform.any_op) -> !transform.any_op
}
]),
includes = ["include"],
deps = [
- ":PDLDialectTdFiles",
":SCFTdFiles",
":TransformDialectTdFiles",
],
":LinalgTransformOpsIncGen",
":LinalgTransforms",
":LinalgUtils",
- ":PDLDialect",
":SCFDialect",
":SCFTransforms",
":Support",