Skip to content

Commit 718818a

Browse files
authored
[MLIR][Linalg][Transform] Expose more args in VectorizeChildren[...] op's Python bindings (llvm#166134)
Expose missing boolean arguments in `VectorizeChildrenAndApplyPatternsOp` Python bindings.
1 parent 2a65fab commit 718818a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

mlir/python/mlir/dialects/transform/structured.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,8 @@ def __init__(
713713
disable_transfer_permutation_map_lowering_patterns: bool = False,
714714
vectorize_nd_extract: bool = False,
715715
vectorize_padding: bool = False,
716+
flatten_1d_depthwise_conv: bool = False,
717+
fold_type_extensions_into_contract: bool = False,
716718
loc=None,
717719
ip=None,
718720
):
@@ -722,8 +724,10 @@ def __init__(
722724
target,
723725
disable_multi_reduction_to_contract_patterns=disable_multi_reduction_to_contract_patterns,
724726
disable_transfer_permutation_map_lowering_patterns=disable_transfer_permutation_map_lowering_patterns,
727+
flatten_1d_depthwise_conv=flatten_1d_depthwise_conv,
725728
vectorize_nd_extract=vectorize_nd_extract,
726729
vectorize_padding=vectorize_padding,
730+
fold_type_extensions_into_contract=fold_type_extensions_into_contract,
727731
loc=loc,
728732
ip=ip,
729733
)

mlir/test/python/dialects/transform_structured_ext.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,12 +627,16 @@ def testVectorizeChildrenAndApplyPatternsAllAttrs(target):
627627
disable_transfer_permutation_map_lowering_patterns=True,
628628
vectorize_nd_extract=True,
629629
vectorize_padding=True,
630+
flatten_1d_depthwise_conv=True,
631+
fold_type_extensions_into_contract=True,
630632
)
631633
# CHECK-LABEL: TEST: testVectorizeChildrenAndApplyPatternsAllAttrs
632634
# CHECK: transform.sequence
633635
# CHECK: = transform.structured.vectorize
634636
# CHECK-SAME: disable_multi_reduction_to_contract_patterns
635637
# CHECK-SAME: disable_transfer_permutation_map_lowering_patterns
638+
# CHECK-SAME: flatten_1d_depthwise_conv
639+
# CHECK-SAME: fold_type_extensions_into_contract
636640
# CHECK-SAME: vectorize_nd_extract
637641
# CHECK-SAME: vectorize_padding
638642

@@ -646,12 +650,16 @@ def testVectorizeChildrenAndApplyPatternsNoAttrs(target):
646650
disable_transfer_permutation_map_lowering_patterns=False,
647651
vectorize_nd_extract=False,
648652
vectorize_padding=False,
653+
flatten_1d_depthwise_conv=False,
654+
fold_type_extensions_into_contract=False,
649655
)
650656
# CHECK-LABEL: TEST: testVectorizeChildrenAndApplyPatternsNoAttrs
651657
# CHECK: transform.sequence
652658
# CHECK: = transform.structured.vectorize
653659
# CHECK-NOT: disable_multi_reduction_to_contract_patterns
654660
# CHECK-NOT: disable_transfer_permutation_map_lowering_patterns
661+
# CHECK-NOT: flatten_1d_depthwise_conv
662+
# CHECK-NOT: fold_type_extensions_into_contract
655663
# CHECK-NOT: vectorize_nd_extract
656664
# CHECK-NOT: vectorize_padding
657665

0 commit comments

Comments
 (0)