1 ; Simple checks of -exec-on-ir-change=cat functionality
3 ; Simple functionality check.
4 ; RUN: opt -S -exec-on-ir-change=cat -passes=instsimplify 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-SIMPLE
6 ; Check that only the passes that change the IR are printed and that the
7 ; others (including g) are filtered out.
8 ; RUN: opt -S -exec-on-ir-change=cat -passes=instsimplify -filter-print-funcs=f 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FUNC-FILTER
10 ; Check that the reporting of IRs respects -print-module-scope
11 ; RUN: opt -S -exec-on-ir-change=cat -passes=instsimplify -print-module-scope 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-PRINT-MOD-SCOPE
13 ; Check that the reporting of IRs respects -print-module-scope
14 ; RUN: opt -S -exec-on-ir-change=cat -passes=instsimplify -filter-print-funcs=f -print-module-scope 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FUNC-FILTER-MOD-SCOPE
16 ; Check that reporting of multiple functions happens
17 ; RUN: opt -S -exec-on-ir-change=cat -passes=instsimplify -filter-print-funcs="f,g" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FILTER-MULT-FUNC
19 ; Check that the reporting of IRs respects -filter-passes
20 ; RUN: opt -S -exec-on-ir-change=cat -passes="instsimplify,no-op-function" -filter-passes="no-op-function" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FILTER-PASSES
22 ; Check that the reporting of IRs respects -filter-passes with multiple passes
23 ; RUN: opt -S -exec-on-ir-change=cat -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FILTER-MULT-PASSES
25 ; Check that the reporting of IRs respects both -filter-passes and -filter-print-funcs
26 ; RUN: opt -S -exec-on-ir-change=cat -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -filter-print-funcs=f 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FILTER-FUNC-PASSES
28 ; Check that the reporting of IRs respects -filter-passes, -filter-print-funcs and -print-module-scope
29 ; RUN: opt -S -exec-on-ir-change=cat -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -filter-print-funcs=f -print-module-scope 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FILTER-FUNC-PASSES-MOD-SCOPE
31 ; Check that repeated passes that change the IR are printed and that the
32 ; others (including g) are filtered out. Note that the second time
33 ; instsimplify is run on f, it does not change the IR
34 ; RUN: opt -S -exec-on-ir-change=cat -passes="instsimplify,instsimplify" -filter-print-funcs=f 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-MULT-PASSES-FILTER-FUNC
49 ; CHECK-SIMPLE: ; ModuleID = {{.+}}
50 ; CHECK-SIMPLE: cat:{{.*}}Initial IR
51 ; CHECK-SIMPLE: define i32 @g()
52 ; CHECK-SIMPLE: cat:{{.*}}InstSimplifyPass
53 ; CHECK-SIMPLE: define i32 @f()
54 ; CHECK-SIMPLE: cat:{{.*}}InstSimplifyPass
56 ; CHECK-FUNC-FILTER: define i32 @f()
57 ; CHECK-FUNC-FILTER: cat:{{.*}}Initial IR
58 ; CHECK-FUNC-FILTER: define i32 @f()
59 ; CHECK-FUNC-FILTER: cat:{{.*}}InstSimplifyPass
61 ; CHECK-PRINT-MOD-SCOPE: ModuleID = {{.+}}
62 ; CHECK-PRINT-MOD-SCOPE: cat:{{.*}}Initial IR
63 ; CHECK-PRINT-MOD-SCOPE: ModuleID = {{.+}}
64 ; CHECK-PRINT-MOD-SCOPE: cat:{{.*}}InstSimplifyPass
65 ; CHECK-PRINT-MOD-SCOPE: ModuleID = {{.+}}
66 ; CHECK-PRINT-MOD-SCOPE: cat:{{.*}}InstSimplifyPass
68 ; CHECK-FUNC-FILTER-MOD-SCOPE: ; ModuleID = {{.+}}
69 ; CHECK-FUNC-FILTER-MOD-SCOPE: cat:{{.*}}Initial IR
70 ; CHECK-FUNC-FILTER-MOD-SCOPE: ModuleID = {{.+}}
71 ; CHECK-FUNC-FILTER-MOD-SCOPE: cat:{{.*}}InstSimplifyPass
73 ; CHECK-FILTER-MULT-FUNC: define i32 @g()
74 ; CHECK-FILTER-MULT-FUNC: cat:{{.*}}Initial IR
75 ; CHECK-FILTER-MULT-FUNC: define i32 @g()
76 ; CHECK-FILTER-MULT-FUNC: cat:{{.*}}InstSimplifyPass
77 ; CHECK-FILTER-MULT-FUNC: define i32 @f()
78 ; CHECK-FILTER-MULT-FUNC: cat:{{.*}}InstSimplifyPass
80 ; CHECK-FILTER-PASSES: define i32 @g()
81 ; CHECK-FILTER-PASSES: cat:{{.*}}Initial IR
83 ; CHECK-FILTER-MULT-PASSES: define i32 @g()
84 ; CHECK-FILTER-MULT-PASSES: cat:{{.*}}Initial IR
85 ; CHECK-FILTER-MULT-PASSES: define i32 @g()
86 ; CHECK-FILTER-MULT-PASSES: cat:{{.*}}InstSimplifyPass
87 ; CHECK-FILTER-MULT-PASSES: define i32 @f()
88 ; CHECK-FILTER-MULT-PASSES: cat:{{.*}}InstSimplifyPass
90 ; CHECK-FILTER-FUNC-PASSES: define i32 @f()
91 ; CHECK-FILTER-FUNC-PASSES: cat:{{.*}}Initial IR
92 ; CHECK-FILTER-FUNC-PASSES: define i32 @f()
93 ; CHECK-FILTER-FUNC-PASSES: cat:{{.*}}InstSimplifyPass
95 ; CHECK-FILTER-FUNC-PASSES-MOD-SCOPE: ; ModuleID = {{.+}}
96 ; CHECK-FILTER-FUNC-PASSES-MOD-SCOPE: cat:{{.*}}Initial IR
97 ; CHECK-FILTER-FUNC-PASSES-MOD-SCOPE: ModuleID = {{.+}}
98 ; CHECK-FILTER-FUNC-PASSES-MOD-SCOPE: cat:{{.*}}InstSimplifyPass
100 ; CHECK-MULT-PASSES-FILTER-FUNC: define i32 @f()
101 ; CHECK-MULT-PASSES-FILTER-FUNC: cat:{{.*}}Initial IR
102 ; CHECK-MULT-PASSES-FILTER-FUNC: define i32 @f()
103 ; CHECK-MULT-PASSES-FILTER-FUNC: cat:{{.*}}InstSimplifyPass