Merge pull request #9434 from matthias-springer/transform_py_bindings
Use mlir transform dialect Python bindings.
diff --git a/compiler/src/iree/compiler/API/python/CMakeLists.txt b/compiler/src/iree/compiler/API/python/CMakeLists.txt
index 78f3187..e4411d6 100644
--- a/compiler/src/iree/compiler/API/python/CMakeLists.txt
+++ b/compiler/src/iree/compiler/API/python/CMakeLists.txt
@@ -91,8 +91,10 @@
MLIRPythonSources.Dialects.memref
MLIRPythonSources.Dialects.pdl
MLIRPythonSources.Dialects.shape
+ MLIRPythonSources.Dialects.structured_transform
MLIRPythonSources.Dialects.tensor
MLIRPythonSources.Dialects.tosa
+ MLIRPythonSources.Dialects.transform
MLIRPythonSources.Dialects.vector
# mhlo project.
diff --git a/llvm-external-projects/iree-dialects/python/CMakeLists.txt b/llvm-external-projects/iree-dialects/python/CMakeLists.txt
index 028eff7..f5b4935 100644
--- a/llvm-external-projects/iree-dialects/python/CMakeLists.txt
+++ b/llvm-external-projects/iree-dialects/python/CMakeLists.txt
@@ -53,14 +53,15 @@
DIALECT_NAME iree_pydm
)
-declare_mlir_python_sources(TmpTransformDialect
+declare_mlir_dialect_extension_python_bindings(
ADD_TO_PARENT IREEDialectsPythonSources.Dialects
ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/iree/compiler"
+ TD_FILE dialects/IreeStructuredTransformOps.td
SOURCES
- dialects/transform.py
- dialects/_transform_ops_ext.py
- dialects/_transform_ops_gen.py
-)
+ dialects/transform/iree_structured.py
+ dialects/_iree_structured_transform_ops_ext.py
+ DIALECT_NAME transform
+ EXTENSION_NAME iree_structured_transform)
################################################################################
# Extensions
diff --git a/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/TransformExtBinding.td b/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/IreeStructuredTransformOps.td
similarity index 89%
rename from llvm-external-projects/iree-dialects/python/iree/compiler/dialects/TransformExtBinding.td
rename to llvm-external-projects/iree-dialects/python/iree/compiler/dialects/IreeStructuredTransformOps.td
index 0ae83b3..42c69e2 100644
--- a/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/TransformExtBinding.td
+++ b/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/IreeStructuredTransformOps.td
@@ -8,7 +8,6 @@
#define PYTHON_BINDINGS_IREE_TRANSFORMEXT_BINDING
include "mlir/Bindings/Python/Attributes.td"
-//include "mlir/Dialect/Transform/IR/TransformOps.td"
include "iree-dialects/Dialect/LinalgTransform/StructuredTransformOpsExt.td"
#endif // PYTHON_BINDINGS_IREE_TRANSFORMEXT_BINDING
diff --git a/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/_iree_structured_transform_ops_ext.py b/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/_iree_structured_transform_ops_ext.py
new file mode 100644
index 0000000..f21d3d2
--- /dev/null
+++ b/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/_iree_structured_transform_ops_ext.py
@@ -0,0 +1,142 @@
+# Copyright 2021 The IREE Authors
+#
+# Licensed 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
+# Disable PyType, it does not seem to like the specialization pattern used in
+# MLIR.
+# pytype: skip-file
+try:
+ from .. import ir
+ from ..dialects import pdl
+ from ._ods_common import extend_opview_class as _ods_extend_opview_class, segmented_accessor as _ods_segmented_accessor, equally_sized_accessor as _ods_equally_sized_accessor, get_default_loc_context as _ods_get_default_loc_context, get_op_result_or_value as _get_op_result_or_value, get_op_results_or_values as _get_op_results_or_values
+ from typing import Optional, Sequence, Union
+except ImportError as e:
+ raise RuntimeError("Error loading imports from extension module") from e
+BoolArg = Optional[Union[bool, ir.BoolAttr]]
+IntListArg = Optional[Union[Sequence[int], ir.ArrayAttr]]
+StringArg = Optional[Union[str, ir.StringAttr]]
+
+
+def _defaulted_ensure(f):
+
+ def inner(value, default=None):
+ assert value is not None or default is not None
+ return f(default if value is None else value)
+
+ return inner
+
+
+@_defaulted_ensure
+def _ensure_int_array_attr(value: IntListArg):
+ i64 = ir.IntegerType.get_signless(64)
+ if isinstance(value, Sequence):
+ return ir.ArrayAttr.get([ir.IntegerAttr.get(i64, i) for i in value])
+ return value
+
+
+@_defaulted_ensure
+def _ensure_bool_attr(value: BoolArg):
+ if isinstance(value, bool):
+ return ir.BoolAttr.get(value)
+ return value
+
+
+@_defaulted_ensure
+def _ensure_string_attr(value: StringArg):
+ if isinstance(value, str):
+ return ir.StringAttr.get(value)
+ return value
+
+
+class CanonicalizedSequenceOp:
+ """Specialization for the CanonicalizedSequenceOp class."""
+
+ def __init__(self, target, *, loc=None, ip=None):
+ operands = []
+ results = []
+ attributes = {}
+ regions = 1
+ if target is not None:
+ operands.append(_get_op_result_or_value(target))
+ _ods_successors = None
+ super().__init__(
+ self.build_generic(attributes=attributes,
+ results=results,
+ operands=operands,
+ successors=_ods_successors,
+ regions=regions,
+ loc=loc,
+ ip=ip))
+ self.body.blocks.append(pdl.OperationType.get())
+
+
+class LowerVectorsOp:
+ """Specialization for the LowerVectorsOp class."""
+
+ def __init__(self,
+ *,
+ stages: IntListArg = None,
+ contraction_lowering: StringArg = None,
+ multireduction_lowering: StringArg = None,
+ split_transfers: StringArg = None,
+ unroll_vector_transfers: BoolArg = None,
+ transpose_lowering: StringArg = None,
+ transpose_avx2_lowering: BoolArg = None,
+ loc=None,
+ ip=None):
+ stages = _ensure_int_array_attr(stages, [0, 1, 2, 3, 4, 5, 6])
+ contraction_lowering = _ensure_string_attr(contraction_lowering,
+ "outerproduct")
+ multireduction_lowering = _ensure_string_attr(multireduction_lowering,
+ "innerparallel")
+ split_transfers = _ensure_string_attr(split_transfers, "linalg-copy")
+ unroll_vector_transfers = _ensure_bool_attr(unroll_vector_transfers, True)
+ transpose_lowering = _ensure_string_attr(transpose_lowering, "eltwise")
+ transpose_avx2_lowering = _ensure_bool_attr(transpose_avx2_lowering, False)
+ super().__init__(stages,
+ contraction_lowering,
+ multireduction_lowering,
+ split_transfers,
+ unroll_vector_transfers,
+ transpose_lowering,
+ transpose_avx2_lowering,
+ loc=loc,
+ ip=ip)
+
+
+class LowerToLLVMOp:
+ """Specialization for the LowerToLLVMOp class."""
+
+ def __init__(self,
+ *,
+ reassociate_fp_reductions: BoolArg = None,
+ enable_index_optimizations: BoolArg = None,
+ enable_arm_neon: BoolArg = None,
+ enable_arm_sve: BoolArg = None,
+ enable_amx: BoolArg = None,
+ enable_x86vector: BoolArg = None,
+ enable_async: BoolArg = None,
+ loc=None,
+ ip=None):
+ super().__init__(_ensure_bool_attr(reassociate_fp_reductions, False),
+ _ensure_bool_attr(enable_index_optimizations, False),
+ _ensure_bool_attr(enable_arm_neon, False),
+ _ensure_bool_attr(enable_arm_sve, False),
+ _ensure_bool_attr(enable_amx, False),
+ _ensure_bool_attr(enable_x86vector, False),
+ _ensure_bool_attr(enable_async, False),
+ loc=loc,
+ ip=ip)
+
+
+class PrintOp:
+
+ def __init__(self,
+ target: Optional[Union[ir.Value, ir.Operation, ir.OpView]],
+ *,
+ name: StringArg,
+ loc=None,
+ ip=None):
+ name = _ensure_string_attr(name)
+ super().__init__(target, name, loc=loc, ip=ip)
diff --git a/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/_transform_ops_ext.py b/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/_transform_ops_ext.py
deleted file mode 100644
index 8add407..0000000
--- a/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/_transform_ops_ext.py
+++ /dev/null
@@ -1,465 +0,0 @@
-# Copyright 2021 The IREE Authors
-#
-# Licensed 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
-# Disable PyType, it does not seem to like the specialization pattern used in
-# MLIR.
-# pytype: skip-file
-try:
- from .. import ir
- from ..dialects import pdl
- from ._ods_common import extend_opview_class as _ods_extend_opview_class, segmented_accessor as _ods_segmented_accessor, equally_sized_accessor as _ods_equally_sized_accessor, get_default_loc_context as _ods_get_default_loc_context, get_op_result_or_value as _get_op_result_or_value, get_op_results_or_values as _get_op_results_or_values
- from typing import Optional, Sequence, Union
-except ImportError as e:
- raise RuntimeError("Error loading imports from extension module") from e
-BoolArg = Optional[Union[bool, ir.BoolAttr]]
-IntArg = Optional[Union[int, ir.IntegerAttr]]
-IntListArg = Optional[Union[Sequence[int], ir.ArrayAttr]]
-IntListListArg = Optional[Union[Sequence[Union[Sequence[int], ir.ArrayAttr]],
- ir.ArrayAttr]]
-StringArg = Optional[Union[str, ir.StringAttr]]
-StringListArg = Optional[Union[Sequence[str], ir.ArrayAttr]]
-
-
-def _defaulted_ensure(f):
-
- def inner(value, default=None):
- assert value is not None or default is not None
- return f(default if value is None else value)
-
- return inner
-
-
-@_defaulted_ensure
-def _ensure_int_array_attr(value: IntListArg):
- i64 = ir.IntegerType.get_signless(64)
- if isinstance(value, Sequence):
- return ir.ArrayAttr.get([ir.IntegerAttr.get(i64, i) for i in value])
- return value
-
-
-@_defaulted_ensure
-def _ensure_string_array_attr(value: StringListArg):
- if isinstance(value, Sequence):
- return ir.ArrayAttr.get([ir.StringAttr.get(str(i)) for i in value])
- return value
-
-
-@_defaulted_ensure
-def _ensure_array_of_array_attr(value: IntListListArg):
- if isinstance(value, Sequence):
- return ir.ArrayAttr.get([_ensure_int_array_attr(inner) for inner in value])
- return value
-
-
-@_defaulted_ensure
-def _ensure_int_attr(value: IntArg):
- if isinstance(value, int):
- return ir.IntegerAttr.get(ir.IntegerType.get_signless(64), value)
- return value
-
-
-@_defaulted_ensure
-def _ensure_bool_attr(value: BoolArg):
- if isinstance(value, bool):
- return ir.BoolAttr.get(value)
- return value
-
-
-@_defaulted_ensure
-def _ensure_string_attr(value: StringArg):
- if isinstance(value, str):
- return ir.StringAttr.get(value)
- return value
-
-
-def _count_expected_loops(tile_sizes: ir.ArrayAttr) -> int:
- # Number of loops = number of tile sizes != 0
- zero = _ensure_int_attr(0)
- return len(list(tile_sizes)) - list(tile_sizes).count(zero)
-
-
-class MatchOp:
- """Specialization for the MatchOp class."""
-
- def __init__(self, target: Union[str, ir.FlatSymbolRefAttr]):
- if isinstance(target, str):
- target = ir.FlatSymbolRefAttr.get(target)
- operation_type = pdl.OperationType.get()
- super().__init__(operation_type, target)
-
-
-class WithPDLPatternsOp:
- """Specialization for the WithPDLPatternsOp class."""
-
- def __init__(self, root, *, loc=None, ip=None):
- operands = []
- results = []
- attributes = {}
- regions = 1
- print(root)
- if root is not None:
- operands.append(_get_op_result_or_value(root))
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
- self.body.blocks.append(pdl.OperationType.get())
-
-
-class CanonicalizedSequenceOp:
- """Specialization for the CanonicalizedSequenceOp class."""
-
- def __init__(self, target, *, loc=None, ip=None):
- operands = []
- results = []
- attributes = {}
- regions = 1
- if target is not None:
- operands.append(_get_op_result_or_value(target))
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
- self.body.blocks.append(pdl.OperationType.get())
-
-
-class PDLMatchOp:
- """Specialization for the PDLMatchOp class."""
-
- def __init__(self, root, pattern_name: str, *, loc=None, ip=None):
- operands = []
- results = []
- attributes = {}
- regions = None
- operands.append(_get_op_result_or_value(root))
- attributes["pattern_name"] = ir.FlatSymbolRefAttr.get(pattern_name)
- results.append(pdl.OperationType.get())
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
-
-
-class LowerVectorsOp:
- """Specialization for the LowerVectorsOp class."""
-
- def __init__(self,
- *,
- stages: IntListArg = None,
- contraction_lowering: StringArg = None,
- multireduction_lowering: StringArg = None,
- split_transfers: StringArg = None,
- unroll_vector_transfers: BoolArg = None,
- transpose_lowering: StringArg = None,
- transpose_avx2_lowering: BoolArg = None,
- loc=None,
- ip=None):
- stages = _ensure_int_array_attr(stages, [0, 1, 2, 3, 4, 5, 6])
- contraction_lowering = _ensure_string_attr(contraction_lowering,
- "outerproduct")
- multireduction_lowering = _ensure_string_attr(multireduction_lowering,
- "innerparallel")
- split_transfers = _ensure_string_attr(split_transfers, "linalg-copy")
- unroll_vector_transfers = _ensure_bool_attr(unroll_vector_transfers, True)
- transpose_lowering = _ensure_string_attr(transpose_lowering, "eltwise")
- transpose_avx2_lowering = _ensure_bool_attr(transpose_avx2_lowering, False)
- super().__init__(stages,
- contraction_lowering,
- multireduction_lowering,
- split_transfers,
- unroll_vector_transfers,
- transpose_lowering,
- transpose_avx2_lowering,
- loc=loc,
- ip=ip)
-
-
-class LowerToLLVMOp:
- """Specialization for the LowerToLLVMOp class."""
-
- def __init__(self,
- *,
- reassociate_fp_reductions: BoolArg = None,
- enable_index_optimizations: BoolArg = None,
- enable_arm_neon: BoolArg = None,
- enable_arm_sve: BoolArg = None,
- enable_amx: BoolArg = None,
- enable_x86vector: BoolArg = None,
- enable_async: BoolArg = None,
- loc=None,
- ip=None):
- super().__init__(_ensure_bool_attr(reassociate_fp_reductions, False),
- _ensure_bool_attr(enable_index_optimizations, False),
- _ensure_bool_attr(enable_arm_neon, False),
- _ensure_bool_attr(enable_arm_sve, False),
- _ensure_bool_attr(enable_amx, False),
- _ensure_bool_attr(enable_x86vector, False),
- _ensure_bool_attr(enable_async, False),
- loc=loc,
- ip=ip)
-
-
-class FuseOp:
- """Specialization for the FuseOp class."""
-
- def __init__(self,
- target: Union[ir.Value, ir.Operation, ir.OpView],
- *,
- tile_sizes: IntListArg = None,
- tile_interchange: IntListArg = None,
- loc=None,
- ip=None):
- tile_sizes = _ensure_int_array_attr(tile_sizes, [])
- tile_interchange = _ensure_int_array_attr(tile_interchange, [])
- operation_type = pdl.OperationType.get()
-
- num_loops = _count_expected_loops(tile_sizes)
- super().__init__(operation_type, [operation_type] * num_loops,
- target,
- tile_sizes,
- tile_interchange,
- loc=loc,
- ip=ip)
-
-
-class FuseProducersOp:
- """Specialization for the FuseProducersOp class."""
-
- def __init__(self,
- target: Union[ir.Value, ir.Operation, ir.OpView],
- *,
- operands_to_fuse: IntListArg = None,
- loc=None,
- ip=None):
- operands_to_fuse = _ensure_int_array_attr(operands_to_fuse, [])
- num_producers = len(operands_to_fuse)
- operation_type = pdl.OperationType.get()
- super().__init__(operation_type, [operation_type] * num_producers,
- target,
- operands_to_fuse,
- loc=loc,
- ip=ip)
-
-
-class TileOp:
- """Specialization for the TileOp class."""
-
- def __init__(self,
- target: Union[ir.Value, ir.Operation, ir.OpView],
- *,
- sizes: IntListArg = None,
- interchange: IntListArg = None,
- loc=None,
- ip=None):
- sizes = _ensure_int_array_attr(sizes, [])
- interchange = _ensure_int_array_attr(interchange, [])
- operation_type = pdl.OperationType.get()
- tile_size_zero = _ensure_int_attr(0)
- num_loops = _count_expected_loops(sizes)
- super().__init__(operation_type, [operation_type] * num_loops,
- target,
- sizes,
- interchange,
- loc=loc,
- ip=ip)
-
-
-class ScalarizeOp:
- """Specialization for the ScalarizeOp class."""
-
- def __init__(self,
- target: Union[ir.Value, ir.Operation, ir.OpView],
- *,
- loc=None,
- ip=None):
- operation_type = pdl.OperationType.get()
- super().__init__(operation_type, target, loc=loc, ip=ip)
-
-
-class PeelLoopOp:
- """Specialization for the PeelLoopOp class."""
-
- def __init__(self,
- target: Union[ir.Value, ir.Operation, ir.OpView],
- *,
- loc=None,
- ip=None):
- operation_type = pdl.OperationType.get()
- super().__init__(operation_type, target, loc=loc, ip=ip)
-
-
-class PadOp:
- """Specialization for the PadOp class."""
-
- def __init__(self,
- target: Union[ir.Value, ir.Operation, ir.OpView],
- *,
- padding_values: StringListArg = None,
- padding_dimensions: IntListArg = None,
- pack_paddings: IntListArg = None,
- hoist_paddings: IntListArg = None,
- transpose_paddings: IntListListArg = None,
- loc=None,
- ip=None):
- padding_values = _ensure_string_array_attr(padding_values, [])
- padding_dimensions = _ensure_int_array_attr(padding_dimensions, [])
- pack_paddings = _ensure_int_array_attr(pack_paddings, [])
- hoist_paddings = _ensure_int_array_attr(hoist_paddings, [])
- transpose_paddings = _ensure_array_of_array_attr(transpose_paddings, [])
- operation_type = pdl.OperationType.get()
-
- super().__init__(operation_type,
- target,
- padding_values,
- padding_dimensions,
- pack_paddings,
- hoist_paddings,
- transpose_paddings,
- loc=loc,
- ip=ip)
-
-
-class GeneralizeOp:
- """Specialization for the GeneralizeOp class."""
-
- def __init__(self,
- target: Union[ir.Value, ir.Operation, ir.OpView],
- *,
- loc=None,
- ip=None):
- operation_type = pdl.OperationType.get()
-
- super().__init__(operation_type, target, loc=loc, ip=ip)
-
-
-class InterchangeOp:
- """Specialization for the InterchangeOp class."""
-
- def __init__(self,
- target: Union[ir.Value, ir.Operation, ir.OpView],
- *,
- iterator_interchange: IntListArg = None,
- loc=None,
- ip=None):
- iterator_interchange = _ensure_int_array_attr(iterator_interchange, [])
- operation_type = pdl.OperationType.get()
-
- super().__init__(operation_type,
- target,
- iterator_interchange,
- loc=loc,
- ip=ip)
-
-
-class VectorizeOp:
-
- def __init__(self,
- target: Optional[Union[ir.Value, ir.Operation,
- ir.OpView]] = None,
- *,
- vectorize_padding: BoolArg = None,
- loc=None,
- ip=None):
- operation_type = pdl.OperationType.get()
-
- super().__init__(operation_type if target is not None else None,
- target,
- _ensure_bool_attr(vectorize_padding, False),
- loc=loc,
- ip=ip)
-
-
-class GetParentLoopOp:
-
- def __init__(self,
- target: Union[ir.Value, ir.Operation, ir.OpView],
- *,
- num_loops: IntArg = None,
- loc=None,
- ip=None):
- operation_type = pdl.OperationType.get()
- num_loops = _ensure_int_attr(num_loops, 1)
- super().__init__(operation_type, target, num_loops, loc=loc, ip=ip)
-
-
-class UnrollLoopOp:
-
- def __init__(self,
- target: Union[ir.Value, ir.Operation, ir.OpView],
- *,
- factor: Union[int, ir.IntegerAttr],
- loc=None,
- ip=None):
- # Factor must not be None, do not provide the default value here.
- factor = _ensure_int_attr(factor)
- super().__init__(target, factor, loc=loc, ip=ip)
-
-
-class PipelineLoopOp:
-
- def __init__(self,
- target: Union[ir.Value, ir.Operation, ir.OpView],
- *,
- iteration_interval: IntArg,
- read_latency: IntArg,
- loc=None,
- ip=None):
- iteration_interval = _ensure_int_attr(iteration_interval, 1)
- read_latency = _ensure_int_attr(read_latency, 10)
- operation_type = pdl.OperationType.get()
- super().__init__(operation_type,
- target,
- iteration_interval,
- read_latency,
- loc=loc,
- ip=ip)
-
-
-class OutlineLoopOp:
-
- def __init__(self,
- target: Union[ir.Value, ir.Operation, ir.OpView],
- *,
- func_name: StringArg,
- loc=None,
- ip=None):
- # Function name must not be None, do not provide the default value.
- func_name = _ensure_string_attr(func_name)
- operation_type = pdl.OperationType.get()
- super().__init__(operation_type, target, func_name, loc=loc, ip=ip)
-
-
-class SequenceOp:
-
- def __init__(self, *, loc=None, ip=None):
- super().__init__(loc=loc, ip=ip)
- self.body.blocks.append()
-
-
-class PrintOp:
-
- def __init__(self,
- target: Optional[Union[ir.Value, ir.Operation, ir.OpView]],
- *,
- name: StringArg,
- loc=None,
- ip=None):
- name = _ensure_string_attr(name)
- super().__init__(target, name, loc=loc, ip=ip)
diff --git a/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/_transform_ops_gen.py b/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/_transform_ops_gen.py
deleted file mode 100644
index c1d7d58..0000000
--- a/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/_transform_ops_gen.py
+++ /dev/null
@@ -1,928 +0,0 @@
-# Autogenerated by mlir-tblgen; don't manually edit.
-
-from ._ods_common import _cext as _ods_cext
-from ._ods_common import extend_opview_class as _ods_extend_opview_class, segmented_accessor as _ods_segmented_accessor, equally_sized_accessor as _ods_equally_sized_accessor, get_default_loc_context as _ods_get_default_loc_context, get_op_result_or_value as _get_op_result_or_value, get_op_results_or_values as _get_op_results_or_values
-
-_ods_ir = _ods_cext.ir
-
-try:
- from . import _transform_ops_ext as _ods_ext_module
-except ImportError:
- _ods_ext_module = None
-
-import builtins
-
-
-@_ods_cext.register_dialect
-class _Dialect(_ods_ir.Dialect):
- DIALECT_NAMESPACE = "transform"
- pass
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class PDLMatchOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.pdl_match"
-
- _ODS_REGIONS = (0, True)
-
- @builtins.property
- def root(self):
- return self.operation.operands[0]
-
- @builtins.property
- def matched(self):
- return self.operation.results[0]
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class WithPDLPatternsOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.with_pdl_patterns"
-
- _ODS_REGIONS = (1, True)
-
- @builtins.property
- def root(self):
- return None if len(
- self.operation.operands) < 1 else self.operation.operands[0]
-
- @builtins.property
- def body(self):
- return self.regions[0]
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class YieldOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.yield"
-
- _ODS_REGIONS = (0, True)
-
- def __init__(self, operands_, *, loc=None, ip=None):
- operands = []
- results = []
- attributes = {}
- regions = None
- operands.extend(_get_op_results_or_values(operands_))
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
-
- @builtins.property
- def operands_(self):
- _ods_variadic_group_length = len(self.operation.operands) - 1 + 1
- return self.operation.operands[0:0 + _ods_variadic_group_length]
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class BufferizeOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.bufferize"
-
- _ODS_REGIONS = (0, True)
-
- def __init__(self, *, loc=None, ip=None):
- operands = []
- results = []
- attributes = {}
- regions = None
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class CanonicalizedSequenceOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.structured.canonicalized_sequence"
-
- _ODS_REGIONS = (1, True)
-
- @builtins.property
- def target(self):
- return None if len(
- self.operation.operands) < 1 else self.operation.operands[0]
-
- @builtins.property
- def body(self):
- return self.regions[0]
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class TileOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.structured.tile"
-
- _ODS_REGIONS = (0, True)
-
- def __init__(self,
- tiled_linalg_op,
- loops,
- target,
- sizes,
- interchange,
- *,
- loc=None,
- ip=None):
- operands = []
- results = []
- attributes = {}
- regions = None
- operands.append(_get_op_result_or_value(target))
- attributes["sizes"] = sizes
- attributes["interchange"] = interchange
- results.append(tiled_linalg_op)
- results.extend(loops)
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
-
- @builtins.property
- def target(self):
- return self.operation.operands[0]
-
- @builtins.property
- def tiled_linalg_op(self):
- return self.operation.results[0]
-
- @builtins.property
- def loops(self):
- _ods_variadic_group_length = len(self.operation.results) - 2 + 1
- return self.operation.results[1:1 + _ods_variadic_group_length]
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class DecomposeOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.structured.decompose"
-
- _ODS_REGIONS = (0, True)
-
- def __init__(self, *, loc=None, ip=None):
- operands = []
- results = []
- attributes = {}
- regions = None
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class FuseOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.structured.fuse"
-
- _ODS_REGIONS = (0, True)
-
- def __init__(self,
- transformed,
- loops,
- target,
- tile_sizes,
- tile_interchange,
- *,
- loc=None,
- ip=None):
- operands = []
- results = []
- attributes = {}
- regions = None
- operands.append(_get_op_result_or_value(target))
- attributes["tile_sizes"] = tile_sizes
- attributes["tile_interchange"] = tile_interchange
- results.append(transformed)
- results.extend(loops)
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
-
- @builtins.property
- def target(self):
- return self.operation.operands[0]
-
- @builtins.property
- def transformed(self):
- return self.operation.results[0]
-
- @builtins.property
- def loops(self):
- _ods_variadic_group_length = len(self.operation.results) - 2 + 1
- return self.operation.results[1:1 + _ods_variadic_group_length]
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class GeneralizeOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.structured.generalize"
-
- _ODS_REGIONS = (0, True)
-
- def __init__(self, transformed, target, *, loc=None, ip=None):
- operands = []
- results = []
- attributes = {}
- regions = None
- operands.append(_get_op_result_or_value(target))
- results.append(transformed)
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
-
- @builtins.property
- def target(self):
- return self.operation.operands[0]
-
- @builtins.property
- def transformed(self):
- return self.operation.results[0]
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class GetParentLoopOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.get_parent_loop"
-
- _ODS_REGIONS = (0, True)
-
- def __init__(self, transformed, target, num_loops, *, loc=None, ip=None):
- operands = []
- results = []
- attributes = {}
- regions = None
- operands.append(_get_op_result_or_value(target))
- attributes["num_loops"] = num_loops
- results.append(transformed)
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
-
- @builtins.property
- def target(self):
- return self.operation.operands[0]
-
- @builtins.property
- def num_loops(self):
- return _ods_ir.IntegerAttr(self.operation.attributes["num_loops"])
-
- @num_loops.setter
- def num_loops(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["num_loops"] = value
-
- @builtins.property
- def transformed(self):
- return self.operation.results[0]
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class InterchangeOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.structured.interchange"
-
- _ODS_REGIONS = (0, True)
-
- def __init__(self,
- transformed,
- target,
- iterator_interchange,
- *,
- loc=None,
- ip=None):
- operands = []
- results = []
- attributes = {}
- regions = None
- operands.append(_get_op_result_or_value(target))
- attributes["iterator_interchange"] = iterator_interchange
- results.append(transformed)
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
-
- @builtins.property
- def target(self):
- return self.operation.operands[0]
-
- @builtins.property
- def transformed(self):
- return self.operation.results[0]
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class LowerToLLVMOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.lower_to_llvm"
-
- _ODS_REGIONS = (0, True)
-
- def __init__(self,
- reassociate_fp_reductions,
- enable_index_optimizations,
- enable_arm_neon,
- enable_arm_sve,
- enable_amx,
- enable_x86vector,
- enable_async,
- *,
- loc=None,
- ip=None):
- operands = []
- results = []
- attributes = {}
- regions = None
- attributes["reassociate_fp_reductions"] = reassociate_fp_reductions
- attributes["enable_index_optimizations"] = enable_index_optimizations
- attributes["enable_arm_neon"] = enable_arm_neon
- attributes["enable_arm_sve"] = enable_arm_sve
- attributes["enable_amx"] = enable_amx
- attributes["enable_x86vector"] = enable_x86vector
- attributes["enable_async"] = enable_async
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
-
- @builtins.property
- def reassociate_fp_reductions(self):
- return _ods_ir.BoolAttr(
- self.operation.attributes["reassociate_fp_reductions"])
-
- @reassociate_fp_reductions.setter
- def reassociate_fp_reductions(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["reassociate_fp_reductions"] = value
-
- @builtins.property
- def enable_index_optimizations(self):
- return _ods_ir.BoolAttr(
- self.operation.attributes["enable_index_optimizations"])
-
- @enable_index_optimizations.setter
- def enable_index_optimizations(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["enable_index_optimizations"] = value
-
- @builtins.property
- def enable_arm_neon(self):
- return _ods_ir.BoolAttr(self.operation.attributes["enable_arm_neon"])
-
- @enable_arm_neon.setter
- def enable_arm_neon(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["enable_arm_neon"] = value
-
- @builtins.property
- def enable_arm_sve(self):
- return _ods_ir.BoolAttr(self.operation.attributes["enable_arm_sve"])
-
- @enable_arm_sve.setter
- def enable_arm_sve(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["enable_arm_sve"] = value
-
- @builtins.property
- def enable_amx(self):
- return _ods_ir.BoolAttr(self.operation.attributes["enable_amx"])
-
- @enable_amx.setter
- def enable_amx(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["enable_amx"] = value
-
- @builtins.property
- def enable_x86vector(self):
- return _ods_ir.BoolAttr(self.operation.attributes["enable_x86vector"])
-
- @enable_x86vector.setter
- def enable_x86vector(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["enable_x86vector"] = value
-
- @builtins.property
- def enable_async(self):
- return _ods_ir.BoolAttr(self.operation.attributes["enable_async"])
-
- @enable_async.setter
- def enable_async(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["enable_async"] = value
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class LowerVectorsOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.lower_vectors"
-
- _ODS_REGIONS = (0, True)
-
- def __init__(self,
- stages,
- contraction_lowering,
- multireduction_lowering,
- split_transfers,
- unroll_vector_transfers,
- transpose_lowering,
- transpose_avx2_lowering,
- *,
- loc=None,
- ip=None):
- operands = []
- results = []
- attributes = {}
- regions = None
- attributes["stages"] = stages
- attributes["contraction_lowering"] = contraction_lowering
- attributes["multireduction_lowering"] = multireduction_lowering
- attributes["split_transfers"] = split_transfers
- attributes["unroll_vector_transfers"] = unroll_vector_transfers
- attributes["transpose_lowering"] = transpose_lowering
- attributes["transpose_avx2_lowering"] = transpose_avx2_lowering
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
-
- @builtins.property
- def contraction_lowering(self):
- return _ods_ir.StringAttr(self.operation.attributes["contraction_lowering"])
-
- @contraction_lowering.setter
- def contraction_lowering(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["contraction_lowering"] = value
-
- @builtins.property
- def multireduction_lowering(self):
- return _ods_ir.StringAttr(
- self.operation.attributes["multireduction_lowering"])
-
- @multireduction_lowering.setter
- def multireduction_lowering(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["multireduction_lowering"] = value
-
- @builtins.property
- def split_transfers(self):
- return _ods_ir.StringAttr(self.operation.attributes["split_transfers"])
-
- @split_transfers.setter
- def split_transfers(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["split_transfers"] = value
-
- @builtins.property
- def unroll_vector_transfers(self):
- return _ods_ir.BoolAttr(
- self.operation.attributes["unroll_vector_transfers"])
-
- @unroll_vector_transfers.setter
- def unroll_vector_transfers(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["unroll_vector_transfers"] = value
-
- @builtins.property
- def transpose_lowering(self):
- return _ods_ir.StringAttr(self.operation.attributes["transpose_lowering"])
-
- @transpose_lowering.setter
- def transpose_lowering(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["transpose_lowering"] = value
-
- @builtins.property
- def transpose_avx2_lowering(self):
- return _ods_ir.BoolAttr(
- self.operation.attributes["transpose_avx2_lowering"])
-
- @transpose_avx2_lowering.setter
- def transpose_avx2_lowering(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["transpose_avx2_lowering"] = value
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class OutlineLoopOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.outline_loop"
-
- _ODS_REGIONS = (0, True)
-
- def __init__(self, transformed, target, func_name, *, loc=None, ip=None):
- operands = []
- results = []
- attributes = {}
- regions = None
- operands.append(_get_op_result_or_value(target))
- attributes["func_name"] = func_name
- results.append(transformed)
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
-
- @builtins.property
- def target(self):
- return self.operation.operands[0]
-
- @builtins.property
- def func_name(self):
- return _ods_ir.StringAttr(self.operation.attributes["func_name"])
-
- @func_name.setter
- def func_name(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["func_name"] = value
-
- @builtins.property
- def transformed(self):
- return self.operation.results[0]
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class PadOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.structured.pad"
-
- _ODS_REGIONS = (0, True)
-
- def __init__(self,
- transformed,
- target,
- padding_values,
- padding_dimensions,
- pack_paddings,
- hoist_paddings,
- transpose_paddings,
- *,
- loc=None,
- ip=None):
- operands = []
- results = []
- attributes = {}
- regions = None
- operands.append(_get_op_result_or_value(target))
- attributes["padding_values"] = padding_values
- attributes["padding_dimensions"] = padding_dimensions
- attributes["pack_paddings"] = pack_paddings
- attributes["hoist_paddings"] = hoist_paddings
- attributes["transpose_paddings"] = transpose_paddings
- results.append(transformed)
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
-
- @builtins.property
- def target(self):
- return self.operation.operands[0]
-
- @builtins.property
- def transformed(self):
- return self.operation.results[0]
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class PeelLoopOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.peel_loop"
-
- _ODS_REGIONS = (0, True)
-
- def __init__(self, transformed, target, *, loc=None, ip=None):
- operands = []
- results = []
- attributes = {}
- regions = None
- operands.append(_get_op_result_or_value(target))
- results.append(transformed)
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
-
- @builtins.property
- def target(self):
- return self.operation.operands[0]
-
- @builtins.property
- def transformed(self):
- return self.operation.results[0]
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class PipelineLoopOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.pipeline_loop"
-
- _ODS_REGIONS = (0, True)
-
- def __init__(self,
- transformed,
- target,
- iteration_interval,
- read_latency,
- *,
- loc=None,
- ip=None):
- operands = []
- results = []
- attributes = {}
- regions = None
- operands.append(_get_op_result_or_value(target))
- attributes["iteration_interval"] = iteration_interval
- attributes["read_latency"] = read_latency
- results.append(transformed)
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
-
- @builtins.property
- def target(self):
- return self.operation.operands[0]
-
- @builtins.property
- def iteration_interval(self):
- return _ods_ir.IntegerAttr(self.operation.attributes["iteration_interval"])
-
- @iteration_interval.setter
- def iteration_interval(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["iteration_interval"] = value
-
- @builtins.property
- def read_latency(self):
- return _ods_ir.IntegerAttr(self.operation.attributes["read_latency"])
-
- @read_latency.setter
- def read_latency(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["read_latency"] = value
-
- @builtins.property
- def transformed(self):
- return self.operation.results[0]
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class PrintOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.print"
-
- _ODS_REGIONS = (0, True)
-
- def __init__(self, target, name, *, loc=None, ip=None):
- operands = []
- results = []
- attributes = {}
- regions = None
- if target is not None:
- operands.append(_get_op_result_or_value(target))
- attributes["name"] = name
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
-
- @builtins.property
- def target(self):
- return None if len(
- self.operation.operands) < 1 else self.operation.operands[0]
-
- @builtins.property
- def name(self):
- return _ods_ir.StringAttr(self.operation.attributes["name"])
-
- @name.setter
- def name(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["name"] = value
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class ScalarizeOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.structured.scalarize"
-
- _ODS_REGIONS = (0, True)
-
- def __init__(self, result, target, *, loc=None, ip=None):
- operands = []
- results = []
- attributes = {}
- regions = None
- operands.append(_get_op_result_or_value(target))
- results.append(result)
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
-
- @builtins.property
- def target(self):
- return self.operation.operands[0]
-
- @builtins.property
- def result(self):
- return self.operation.results[0]
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class UnrollLoopOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.unroll_loop"
-
- _ODS_REGIONS = (0, True)
-
- def __init__(self, target, factor, *, loc=None, ip=None):
- operands = []
- results = []
- attributes = {}
- regions = None
- operands.append(_get_op_result_or_value(target))
- attributes["factor"] = factor
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
-
- @builtins.property
- def target(self):
- return self.operation.operands[0]
-
- @builtins.property
- def factor(self):
- return _ods_ir.IntegerAttr(self.operation.attributes["factor"])
-
- @factor.setter
- def factor(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["factor"] = value
-
-
-@_ods_cext.register_operation(_Dialect)
-@_ods_extend_opview_class(_ods_ext_module)
-class VectorizeOp(_ods_ir.OpView):
- OPERATION_NAME = "transform.structured.vectorize"
-
- _ODS_REGIONS = (0, True)
-
- def __init__(self,
- transformed,
- target,
- vectorize_padding,
- *,
- loc=None,
- ip=None):
- operands = []
- results = []
- attributes = {}
- regions = None
- if target is not None:
- operands.append(_get_op_result_or_value(target))
- attributes["vectorize_padding"] = vectorize_padding
- if transformed is not None:
- results.append(transformed)
- _ods_successors = None
- super().__init__(
- self.build_generic(attributes=attributes,
- results=results,
- operands=operands,
- successors=_ods_successors,
- regions=regions,
- loc=loc,
- ip=ip))
-
- @builtins.property
- def target(self):
- return None if len(
- self.operation.operands) < 1 else self.operation.operands[0]
-
- @builtins.property
- def vectorize_padding(self):
- return _ods_ir.BoolAttr(self.operation.attributes["vectorize_padding"])
-
- @vectorize_padding.setter
- def vectorize_padding(self, value):
- if value is None:
- raise ValueError("'None' not allowed as value for mandatory attributes")
- self.operation.attributes["vectorize_padding"] = value
-
- @builtins.property
- def transformed(self):
- return None if len(
- self.operation.results) < 1 else self.operation.results[0]
diff --git a/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/transform.py b/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/transform/iree_structured.py
similarity index 71%
rename from llvm-external-projects/iree-dialects/python/iree/compiler/dialects/transform.py
rename to llvm-external-projects/iree-dialects/python/iree/compiler/dialects/transform/iree_structured.py
index 9d6d174..563e20b 100644
--- a/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/transform.py
+++ b/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/transform/iree_structured.py
@@ -4,5 +4,4 @@
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-from ._transform_ops_gen import *
-from .._mlir_libs._ireeDialects.transform import *
+from .._iree_structured_transform_ops_gen import *
diff --git a/llvm-external-projects/iree-dialects/test/python/smoketest.py b/llvm-external-projects/iree-dialects/test/python/smoketest.py
index 90a0a78..d8b1f97 100644
--- a/llvm-external-projects/iree-dialects/test/python/smoketest.py
+++ b/llvm-external-projects/iree-dialects/test/python/smoketest.py
@@ -3,13 +3,13 @@
import iree.compiler.ir
from iree.compiler.dialects import iree_input as iree_d
from iree.compiler.dialects import iree_linalg_ext
-from iree.compiler.dialects import transform
+from iree.compiler.dialects import iree_linalg_transform
from iree.compiler.dialects import iree_pydm as pydm_d
with iree.compiler.ir.Context() as ctx:
iree_d.register_dialect()
iree_linalg_ext.register_dialect()
- transform.register_dialect()
+ iree_linalg_transform.register_dialect()
pydm_d.register_dialect()
# iree_pydm types.