xref: /llvm-project/mlir/test/Transforms/test-canonicalize-filter.mlir (revision 13bd41096286305ee603428f6adf161f52981827)
1// RUN: mlir-opt %s -pass-pipeline='builtin.module(func.func(canonicalize))' | FileCheck %s --check-prefix=NO_FILTER
2// RUN: mlir-opt %s -pass-pipeline='builtin.module(func.func(canonicalize{enable-patterns=TestRemoveOpWithInnerOps}))' | FileCheck %s --check-prefix=FILTER_ENABLE
3// RUN: mlir-opt %s -pass-pipeline='builtin.module(func.func(canonicalize{disable-patterns=TestRemoveOpWithInnerOps}))' | FileCheck %s --check-prefix=FILTER_DISABLE
4
5// NO_FILTER-LABEL: func @remove_op_with_inner_ops_pattern
6// NO_FILTER-NEXT: return
7// FILTER_ENABLE-LABEL: func @remove_op_with_inner_ops_pattern
8// FILTER_ENABLE-NEXT: return
9// FILTER_DISABLE-LABEL: func @remove_op_with_inner_ops_pattern
10// FILTER_DISABLE-NEXT: "test.op_with_region_pattern"()
11func.func @remove_op_with_inner_ops_pattern() {
12  "test.op_with_region_pattern"() ({
13    "test.op_with_region_terminator"() : () -> ()
14  }) : () -> ()
15  return
16}
17