diff --git a/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td b/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td index 79c0e6266c82..4f845bcfcafa 100644 --- a/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td +++ b/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td @@ -767,9 +767,17 @@ def VectorizeOp : Op:$vectorize_padding, - DefaultValuedAttr:$disable_multi_reduction_to_contract_patterns, - DefaultValuedAttr:$disable_transfer_permutation_map_lowering_patterns); + UnitAttr:$vectorize_padding, + UnitAttr:$disable_multi_reduction_to_contract_patterns, + UnitAttr:$disable_transfer_permutation_map_lowering_patterns); let results = (outs PDL_Operation:$transformed); let assemblyFormat = "$target attr-dict"; - let extraClassDeclaration = [{ ::mlir::DiagnosedSilenceableFailure applyToOne( ::mlir::Operation *target, diff --git a/mlir/python/mlir/dialects/_structured_transform_ops_ext.py b/mlir/python/mlir/dialects/_structured_transform_ops_ext.py index faf98ef49c30..eddc384f64aa 100644 --- a/mlir/python/mlir/dialects/_structured_transform_ops_ext.py +++ b/mlir/python/mlir/dialects/_structured_transform_ops_ext.py @@ -287,7 +287,7 @@ class VectorizeOp: ip=None): pdl_operation_type = pdl.OperationType.get() if isinstance(vectorize_padding, bool): - vectorize_padding = BoolAttr.get(vectorize_padding) + vectorize_padding = UnitAttr.get() super().__init__( pdl_operation_type, _get_op_result_or_value(target), diff --git a/mlir/test/Dialect/Linalg/transform-op-vectorize.mlir b/mlir/test/Dialect/Linalg/transform-op-vectorize.mlir index b155a9d175e9..10ba19163b64 100644 --- a/mlir/test/Dialect/Linalg/transform-op-vectorize.mlir +++ b/mlir/test/Dialect/Linalg/transform-op-vectorize.mlir @@ -130,7 +130,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 {vectorize_padding = true} + %2 = transform.structured.vectorize %1 {vectorize_padding} } } diff --git a/mlir/test/Dialect/Linalg/vectorization.mlir b/mlir/test/Dialect/Linalg/vectorization.mlir index 6ac2fdbbdc57..a9ec8621c12a 100644 --- a/mlir/test/Dialect/Linalg/vectorization.mlir +++ b/mlir/test/Dialect/Linalg/vectorization.mlir @@ -18,7 +18,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["linalg.dot"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns = true } + %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns } } } @@ -40,7 +40,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["linalg.matvec"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns = true } + %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns } } } @@ -61,7 +61,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns = true } + %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns } } } @@ -83,7 +83,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["linalg.batch_matmul"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns = true } + %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns } } } @@ -126,7 +126,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns = true, disable_transfer_permutation_map_lowering_patterns = true } + %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns } } } @@ -169,7 +169,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns = true, disable_transfer_permutation_map_lowering_patterns = true } + %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns } } } @@ -199,7 +199,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns = true, disable_transfer_permutation_map_lowering_patterns = true } + %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns } } } @@ -242,7 +242,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns = true, disable_transfer_permutation_map_lowering_patterns = true } + %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns } } } @@ -265,7 +265,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns = true } + %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns } } } @@ -553,7 +553,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 {disable_transfer_permutation_map_lowering_patterns = true } + %2 = transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns } } } @@ -647,7 +647,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns = true } + %2 = transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns } } } @@ -694,7 +694,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 {disable_transfer_permutation_map_lowering_patterns = true } + %2 = transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns } } } @@ -740,7 +740,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 {disable_transfer_permutation_map_lowering_patterns = true } + %2 = transform.structured.vectorize %1 { disable_transfer_permutation_map_lowering_patterns } } } @@ -775,7 +775,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns = true, disable_transfer_permutation_map_lowering_patterns = true } + %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns } } } @@ -807,7 +807,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 { vectorize_padding = true } + %2 = transform.structured.vectorize %1 { vectorize_padding } } } @@ -839,7 +839,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 { vectorize_padding = true } + %2 = transform.structured.vectorize %1 { vectorize_padding } } } @@ -879,7 +879,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 { vectorize_padding = true } + %2 = transform.structured.vectorize %1 { vectorize_padding } } } @@ -913,7 +913,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["tensor.pad"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 { vectorize_padding = true } + %2 = transform.structured.vectorize %1 { vectorize_padding } } } @@ -949,7 +949,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %3 = transform.structured.match ops{["tensor.pad"]} in %arg1 %4 = get_closest_isolated_parent %3 - %5 = transform.structured.vectorize %4 { vectorize_padding = true } + %5 = transform.structured.vectorize %4 { vectorize_padding } } } @@ -989,7 +989,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %3 = transform.structured.match ops{["tensor.pad"]} in %arg1 %4 = get_closest_isolated_parent %3 - %5 = transform.structured.vectorize %4 { vectorize_padding = true } + %5 = transform.structured.vectorize %4 { vectorize_padding } } } @@ -1026,7 +1026,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %3 = transform.structured.match ops{["tensor.pad"]} in %arg1 %4 = get_closest_isolated_parent %3 - %5 = transform.structured.vectorize %4 { vectorize_padding = true } + %5 = transform.structured.vectorize %4 { vectorize_padding } } } @@ -1097,7 +1097,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %3 = transform.structured.match ops{["tensor.pad"]} in %arg1 %4 = get_closest_isolated_parent %3 - %5 = transform.structured.vectorize %4 { vectorize_padding = true } + %5 = transform.structured.vectorize %4 { vectorize_padding } } } @@ -1183,7 +1183,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 %4 = get_closest_isolated_parent %3 - %5 = transform.structured.vectorize %4 { disable_multi_reduction_to_contract_patterns = true, disable_transfer_permutation_map_lowering_patterns = true } + %5 = transform.structured.vectorize %4 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns } } } @@ -1216,7 +1216,7 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %3 = transform.structured.match ops{["linalg.generic"]} in %arg1 %4 = get_closest_isolated_parent %3 - %5 = transform.structured.vectorize %4 { vectorize_padding = true } + %5 = transform.structured.vectorize %4 { vectorize_padding } } } @@ -1586,6 +1586,6 @@ transform.with_pdl_patterns { ^bb1(%arg1: !pdl.operation): %0 = transform.structured.match ops{["linalg.generic"]} in %arg1 %1 = get_closest_isolated_parent %0 - %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns = true, disable_transfer_permutation_map_lowering_patterns = true } + %2 = transform.structured.vectorize %1 { disable_multi_reduction_to_contract_patterns, disable_transfer_permutation_map_lowering_patterns } } -} \ No newline at end of file +} diff --git a/mlir/test/python/dialects/transform_structured_ext.py b/mlir/test/python/dialects/transform_structured_ext.py index 15c87d6d7b17..456b76ca591b 100644 --- a/mlir/test/python/dialects/transform_structured_ext.py +++ b/mlir/test/python/dialects/transform_structured_ext.py @@ -178,4 +178,4 @@ def testVectorize(): # CHECK-LABEL: TEST: testVectorize # CHECK: transform.sequence # CHECK: = transform.structured.vectorize - # CHECK: vectorize_padding = true + # CHECK: {vectorize_padding}