annotate mlir/test/Pass/pipeline-parsing.mlir @ 256:7d9b19ec7a62

cbclang output is still wrong
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 18 Aug 2023 18:48:47 +0900
parents 1f2b6ac9f198
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
1 // RUN: mlir-opt %s -mlir-disable-threading -pass-pipeline='builtin.module(builtin.module(test-module-pass,func.func(test-function-pass)),func.func(test-function-pass),func.func(cse,canonicalize))' -verify-each=false -mlir-timing -mlir-timing-display=tree 2>&1 | FileCheck %s
223
5f17cb93ff66 LLVM13 (2021/7/18)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 221
diff changeset
2 // RUN: mlir-opt %s -mlir-disable-threading -test-textual-pm-nested-pipeline -verify-each=false -mlir-timing -mlir-timing-display=tree 2>&1 | FileCheck %s --check-prefix=TEXTUAL_CHECK
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
3 // RUN: mlir-opt %s -mlir-disable-threading -pass-pipeline='builtin.module(builtin.module(test-module-pass),any(test-interface-pass),any(test-interface-pass),func.func(test-function-pass),any(canonicalize),func.func(cse))' -verify-each=false -mlir-timing -mlir-timing-display=tree 2>&1 | FileCheck %s --check-prefix=GENERIC_MERGE_CHECK
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
4 // RUN: mlir-opt %s -mlir-disable-threading -pass-pipeline=' builtin.module ( builtin.module( func.func( test-function-pass, print-op-stats{ json=false } ) ) ) ' -verify-each=false -mlir-timing -mlir-timing-display=tree 2>&1 | FileCheck %s --check-prefix=PIPELINE_STR_WITH_SPACES_CHECK
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
5 // RUN: not mlir-opt %s -pass-pipeline='any(builtin.module(test-module-pass)' 2>&1 | FileCheck --check-prefix=CHECK_ERROR_1 %s
236
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
6 // RUN: not mlir-opt %s -pass-pipeline='builtin.module(test-module-pass))' 2>&1 | FileCheck --check-prefix=CHECK_ERROR_2 %s
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
7 // RUN: not mlir-opt %s -pass-pipeline='any(builtin.module()()' 2>&1 | FileCheck --check-prefix=CHECK_ERROR_3 %s
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
8 // RUN: not mlir-opt %s -pass-pipeline='any(,)' 2>&1 | FileCheck --check-prefix=CHECK_ERROR_4 %s
236
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
9 // RUN: not mlir-opt %s -pass-pipeline='func.func(test-module-pass)' 2>&1 | FileCheck --check-prefix=CHECK_ERROR_5 %s
150
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 // CHECK_ERROR_1: encountered unbalanced parentheses while parsing pipeline
anatofuz
parents:
diff changeset
12 // CHECK_ERROR_2: encountered extra closing ')' creating unbalanced parentheses while parsing pipeline
anatofuz
parents:
diff changeset
13 // CHECK_ERROR_3: expected ',' after parsing pipeline
anatofuz
parents:
diff changeset
14 // CHECK_ERROR_4: does not refer to a registered pass or pass pipeline
236
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
15 // CHECK_ERROR_5: Can't add pass '{{.*}}TestModulePass' restricted to 'builtin.module' on a PassManager intended to run on 'func.func', did you intend to nest?
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
16
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
17 // RUN: not mlir-opt %s -pass-pipeline='' -cse 2>&1 | FileCheck --check-prefix=CHECK_ERROR_6 %s
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
18 // CHECK_ERROR_6: '-pass-pipeline' option can't be used with individual pass options
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
19
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
20 // RUN: not mlir-opt %s -pass-pipeline='wrong-op()' 2>&1 | FileCheck --check-prefix=CHECK_ERROR_7 %s
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
21 // CHECK_ERROR_7: can't run 'wrong-op' pass manager on 'builtin.module' op
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
22
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
23 // RUN: mlir-opt %s -pass-pipeline='any(cse)' -dump-pass-pipeline 2>&1 | FileCheck %s -check-prefix=CHECK_ROUNDTRIP
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
24 // CHECK_ROUNDTRIP: any(cse)
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
25
236
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
26 func.func @foo() {
150
anatofuz
parents:
diff changeset
27 return
anatofuz
parents:
diff changeset
28 }
anatofuz
parents:
diff changeset
29
anatofuz
parents:
diff changeset
30 module {
236
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
31 func.func @foo() {
150
anatofuz
parents:
diff changeset
32 return
anatofuz
parents:
diff changeset
33 }
anatofuz
parents:
diff changeset
34 }
anatofuz
parents:
diff changeset
35
236
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
36 // CHECK: Pipeline Collection : ['builtin.module', 'func.func']
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
37 // CHECK-NEXT: 'func.func' Pipeline
150
anatofuz
parents:
diff changeset
38 // CHECK-NEXT: TestFunctionPass
anatofuz
parents:
diff changeset
39 // CHECK-NEXT: CSE
anatofuz
parents:
diff changeset
40 // CHECK-NEXT: DominanceInfo
anatofuz
parents:
diff changeset
41 // CHECK-NEXT: Canonicalizer
236
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
42 // CHECK-NEXT: 'builtin.module' Pipeline
150
anatofuz
parents:
diff changeset
43 // CHECK-NEXT: TestModulePass
236
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
44 // CHECK-NEXT: 'func.func' Pipeline
150
anatofuz
parents:
diff changeset
45 // CHECK-NEXT: TestFunctionPass
anatofuz
parents:
diff changeset
46
236
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
47 // TEXTUAL_CHECK: Pipeline Collection : ['builtin.module', 'func.func']
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
48 // TEXTUAL_CHECK-NEXT: 'func.func' Pipeline
150
anatofuz
parents:
diff changeset
49 // TEXTUAL_CHECK-NEXT: TestFunctionPass
236
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
50 // TEXTUAL_CHECK-NEXT: 'builtin.module' Pipeline
150
anatofuz
parents:
diff changeset
51 // TEXTUAL_CHECK-NEXT: TestModulePass
236
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
52 // TEXTUAL_CHECK-NEXT: 'func.func' Pipeline
150
anatofuz
parents:
diff changeset
53 // TEXTUAL_CHECK-NEXT: TestFunctionPass
236
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
54
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
55 // PIPELINE_STR_WITH_SPACES_CHECK: 'builtin.module' Pipeline
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
56 // PIPELINE_STR_WITH_SPACES_CHECK-NEXT: 'func.func' Pipeline
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
57 // PIPELINE_STR_WITH_SPACES_CHECK-NEXT: TestFunctionPass
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
58 // PIPELINE_STR_WITH_SPACES_CHECK-NEXT: PrintOpStats
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
59
236
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
60 // Check that generic pass pipelines are only merged when they aren't
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
61 // going to overlap with op-specific pipelines.
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
62 // GENERIC_MERGE_CHECK: Pipeline Collection : ['builtin.module', 'any']
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
63 // GENERIC_MERGE_CHECK-NEXT: 'any' Pipeline
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
64 // GENERIC_MERGE_CHECK-NEXT: TestInterfacePass
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
65 // GENERIC_MERGE_CHECK-NEXT: 'builtin.module' Pipeline
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
66 // GENERIC_MERGE_CHECK-NEXT: TestModulePass
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
67 // GENERIC_MERGE_CHECK-NEXT: 'any' Pipeline
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
68 // GENERIC_MERGE_CHECK-NEXT: TestInterfacePass
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
69 // GENERIC_MERGE_CHECK-NEXT: 'func.func' Pipeline
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
70 // GENERIC_MERGE_CHECK-NEXT: TestFunctionPass
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
71 // GENERIC_MERGE_CHECK-NEXT: 'any' Pipeline
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
72 // GENERIC_MERGE_CHECK-NEXT: Canonicalizer
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
73 // GENERIC_MERGE_CHECK-NEXT: 'func.func' Pipeline
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
74 // GENERIC_MERGE_CHECK-NEXT: CSE
c4bab56944e8 LLVM 16
kono
parents: 223
diff changeset
75 // GENERIC_MERGE_CHECK-NEXT: (A) DominanceInfo