[llvm-nm] - Fix a bug and unbreak ASan BB.
[llvm-complete.git] / test / Other / new-pass-manager.ll
blobd769319ea1ca46ca700644fcc6df07230480b0cb
1 ; This test is essentially doing very basic things with the opt tool and the
2 ; new pass manager pipeline. It will be used to flesh out the feature
3 ; completeness of the opt tool when the new pass manager is engaged. The tests
4 ; may not be useful once it becomes the default or may get spread out into other
5 ; files, but for now this is just going to step the new process through its
6 ; paces.
8 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
9 ; RUN:     -passes=no-op-module %s 2>&1 \
10 ; RUN:     | FileCheck %s --check-prefix=CHECK-MODULE-PASS
11 ; CHECK-MODULE-PASS: Starting llvm::Module pass manager run
12 ; CHECK-MODULE-PASS-NEXT: Running pass: NoOpModulePass
13 ; CHECK-MODULE-PASS-NEXT: Finished llvm::Module pass manager run
15 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
16 ; RUN:     -passes=no-op-cgscc %s 2>&1 \
17 ; RUN:     | FileCheck %s --check-prefix=CHECK-CGSCC-PASS
18 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
19 ; RUN:     -passes='cgscc(no-op-cgscc)' %s 2>&1 \
20 ; RUN:     | FileCheck %s --check-prefix=CHECK-CGSCC-PASS
21 ; CHECK-CGSCC-PASS: Starting llvm::Module pass manager run
22 ; CHECK-CGSCC-PASS-NEXT: Running pass: ModuleToPostOrderCGSCCPassAdaptor
23 ; CHECK-CGSCC-PASS-NEXT: Running analysis: InnerAnalysisManagerProxy<{{.*(CGSCCAnalysisManager|AnalysisManager<.*LazyCallGraph::SCC.*>).*}},{{.*}}Module>
24 ; CHECK-CGSCC-PASS-NEXT: Running analysis: InnerAnalysisManagerProxy<{{.*(FunctionAnalysisManager|AnalysisManager<.*Function.*>).*}},{{.*}}Module>
25 ; CHECK-CGSCC-PASS-NEXT: Running analysis: LazyCallGraphAnalysis
26 ; CHECK-CGSCC-PASS-NEXT: Running analysis: TargetLibraryAnalysis
27 ; CHECK-CGSCC-PASS-NEXT: Running analysis: PassInstrumentationAnalysis
28 ; CHECK-CGSCC-PASS-NEXT: Running analysis: FunctionAnalysisManagerCGSCCProxy
29 ; CHECK-CGSCC-PASS-NEXT: Running analysis: PassInstrumentationAnalysis
30 ; CHECK-CGSCC-PASS-NEXT: Running analysis: OuterAnalysisManagerProxy<{{.*}}LazyCallGraph::SCC{{.*}}>
31 ; CHECK-CGSCC-PASS-NEXT: Starting CGSCC pass manager run
32 ; CHECK-CGSCC-PASS-NEXT: Running pass: NoOpCGSCCPass
33 ; CHECK-CGSCC-PASS-NEXT: Finished CGSCC pass manager run
34 ; CHECK-CGSCC-PASS-NEXT: Finished llvm::Module pass manager run
36 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
37 ; RUN:     -passes=no-op-function %s 2>&1 \
38 ; RUN:     | FileCheck %s --check-prefix=CHECK-FUNCTION-PASS
39 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
40 ; RUN:     -passes='function(no-op-function)' %s 2>&1 \
41 ; RUN:     | FileCheck %s --check-prefix=CHECK-FUNCTION-PASS
42 ; CHECK-FUNCTION-PASS: Starting llvm::Module pass manager run
43 ; CHECK-FUNCTION-PASS-NEXT: Running pass: ModuleToFunctionPassAdaptor
44 ; CHECK-FUNCTION-PASS-NEXT: Running analysis: InnerAnalysisManagerProxy<{{.*}}>
45 ; CHECK-FUNCTION-PASS-NEXT: Running analysis: PassInstrumentationAnalysis
46 ; CHECK-FUNCTION-PASS-NEXT: Starting llvm::Function pass manager run
47 ; CHECK-FUNCTION-PASS-NEXT: Running pass: NoOpFunctionPass
48 ; CHECK-FUNCTION-PASS-NEXT: Finished llvm::Function pass manager run
49 ; CHECK-FUNCTION-PASS-NEXT: Finished llvm::Module pass manager run
51 ; RUN: opt -disable-output -debug-pass-manager -passes=print %s 2>&1 \
52 ; RUN:     | FileCheck %s --check-prefix=CHECK-MODULE-PRINT
53 ; CHECK-MODULE-PRINT: Starting llvm::Module pass manager run
54 ; CHECK-MODULE-PRINT: Running pass: VerifierPass
55 ; CHECK-MODULE-PRINT: Running pass: PrintModulePass
56 ; CHECK-MODULE-PRINT: ModuleID
57 ; CHECK-MODULE-PRINT: define void @foo(i1 %x, i8* %p1, i8* %p2)
58 ; CHECK-MODULE-PRINT: Running pass: VerifierPass
59 ; CHECK-MODULE-PRINT: Finished llvm::Module pass manager run
61 ; RUN: opt -disable-output -debug-pass-manager -disable-verify -passes='print,verify' %s 2>&1 \
62 ; RUN:     | FileCheck %s --check-prefix=CHECK-MODULE-VERIFY
63 ; CHECK-MODULE-VERIFY: Starting llvm::Module pass manager run
64 ; CHECK-MODULE-VERIFY: Running pass: PrintModulePass
65 ; CHECK-MODULE-VERIFY: ModuleID
66 ; CHECK-MODULE-VERIFY: define void @foo(i1 %x, i8* %p1, i8* %p2)
67 ; CHECK-MODULE-VERIFY: Running pass: VerifierPass
68 ; CHECK-MODULE-VERIFY: Finished llvm::Module pass manager run
70 ; RUN: opt -disable-output -debug-pass-manager -passes='function(print)' %s 2>&1 \
71 ; RUN:     | FileCheck %s --check-prefix=CHECK-FUNCTION-PRINT
72 ; CHECK-FUNCTION-PRINT: Starting llvm::Module pass manager run
73 ; CHECK-FUNCTION-PRINT: Running pass: VerifierPass
74 ; CHECK-FUNCTION-PRINT: Running pass: ModuleToFunctionPassAdaptor
75 ; CHECK-FUNCTION-PRINT: Running analysis: InnerAnalysisManagerProxy<{{.*}}>
76 ; CHECK-FUNCTION-PRINT: Starting llvm::Function pass manager run
77 ; CHECK-FUNCTION-PRINT: Running pass: PrintFunctionPass
78 ; CHECK-FUNCTION-PRINT-NOT: ModuleID
79 ; CHECK-FUNCTION-PRINT: define void @foo(i1 %x, i8* %p1, i8* %p2)
80 ; CHECK-FUNCTION-PRINT: Finished llvm::Function pass manager run
81 ; CHECK-FUNCTION-PRINT: Running pass: VerifierPass
82 ; CHECK-FUNCTION-PRINT: Finished llvm::Module pass manager run
84 ; RUN: opt -disable-output -debug-pass-manager -disable-verify -passes='function(print,verify)' %s 2>&1 \
85 ; RUN:     | FileCheck %s --check-prefix=CHECK-FUNCTION-VERIFY
86 ; CHECK-FUNCTION-VERIFY: Starting llvm::Module pass manager run
87 ; CHECK-FUNCTION-VERIFY: Starting llvm::Function pass manager run
88 ; CHECK-FUNCTION-VERIFY: Running pass: PrintFunctionPass
89 ; CHECK-FUNCTION-VERIFY-NOT: ModuleID
90 ; CHECK-FUNCTION-VERIFY: define void @foo(i1 %x, i8* %p1, i8* %p2)
91 ; CHECK-FUNCTION-VERIFY: Running pass: VerifierPass
92 ; CHECK-FUNCTION-VERIFY: Finished llvm::Function pass manager run
93 ; CHECK-FUNCTION-VERIFY: Finished llvm::Module pass manager run
95 ; RUN: opt -S -o - -passes='no-op-module,no-op-module' %s \
96 ; RUN:     | FileCheck %s --check-prefix=CHECK-NOOP
97 ; CHECK-NOOP: define void @foo(i1 %x, i8* %p1, i8* %p2) {
98 ; CHECK-NOOP: entry:
99 ; CHECK-NOOP:   store i8 42, i8* %p1
100 ; CHECK-NOOP:   br i1 %x, label %loop, label %exit
101 ; CHECK-NOOP: loop:
102 ; CHECK-NOOP:   %tmp1 = load i8, i8* %p2
103 ; CHECK-NOOP:   br label %loop
104 ; CHECK-NOOP: exit:
105 ; CHECK-NOOP:   ret void
106 ; CHECK-NOOP: }
108 ; Round trip through bitcode.
109 ; RUN: opt -f -o - -passes='no-op-module,no-op-module' %s \
110 ; RUN:     | llvm-dis \
111 ; RUN:     | FileCheck %s --check-prefix=CHECK-NOOP
113 ; RUN: opt -disable-output -debug-pass-manager -verify-each -passes='no-op-module,function(no-op-function)' %s 2>&1 \
114 ; RUN:     | FileCheck %s --check-prefix=CHECK-VERIFY-EACH
115 ; CHECK-VERIFY-EACH: Starting llvm::Module pass manager run
116 ; CHECK-VERIFY-EACH: Running pass: VerifierPass
117 ; CHECK-VERIFY-EACH: Running pass: NoOpModulePass
118 ; CHECK-VERIFY-EACH: Running pass: VerifierPass
119 ; CHECK-VERIFY-EACH: Starting llvm::Function pass manager run
120 ; CHECK-VERIFY-EACH: Running pass: NoOpFunctionPass
121 ; CHECK-VERIFY-EACH: Running pass: VerifierPass
122 ; CHECK-VERIFY-EACH: Finished llvm::Function pass manager run
123 ; CHECK-VERIFY-EACH: Running pass: VerifierPass
124 ; CHECK-VERIFY-EACH: Finished llvm::Module pass manager run
126 ; RUN: opt -disable-output -debug-pass-manager -disable-verify -passes='no-op-module,function(no-op-function)' %s 2>&1 \
127 ; RUN:     | FileCheck %s --check-prefix=CHECK-NO-VERIFY
128 ; CHECK-NO-VERIFY: Starting llvm::Module pass manager run
129 ; CHECK-NO-VERIFY-NOT: VerifierPass
130 ; CHECK-NO-VERIFY: Running pass: NoOpModulePass
131 ; CHECK-NO-VERIFY-NOT: VerifierPass
132 ; CHECK-NO-VERIFY: Starting llvm::Function pass manager run
133 ; CHECK-NO-VERIFY: Running pass: NoOpFunctionPass
134 ; CHECK-NO-VERIFY-NOT: VerifierPass
135 ; CHECK-NO-VERIFY: Finished llvm::Function pass manager run
136 ; CHECK-NO-VERIFY-NOT: VerifierPass
137 ; CHECK-NO-VERIFY: Finished llvm::Module pass manager run
139 ; RUN: opt -disable-output -debug-pass-manager \
140 ; RUN:     -passes='require<no-op-module>,cgscc(require<no-op-cgscc>,function(require<no-op-function>))' %s 2>&1 \
141 ; RUN:     | FileCheck %s --check-prefix=CHECK-ANALYSES
142 ; CHECK-ANALYSES: Starting llvm::Module pass manager run
143 ; CHECK-ANALYSES: Running pass: RequireAnalysisPass
144 ; CHECK-ANALYSES: Running analysis: NoOpModuleAnalysis
145 ; CHECK-ANALYSES: Starting CGSCC pass manager run
146 ; CHECK-ANALYSES: Running pass: RequireAnalysisPass
147 ; CHECK-ANALYSES: Running analysis: NoOpCGSCCAnalysis
148 ; CHECK-ANALYSES: Starting llvm::Function pass manager run
149 ; CHECK-ANALYSES: Running pass: RequireAnalysisPass
150 ; CHECK-ANALYSES: Running analysis: NoOpFunctionAnalysis
152 ; Make sure no-op passes that preserve all analyses don't even try to do any
153 ; analysis invalidation.
154 ; RUN: opt -disable-output -debug-pass-manager \
155 ; RUN:     -passes='require<no-op-module>,cgscc(require<no-op-cgscc>,function(require<no-op-function>))' %s 2>&1 \
156 ; RUN:     | FileCheck %s --check-prefix=CHECK-NO-OP-INVALIDATION
157 ; CHECK-NO-OP-INVALIDATION: Starting llvm::Module pass manager run
158 ; CHECK-NO-OP-INVALIDATION-NOT: Invalidating all non-preserved analyses
160 ; RUN: opt -disable-output -debug-pass-manager \
161 ; RUN:     -passes='require<no-op-module>,require<no-op-module>,require<no-op-module>' %s 2>&1 \
162 ; RUN:     | FileCheck %s --check-prefix=CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS
163 ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS: Starting llvm::Module pass manager run
164 ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS: Running pass: RequireAnalysisPass
165 ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS: Running analysis: NoOpModuleAnalysis
166 ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS-NOT: Running analysis: NoOpModuleAnalysis
168 ; RUN: opt -disable-output -debug-pass-manager \
169 ; RUN:     -passes='require<no-op-module>,invalidate<no-op-module>,require<no-op-module>' %s 2>&1 \
170 ; RUN:     | FileCheck %s --check-prefix=CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS
171 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Starting llvm::Module pass manager run
172 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Running pass: RequireAnalysisPass
173 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Running analysis: NoOpModuleAnalysis
174 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Invalidating analysis: NoOpModuleAnalysis
175 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Running analysis: NoOpModuleAnalysis
177 ; RUN: opt -disable-output -debug-pass-manager \
178 ; RUN:     -passes='cgscc(require<no-op-cgscc>,require<no-op-cgscc>,require<no-op-cgscc>)' %s 2>&1 \
179 ; RUN:     | FileCheck %s --check-prefix=CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS
180 ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS: Starting llvm::Module pass manager run
181 ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS: Running pass: RequireAnalysisPass
182 ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS: Running analysis: NoOpCGSCCAnalysis
183 ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS-NOT: Running analysis: NoOpCGSCCAnalysis
185 ; RUN: opt -disable-output -debug-pass-manager \
186 ; RUN:     -passes='cgscc(require<no-op-cgscc>,invalidate<no-op-cgscc>,require<no-op-cgscc>)' %s 2>&1 \
187 ; RUN:     | FileCheck %s --check-prefix=CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS
188 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Starting llvm::Module pass manager run
189 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Running pass: RequireAnalysisPass
190 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Running analysis: NoOpCGSCCAnalysis
191 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Invalidating analysis: NoOpCGSCCAnalysis
192 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Running analysis: NoOpCGSCCAnalysis
194 ; RUN: opt -disable-output -debug-pass-manager \
195 ; RUN:     -passes='function(require<no-op-function>,require<no-op-function>,require<no-op-function>)' %s 2>&1 \
196 ; RUN:     | FileCheck %s --check-prefix=CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS
197 ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS: Starting llvm::Module pass manager run
198 ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS: Running pass: RequireAnalysisPass
199 ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS: Running analysis: NoOpFunctionAnalysis
200 ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS-NOT: Running analysis: NoOpFunctionAnalysis
202 ; RUN: opt -disable-output -debug-pass-manager \
203 ; RUN:     -passes='function(require<no-op-function>,invalidate<no-op-function>,require<no-op-function>)' %s 2>&1 \
204 ; RUN:     | FileCheck %s --check-prefix=CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS
205 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Starting llvm::Module pass manager run
206 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Running pass: RequireAnalysisPass
207 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Running analysis: NoOpFunctionAnalysis
208 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Invalidating analysis: NoOpFunctionAnalysis
209 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Running analysis: NoOpFunctionAnalysis
211 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
212 ; RUN:     -passes='require<no-op-module>,module(require<no-op-module>,function(require<no-op-function>,invalidate<all>,require<no-op-function>),require<no-op-module>),require<no-op-module>' %s 2>&1 \
213 ; RUN:     | FileCheck %s --check-prefix=CHECK-INVALIDATE-ALL
214 ; CHECK-INVALIDATE-ALL: Starting llvm::Module pass manager run
215 ; CHECK-INVALIDATE-ALL: Running pass: RequireAnalysisPass
216 ; CHECK-INVALIDATE-ALL: Running analysis: NoOpModuleAnalysis
217 ; CHECK-INVALIDATE-ALL: Starting llvm::Module pass manager run
218 ; CHECK-INVALIDATE-ALL: Running pass: RequireAnalysisPass
219 ; CHECK-INVALIDATE-ALL-NOT: Running analysis: NoOpModuleAnalysis
220 ; CHECK-INVALIDATE-ALL: Starting llvm::Function pass manager run
221 ; CHECK-INVALIDATE-ALL: Running pass: RequireAnalysisPass
222 ; CHECK-INVALIDATE-ALL: Running analysis: NoOpFunctionAnalysis
223 ; CHECK-INVALIDATE-ALL: Running pass: InvalidateAllAnalysesPass
224 ; CHECK-INVALIDATE-ALL: Invalidating analysis: NoOpFunctionAnalysis
225 ; CHECK-INVALIDATE-ALL: Running pass: RequireAnalysisPass
226 ; CHECK-INVALIDATE-ALL: Running analysis: NoOpFunctionAnalysis
227 ; CHECK-INVALIDATE-ALL: Finished llvm::Function pass manager run
228 ; CHECK-INVALIDATE-ALL: Invalidating analysis: NoOpModuleAnalysis
229 ; CHECK-INVALIDATE-ALL: Running pass: RequireAnalysisPass
230 ; CHECK-INVALIDATE-ALL: Running analysis: NoOpModuleAnalysis
231 ; CHECK-INVALIDATE-ALL: Finished llvm::Module pass manager run
232 ; CHECK-INVALIDATE-ALL-NOT: Invalidating analysis: NoOpModuleAnalysis
233 ; CHECK-INVALIDATE-ALL: Running pass: RequireAnalysisPass
234 ; CHECK-INVALIDATE-ALL-NOT: Running analysis: NoOpModuleAnalysis
235 ; CHECK-INVALIDATE-ALL: Finished llvm::Module pass manager run
237 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
238 ; RUN:     -passes='require<no-op-module>,module(require<no-op-module>,cgscc(require<no-op-cgscc>,function(require<no-op-function>,invalidate<all>,require<no-op-function>),require<no-op-cgscc>),require<no-op-module>),require<no-op-module>' %s 2>&1 \
239 ; RUN:     | FileCheck %s --check-prefix=CHECK-INVALIDATE-ALL-CG
240 ; CHECK-INVALIDATE-ALL-CG: Starting llvm::Module pass manager run
241 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
242 ; CHECK-INVALIDATE-ALL-CG: Running analysis: NoOpModuleAnalysis
243 ; CHECK-INVALIDATE-ALL-CG: Starting llvm::Module pass manager run
244 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
245 ; CHECK-INVALIDATE-ALL-CG-NOT: Running analysis: NoOpModuleAnalysis
246 ; CHECK-INVALIDATE-ALL-CG: Starting CGSCC pass manager run
247 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
248 ; CHECK-INVALIDATE-ALL-CG: Running analysis: NoOpCGSCCAnalysis
249 ; CHECK-INVALIDATE-ALL-CG: Starting llvm::Function pass manager run
250 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
251 ; CHECK-INVALIDATE-ALL-CG: Running analysis: NoOpFunctionAnalysis
252 ; CHECK-INVALIDATE-ALL-CG: Running pass: InvalidateAllAnalysesPass
253 ; CHECK-INVALIDATE-ALL-CG: Invalidating analysis: NoOpFunctionAnalysis
254 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
255 ; CHECK-INVALIDATE-ALL-CG: Running analysis: NoOpFunctionAnalysis
256 ; CHECK-INVALIDATE-ALL-CG: Finished llvm::Function pass manager run
257 ; CHECK-INVALIDATE-ALL-CG-NOT: Running analysis: NoOpFunctionAnalysis
258 ; CHECK-INVALIDATE-ALL-CG: Invalidating analysis: NoOpCGSCCAnalysis
259 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
260 ; CHECK-INVALIDATE-ALL-CG: Running analysis: NoOpCGSCCAnalysis
261 ; CHECK-INVALIDATE-ALL-CG: Finished CGSCC pass manager run
262 ; CHECK-INVALIDATE-ALL-CG-NOT: Invalidating analysis: NoOpCGSCCAnalysis
263 ; CHECK-INVALIDATE-ALL-CG: Invalidating analysis: NoOpModuleAnalysis
264 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
265 ; CHECK-INVALIDATE-ALL-CG: Running analysis: NoOpModuleAnalysis
266 ; CHECK-INVALIDATE-ALL-CG: Finished llvm::Module pass manager run
267 ; CHECK-INVALIDATE-ALL-CG-NOT: Invalidating analysis: NoOpModuleAnalysis
268 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
269 ; CHECK-INVALIDATE-ALL-CG-NOT: Running analysis: NoOpModuleAnalysis
270 ; CHECK-INVALIDATE-ALL-CG: Finished llvm::Module pass manager run
272 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
273 ; RUN:     -passes='require<targetlibinfo>,invalidate<all>,require<targetlibinfo>' \
274 ; RUN:     | FileCheck %s --check-prefix=CHECK-TLI
275 ; CHECK-TLI: Starting llvm::Module pass manager run
276 ; CHECK-TLI: Running pass: RequireAnalysisPass
277 ; CHECK-TLI: Running analysis: TargetLibraryAnalysis
278 ; CHECK-TLI: Running pass: InvalidateAllAnalysesPass
279 ; CHECK-TLI-NOT: Invalidating analysis: TargetLibraryAnalysis
280 ; CHECK-TLI: Running pass: RequireAnalysisPass
281 ; CHECK-TLI-NOT: Running analysis: TargetLibraryAnalysis
282 ; CHECK-TLI: Finished llvm::Module pass manager run
284 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
285 ; RUN:     -passes='require<targetir>,invalidate<all>,require<targetir>' \
286 ; RUN:     | FileCheck %s --check-prefix=CHECK-TIRA
287 ; CHECK-TIRA: Starting llvm::Module pass manager run
288 ; CHECK-TIRA: Running pass: RequireAnalysisPass
289 ; CHECK-TIRA: Running analysis: TargetIRAnalysis
290 ; CHECK-TIRA: Running pass: InvalidateAllAnalysesPass
291 ; CHECK-TIRA-NOT: Invalidating analysis: TargetIRAnalysis
292 ; CHECK-TIRA: Running pass: RequireAnalysisPass
293 ; CHECK-TIRA-NOT: Running analysis: TargetIRAnalysis
294 ; CHECK-TIRA: Finished llvm::Module pass manager run
296 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
297 ; RUN:     -passes='require<domtree>' \
298 ; RUN:     | FileCheck %s --check-prefix=CHECK-DT
299 ; CHECK-DT: Starting llvm::Module pass manager run
300 ; CHECK-DT: Running pass: RequireAnalysisPass
301 ; CHECK-DT: Running analysis: DominatorTreeAnalysis
302 ; CHECK-DT: Finished llvm::Module pass manager run
304 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
305 ; RUN:     -passes='require<basic-aa>' \
306 ; RUN:     | FileCheck %s --check-prefix=CHECK-BASIC-AA
307 ; CHECK-BASIC-AA: Starting llvm::Module pass manager run
308 ; CHECK-BASIC-AA: Running pass: RequireAnalysisPass
309 ; CHECK-BASIC-AA: Running analysis: BasicAA
310 ; CHECK-BASIC-AA: Finished llvm::Module pass manager run
312 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
313 ; RUN:     -passes='require<aa>' -aa-pipeline='basic-aa' \
314 ; RUN:     | FileCheck %s --check-prefix=CHECK-AA
315 ; CHECK-AA: Starting llvm::Module pass manager run
316 ; CHECK-AA: Running pass: RequireAnalysisPass
317 ; CHECK-AA: Running analysis: AAManager
318 ; CHECK-AA: Running analysis: BasicAA
319 ; CHECK-AA: Finished llvm::Module pass manager run
321 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
322 ; RUN:     -passes='require<aa>' -aa-pipeline='default' \
323 ; RUN:     | FileCheck %s --check-prefix=CHECK-AA-DEFAULT
324 ; CHECK-AA-DEFAULT: Starting llvm::Module pass manager run
325 ; CHECK-AA-DEFAULT: Running pass: RequireAnalysisPass
326 ; CHECK-AA-DEFAULT: Running analysis: AAManager
327 ; CHECK-AA-DEFAULT: Running analysis: BasicAA
328 ; CHECK-AA-DEFAULT: Running analysis: ScopedNoAliasAA
329 ; CHECK-AA-DEFAULT: Running analysis: TypeBasedAA
330 ; CHECK-AA-DEFAULT: Finished llvm::Module pass manager run
332 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
333 ; RUN:     -passes='require<aa>,invalidate<domtree>,aa-eval' -aa-pipeline='basic-aa' \
334 ; RUN:     | FileCheck %s --check-prefix=CHECK-AA-FUNCTION-INVALIDATE
335 ; CHECK-AA-FUNCTION-INVALIDATE: Starting llvm::Function pass manager run
336 ; CHECK-AA-FUNCTION-INVALIDATE: Running pass: RequireAnalysisPass
337 ; CHECK-AA-FUNCTION-INVALIDATE: Running analysis: AAManager
338 ; CHECK-AA-FUNCTION-INVALIDATE: Running analysis: BasicAA
339 ; CHECK-AA-FUNCTION-INVALIDATE: Running pass: InvalidateAnalysisPass
340 ; CHECK-AA-FUNCTION-INVALIDATE: Invalidating analysis: DominatorTreeAnalysis
341 ; CHECK-AA-FUNCTION-INVALIDATE: Invalidating analysis: BasicAA
342 ; CHECK-AA-FUNCTION-INVALIDATE: Invalidating analysis: AAManager
343 ; CHECK-AA-FUNCTION-INVALIDATE: Running pass: AAEvaluator
344 ; CHECK-AA-FUNCTION-INVALIDATE: Running analysis: AAManager
345 ; CHECK-AA-FUNCTION-INVALIDATE: Running analysis: BasicAA
346 ; CHECK-AA-FUNCTION-INVALIDATE: Finished llvm::Function pass manager run
348 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
349 ; RUN:     -passes='require<globals-aa>,function(require<aa>),invalidate<globals-aa>,require<globals-aa>,function(aa-eval)' -aa-pipeline='globals-aa' \
350 ; RUN:     | FileCheck %s --check-prefix=CHECK-AA-MODULE-INVALIDATE
351 ; CHECK-AA-MODULE-INVALIDATE: Starting llvm::Module pass manager run
352 ; CHECK-AA-MODULE-INVALIDATE: Running pass: RequireAnalysisPass
353 ; CHECK-AA-MODULE-INVALIDATE: Running analysis: GlobalsAA
354 ; CHECK-AA-MODULE-INVALIDATE: Starting llvm::Function pass manager run
355 ; CHECK-AA-MODULE-INVALIDATE: Running pass: RequireAnalysisPass
356 ; CHECK-AA-MODULE-INVALIDATE: Running analysis: AAManager
357 ; CHECK-AA-MODULE-INVALIDATE: Finished llvm::Function pass manager run
358 ; CHECK-AA-MODULE-INVALIDATE: Running pass: InvalidateAnalysisPass
359 ; CHECK-AA-MODULE-INVALIDATE: Invalidating analysis: GlobalsAA
360 ; CHECK-AA-MODULE-INVALIDATE: Running pass: RequireAnalysisPass
361 ; CHECK-AA-MODULE-INVALIDATE: Running analysis: GlobalsAA
362 ; CHECK-AA-MODULE-INVALIDATE: Starting llvm::Function pass manager run
363 ; CHECK-AA-MODULE-INVALIDATE: Running pass: AAEvaluator
364 ; CHECK-AA-MODULE-INVALIDATE: Finished llvm::Function pass manager run
365 ; CHECK-AA-MODULE-INVALIDATE: Finished llvm::Module pass manager run
367 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
368 ; RUN:     -passes='require<memdep>' \
369 ; RUN:     | FileCheck %s --check-prefix=CHECK-MEMDEP
370 ; CHECK-MEMDEP: Starting llvm::Module pass manager run
371 ; CHECK-MEMDEP: Running pass: RequireAnalysisPass
372 ; CHECK-MEMDEP: Running analysis: MemoryDependenceAnalysis
373 ; CHECK-MEMDEP: Finished llvm::Module pass manager run
375 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
376 ; RUN:     -passes='require<callgraph>' \
377 ; RUN:     | FileCheck %s --check-prefix=CHECK-CALLGRAPH
378 ; CHECK-CALLGRAPH: Starting llvm::Module pass manager run
379 ; CHECK-CALLGRAPH: Running pass: RequireAnalysisPass
380 ; CHECK-CALLGRAPH: Running analysis: CallGraphAnalysis
381 ; CHECK-CALLGRAPH: Finished llvm::Module pass manager run
383 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
384 ; RUN:     -passes='default<O0>' %s 2>&1 \
385 ; RUN:     | FileCheck %s --check-prefix=CHECK-O0
386 ; CHECK-O0: Starting llvm::Module pass manager run
387 ; CHECK-O0-NEXT: Finished llvm::Module pass manager run
389 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
390 ; RUN:     -passes='repeat<3>(no-op-module)' %s 2>&1 \
391 ; RUN:     | FileCheck %s --check-prefix=CHECK-REPEAT-MODULE-PASS
392 ; CHECK-REPEAT-MODULE-PASS: Starting llvm::Module pass manager run
393 ; CHECK-REPEAT-MODULE-PASS-NEXT: Running pass: RepeatedPass
394 ; CHECK-REPEAT-MODULE-PASS-NEXT: Starting llvm::Module pass manager run
395 ; CHECK-REPEAT-MODULE-PASS-NEXT: Running pass: NoOpModulePass
396 ; CHECK-REPEAT-MODULE-PASS-NEXT: Finished llvm::Module pass manager run
397 ; CHECK-REPEAT-MODULE-PASS-NEXT: Starting llvm::Module pass manager run
398 ; CHECK-REPEAT-MODULE-PASS-NEXT: Running pass: NoOpModulePass
399 ; CHECK-REPEAT-MODULE-PASS-NEXT: Finished llvm::Module pass manager run
400 ; CHECK-REPEAT-MODULE-PASS-NEXT: Starting llvm::Module pass manager run
401 ; CHECK-REPEAT-MODULE-PASS-NEXT: Running pass: NoOpModulePass
402 ; CHECK-REPEAT-MODULE-PASS-NEXT: Finished llvm::Module pass manager run
403 ; CHECK-REPEAT-MODULE-PASS-NEXT: Finished llvm::Module pass manager run
405 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
406 ; RUN:     -passes='cgscc(repeat<3>(no-op-cgscc))' %s 2>&1 \
407 ; RUN:     | FileCheck %s --check-prefix=CHECK-REPEAT-CGSCC-PASS
408 ; CHECK-REPEAT-CGSCC-PASS: Starting llvm::Module pass manager run
409 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running pass: ModuleToPostOrderCGSCCPassAdaptor
410 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running analysis: InnerAnalysisManagerProxy<{{.*(CGSCCAnalysisManager|AnalysisManager<.*LazyCallGraph::SCC.*>).*}},{{.*}}Module>
411 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running analysis: InnerAnalysisManagerProxy<{{.*(FunctionAnalysisManager|AnalysisManager<.*Function.*>).*}},{{.*}}Module>
412 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running analysis: LazyCallGraphAnalysis
413 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running analysis: TargetLibraryAnalysis
414 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running analysis: PassInstrumentationAnalysis
415 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running analysis: FunctionAnalysisManagerCGSCCProxy
416 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running analysis: PassInstrumentationAnalysis
417 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running analysis: OuterAnalysisManagerProxy<{{.*}}LazyCallGraph::SCC{{.*}}>
418 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Starting CGSCC pass manager run
419 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running pass: RepeatedPass
420 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Starting CGSCC pass manager run
421 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running pass: NoOpCGSCCPass
422 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Finished CGSCC pass manager run
423 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Starting CGSCC pass manager run
424 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running pass: NoOpCGSCCPass
425 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Finished CGSCC pass manager run
426 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Starting CGSCC pass manager run
427 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running pass: NoOpCGSCCPass
428 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Finished CGSCC pass manager run
429 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Finished CGSCC pass manager run
430 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Finished llvm::Module pass manager run
432 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
433 ; RUN:     -passes='function(repeat<3>(no-op-function))' %s 2>&1 \
434 ; RUN:     | FileCheck %s --check-prefix=CHECK-REPEAT-FUNCTION-PASS
435 ; CHECK-REPEAT-FUNCTION-PASS: Starting llvm::Module pass manager run
436 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running pass: ModuleToFunctionPassAdaptor
437 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running analysis: InnerAnalysisManagerProxy<{{.*}}>
438 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running analysis: PassInstrumentationAnalysis
439 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Starting llvm::Function pass manager run
440 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running pass: RepeatedPass
441 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Starting llvm::Function pass manager run
442 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running pass: NoOpFunctionPass
443 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Finished llvm::Function pass manager run
444 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Starting llvm::Function pass manager run
445 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running pass: NoOpFunctionPass
446 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Finished llvm::Function pass manager run
447 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Starting llvm::Function pass manager run
448 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running pass: NoOpFunctionPass
449 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Finished llvm::Function pass manager run
450 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Finished llvm::Function pass manager run
451 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Finished llvm::Module pass manager run
453 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
454 ; RUN:     -passes='loop(repeat<3>(no-op-loop))' %s 2>&1 \
455 ; RUN:     | FileCheck %s --check-prefix=CHECK-REPEAT-LOOP-PASS
456 ; CHECK-REPEAT-LOOP-PASS: Starting llvm::Module pass manager run
457 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: ModuleToFunctionPassAdaptor
458 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: InnerAnalysisManagerProxy<{{.*}}>
459 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: PassInstrumentationAnalysis
460 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting llvm::Function pass manager run
461 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: FunctionToLoopPassAdaptor
462 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting llvm::Function pass manager run
463 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: LoopSimplify
464 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: LoopAnalysis
465 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: DominatorTreeAnalysis
466 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: AssumptionAnalysis
467 ; CHECK-REPEAT-LOOP-PASS-NEXT: Invalidating all non-preserved analyses
468 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: LCSSAPass
469 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished llvm::Function pass manager run
470 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: AAManager
471 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: TargetLibraryAnalysis
472 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: ScalarEvolutionAnalysis
473 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: TargetIRAnalysis
474 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: InnerAnalysisManagerProxy<{{.*}}>
475 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting Loop pass manager run
476 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: PassInstrumentationAnalysis
477 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: RepeatedPass
478 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting Loop pass manager run
479 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: NoOpLoopPass
480 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished Loop pass manager run
481 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting Loop pass manager run
482 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: NoOpLoopPass
483 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished Loop pass manager run
484 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting Loop pass manager run
485 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: NoOpLoopPass
486 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished Loop pass manager run
487 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished Loop pass manager run
488 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished llvm::Function pass manager run
489 ; CHECK-REPEAT-LOOP-PASS-NEXT: Invalidating all non-preserved analyses
490 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished llvm::Module pass manager run
492 define void @foo(i1 %x, i8* %p1, i8* %p2) {
493 entry:
494   store i8 42, i8* %p1
495   br i1 %x, label %loop, label %exit
497 loop:
498   %tmp1 = load i8, i8* %p2
499   br label %loop
501 exit:
502   ret void
505 declare void @bar()