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
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: Starting CGSCC pass manager run
29 ; CHECK-CGSCC-PASS-NEXT: Running pass: NoOpCGSCCPass
30 ; CHECK-CGSCC-PASS-NEXT: Finished CGSCC pass manager run
31 ; CHECK-CGSCC-PASS-NEXT: Finished llvm::Module pass manager run
33 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
34 ; RUN: -passes=no-op-function %s 2>&1 \
35 ; RUN: | FileCheck %s --check-prefix=CHECK-FUNCTION-PASS
36 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
37 ; RUN: -passes='function(no-op-function)' %s 2>&1 \
38 ; RUN: | FileCheck %s --check-prefix=CHECK-FUNCTION-PASS
39 ; CHECK-FUNCTION-PASS: Starting llvm::Module pass manager run
40 ; CHECK-FUNCTION-PASS-NEXT: Running pass: ModuleToFunctionPassAdaptor
41 ; CHECK-FUNCTION-PASS-NEXT: Running analysis: InnerAnalysisManagerProxy<{{.*}}>
42 ; CHECK-FUNCTION-PASS-NEXT: Running analysis: PassInstrumentationAnalysis
43 ; CHECK-FUNCTION-PASS-NEXT: Starting llvm::Function pass manager run
44 ; CHECK-FUNCTION-PASS-NEXT: Running pass: NoOpFunctionPass
45 ; CHECK-FUNCTION-PASS-NEXT: Finished llvm::Function pass manager run
46 ; CHECK-FUNCTION-PASS-NEXT: Finished llvm::Module pass manager run
48 ; RUN: opt -disable-output -debug-pass-manager -passes=print %s 2>&1 \
49 ; RUN: | FileCheck %s --check-prefix=CHECK-MODULE-PRINT
50 ; CHECK-MODULE-PRINT: Starting llvm::Module pass manager run
51 ; CHECK-MODULE-PRINT: Running pass: VerifierPass
52 ; CHECK-MODULE-PRINT: Running pass: PrintModulePass
53 ; CHECK-MODULE-PRINT: ModuleID
54 ; CHECK-MODULE-PRINT: define void @foo(i1 %x, i8* %p1, i8* %p2)
55 ; CHECK-MODULE-PRINT: Running pass: VerifierPass
56 ; CHECK-MODULE-PRINT: Finished llvm::Module pass manager run
58 ; RUN: opt -disable-output -debug-pass-manager -disable-verify -passes='print,verify' %s 2>&1 \
59 ; RUN: | FileCheck %s --check-prefix=CHECK-MODULE-VERIFY
60 ; CHECK-MODULE-VERIFY: Starting llvm::Module pass manager run
61 ; CHECK-MODULE-VERIFY: Running pass: PrintModulePass
62 ; CHECK-MODULE-VERIFY: ModuleID
63 ; CHECK-MODULE-VERIFY: define void @foo(i1 %x, i8* %p1, i8* %p2)
64 ; CHECK-MODULE-VERIFY: Running pass: VerifierPass
65 ; CHECK-MODULE-VERIFY: Finished llvm::Module pass manager run
67 ; RUN: opt -disable-output -debug-pass-manager -passes='function(print)' %s 2>&1 \
68 ; RUN: | FileCheck %s --check-prefix=CHECK-FUNCTION-PRINT
69 ; CHECK-FUNCTION-PRINT: Starting llvm::Module pass manager run
70 ; CHECK-FUNCTION-PRINT: Running pass: VerifierPass
71 ; CHECK-FUNCTION-PRINT: Running pass: ModuleToFunctionPassAdaptor
72 ; CHECK-FUNCTION-PRINT: Running analysis: InnerAnalysisManagerProxy<{{.*}}>
73 ; CHECK-FUNCTION-PRINT: Starting llvm::Function pass manager run
74 ; CHECK-FUNCTION-PRINT: Running pass: PrintFunctionPass
75 ; CHECK-FUNCTION-PRINT-NOT: ModuleID
76 ; CHECK-FUNCTION-PRINT: define void @foo(i1 %x, i8* %p1, i8* %p2)
77 ; CHECK-FUNCTION-PRINT: Finished llvm::Function pass manager run
78 ; CHECK-FUNCTION-PRINT: Running pass: VerifierPass
79 ; CHECK-FUNCTION-PRINT: Finished llvm::Module pass manager run
81 ; RUN: opt -disable-output -debug-pass-manager -disable-verify -passes='function(print,verify)' %s 2>&1 \
82 ; RUN: | FileCheck %s --check-prefix=CHECK-FUNCTION-VERIFY
83 ; CHECK-FUNCTION-VERIFY: Starting llvm::Module pass manager run
84 ; CHECK-FUNCTION-VERIFY: Starting llvm::Function pass manager run
85 ; CHECK-FUNCTION-VERIFY: Running pass: PrintFunctionPass
86 ; CHECK-FUNCTION-VERIFY-NOT: ModuleID
87 ; CHECK-FUNCTION-VERIFY: define void @foo(i1 %x, i8* %p1, i8* %p2)
88 ; CHECK-FUNCTION-VERIFY: Running pass: VerifierPass
89 ; CHECK-FUNCTION-VERIFY: Finished llvm::Function pass manager run
90 ; CHECK-FUNCTION-VERIFY: Finished llvm::Module pass manager run
92 ; RUN: opt -S -o - -passes='no-op-module,no-op-module' %s \
93 ; RUN: | FileCheck %s --check-prefix=CHECK-NOOP
94 ; CHECK-NOOP: define void @foo(i1 %x, i8* %p1, i8* %p2) {
96 ; CHECK-NOOP: store i8 42, i8* %p1
97 ; CHECK-NOOP: br i1 %x, label %loop, label %exit
99 ; CHECK-NOOP: %tmp1 = load i8, i8* %p2
100 ; CHECK-NOOP: br label %loop
102 ; CHECK-NOOP: ret void
105 ; Round trip through bitcode.
106 ; RUN: opt -f -o - -passes='no-op-module,no-op-module' %s \
108 ; RUN: | FileCheck %s --check-prefix=CHECK-NOOP
110 ; RUN: opt -disable-output -debug-pass-manager -verify-each -passes='no-op-module,function(no-op-function)' %s 2>&1 \
111 ; RUN: | FileCheck %s --check-prefix=CHECK-VERIFY-EACH
112 ; CHECK-VERIFY-EACH: Starting llvm::Module pass manager run
113 ; CHECK-VERIFY-EACH: Running pass: VerifierPass
114 ; CHECK-VERIFY-EACH: Running pass: NoOpModulePass
115 ; CHECK-VERIFY-EACH: Running pass: VerifierPass
116 ; CHECK-VERIFY-EACH: Starting llvm::Function pass manager run
117 ; CHECK-VERIFY-EACH: Running pass: NoOpFunctionPass
118 ; CHECK-VERIFY-EACH: Running pass: VerifierPass
119 ; CHECK-VERIFY-EACH: Finished llvm::Function pass manager run
120 ; CHECK-VERIFY-EACH: Running pass: VerifierPass
121 ; CHECK-VERIFY-EACH: Finished llvm::Module pass manager run
123 ; RUN: opt -disable-output -debug-pass-manager -disable-verify -passes='no-op-module,function(no-op-function)' %s 2>&1 \
124 ; RUN: | FileCheck %s --check-prefix=CHECK-NO-VERIFY
125 ; CHECK-NO-VERIFY: Starting llvm::Module pass manager run
126 ; CHECK-NO-VERIFY-NOT: VerifierPass
127 ; CHECK-NO-VERIFY: Running pass: NoOpModulePass
128 ; CHECK-NO-VERIFY-NOT: VerifierPass
129 ; CHECK-NO-VERIFY: Starting llvm::Function pass manager run
130 ; CHECK-NO-VERIFY: Running pass: NoOpFunctionPass
131 ; CHECK-NO-VERIFY-NOT: VerifierPass
132 ; CHECK-NO-VERIFY: Finished llvm::Function pass manager run
133 ; CHECK-NO-VERIFY-NOT: VerifierPass
134 ; CHECK-NO-VERIFY: Finished llvm::Module pass manager run
136 ; RUN: opt -disable-output -debug-pass-manager \
137 ; RUN: -passes='require<no-op-module>,cgscc(require<no-op-cgscc>,function(require<no-op-function>))' %s 2>&1 \
138 ; RUN: | FileCheck %s --check-prefix=CHECK-ANALYSES
139 ; CHECK-ANALYSES: Starting llvm::Module pass manager run
140 ; CHECK-ANALYSES: Running pass: RequireAnalysisPass
141 ; CHECK-ANALYSES: Running analysis: NoOpModuleAnalysis
142 ; CHECK-ANALYSES: Starting CGSCC pass manager run
143 ; CHECK-ANALYSES: Running pass: RequireAnalysisPass
144 ; CHECK-ANALYSES: Running analysis: NoOpCGSCCAnalysis
145 ; CHECK-ANALYSES: Starting llvm::Function pass manager run
146 ; CHECK-ANALYSES: Running pass: RequireAnalysisPass
147 ; CHECK-ANALYSES: Running analysis: NoOpFunctionAnalysis
149 ; Make sure no-op passes that preserve all analyses don't even try to do any
150 ; analysis invalidation.
151 ; RUN: opt -disable-output -debug-pass-manager \
152 ; RUN: -passes='require<no-op-module>,cgscc(require<no-op-cgscc>,function(require<no-op-function>))' %s 2>&1 \
153 ; RUN: | FileCheck %s --check-prefix=CHECK-NO-OP-INVALIDATION
154 ; CHECK-NO-OP-INVALIDATION: Starting llvm::Module pass manager run
155 ; CHECK-NO-OP-INVALIDATION-NOT: Invalidating all non-preserved analyses
157 ; RUN: opt -disable-output -debug-pass-manager \
158 ; RUN: -passes='require<no-op-module>,require<no-op-module>,require<no-op-module>' %s 2>&1 \
159 ; RUN: | FileCheck %s --check-prefix=CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS
160 ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS: Starting llvm::Module pass manager run
161 ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS: Running pass: RequireAnalysisPass
162 ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS: Running analysis: NoOpModuleAnalysis
163 ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS-NOT: Running analysis: NoOpModuleAnalysis
165 ; RUN: opt -disable-output -debug-pass-manager \
166 ; RUN: -passes='require<no-op-module>,invalidate<no-op-module>,require<no-op-module>' %s 2>&1 \
167 ; RUN: | FileCheck %s --check-prefix=CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS
168 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Starting llvm::Module pass manager run
169 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Running pass: RequireAnalysisPass
170 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Running analysis: NoOpModuleAnalysis
171 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Invalidating analysis: NoOpModuleAnalysis
172 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Running analysis: NoOpModuleAnalysis
174 ; RUN: opt -disable-output -debug-pass-manager \
175 ; RUN: -passes='cgscc(require<no-op-cgscc>,require<no-op-cgscc>,require<no-op-cgscc>)' %s 2>&1 \
176 ; RUN: | FileCheck %s --check-prefix=CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS
177 ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS: Starting llvm::Module pass manager run
178 ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS: Running pass: RequireAnalysisPass
179 ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS: Running analysis: NoOpCGSCCAnalysis
180 ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS-NOT: Running analysis: NoOpCGSCCAnalysis
182 ; RUN: opt -disable-output -debug-pass-manager \
183 ; RUN: -passes='cgscc(require<no-op-cgscc>,invalidate<no-op-cgscc>,require<no-op-cgscc>)' %s 2>&1 \
184 ; RUN: | FileCheck %s --check-prefix=CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS
185 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Starting llvm::Module pass manager run
186 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Running pass: RequireAnalysisPass
187 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Running analysis: NoOpCGSCCAnalysis
188 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Invalidating analysis: NoOpCGSCCAnalysis
189 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Running analysis: NoOpCGSCCAnalysis
191 ; RUN: opt -disable-output -debug-pass-manager \
192 ; RUN: -passes='function(require<no-op-function>,require<no-op-function>,require<no-op-function>)' %s 2>&1 \
193 ; RUN: | FileCheck %s --check-prefix=CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS
194 ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS: Starting llvm::Module pass manager run
195 ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS: Running pass: RequireAnalysisPass
196 ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS: Running analysis: NoOpFunctionAnalysis
197 ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS-NOT: Running analysis: NoOpFunctionAnalysis
199 ; RUN: opt -disable-output -debug-pass-manager \
200 ; RUN: -passes='function(require<no-op-function>,invalidate<no-op-function>,require<no-op-function>)' %s 2>&1 \
201 ; RUN: | FileCheck %s --check-prefix=CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS
202 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Starting llvm::Module pass manager run
203 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Running pass: RequireAnalysisPass
204 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Running analysis: NoOpFunctionAnalysis
205 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Invalidating analysis: NoOpFunctionAnalysis
206 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Running analysis: NoOpFunctionAnalysis
208 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
209 ; 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 \
210 ; RUN: | FileCheck %s --check-prefix=CHECK-INVALIDATE-ALL
211 ; CHECK-INVALIDATE-ALL: Starting llvm::Module pass manager run
212 ; CHECK-INVALIDATE-ALL: Running pass: RequireAnalysisPass
213 ; CHECK-INVALIDATE-ALL: Running analysis: NoOpModuleAnalysis
214 ; CHECK-INVALIDATE-ALL: Starting llvm::Module pass manager run
215 ; CHECK-INVALIDATE-ALL: Running pass: RequireAnalysisPass
216 ; CHECK-INVALIDATE-ALL-NOT: Running analysis: NoOpModuleAnalysis
217 ; CHECK-INVALIDATE-ALL: Starting llvm::Function pass manager run
218 ; CHECK-INVALIDATE-ALL: Running pass: RequireAnalysisPass
219 ; CHECK-INVALIDATE-ALL: Running analysis: NoOpFunctionAnalysis
220 ; CHECK-INVALIDATE-ALL: Running pass: InvalidateAllAnalysesPass
221 ; CHECK-INVALIDATE-ALL: Invalidating analysis: NoOpFunctionAnalysis
222 ; CHECK-INVALIDATE-ALL: Running pass: RequireAnalysisPass
223 ; CHECK-INVALIDATE-ALL: Running analysis: NoOpFunctionAnalysis
224 ; CHECK-INVALIDATE-ALL: Finished llvm::Function pass manager run
225 ; CHECK-INVALIDATE-ALL: Invalidating analysis: NoOpModuleAnalysis
226 ; CHECK-INVALIDATE-ALL: Running pass: RequireAnalysisPass
227 ; CHECK-INVALIDATE-ALL: Running analysis: NoOpModuleAnalysis
228 ; CHECK-INVALIDATE-ALL: Finished llvm::Module pass manager run
229 ; CHECK-INVALIDATE-ALL-NOT: Invalidating analysis: NoOpModuleAnalysis
230 ; CHECK-INVALIDATE-ALL: Running pass: RequireAnalysisPass
231 ; CHECK-INVALIDATE-ALL-NOT: Running analysis: NoOpModuleAnalysis
232 ; CHECK-INVALIDATE-ALL: Finished llvm::Module pass manager run
234 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
235 ; 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 \
236 ; RUN: | FileCheck %s --check-prefix=CHECK-INVALIDATE-ALL-CG
237 ; CHECK-INVALIDATE-ALL-CG: Starting llvm::Module pass manager run
238 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
239 ; CHECK-INVALIDATE-ALL-CG: Running analysis: NoOpModuleAnalysis
240 ; CHECK-INVALIDATE-ALL-CG: Starting llvm::Module pass manager run
241 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
242 ; CHECK-INVALIDATE-ALL-CG-NOT: Running analysis: NoOpModuleAnalysis
243 ; CHECK-INVALIDATE-ALL-CG: Starting CGSCC pass manager run
244 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
245 ; CHECK-INVALIDATE-ALL-CG: Running analysis: NoOpCGSCCAnalysis
246 ; CHECK-INVALIDATE-ALL-CG: Starting llvm::Function pass manager run
247 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
248 ; CHECK-INVALIDATE-ALL-CG: Running analysis: NoOpFunctionAnalysis
249 ; CHECK-INVALIDATE-ALL-CG: Running pass: InvalidateAllAnalysesPass
250 ; CHECK-INVALIDATE-ALL-CG: Invalidating analysis: NoOpFunctionAnalysis
251 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
252 ; CHECK-INVALIDATE-ALL-CG: Running analysis: NoOpFunctionAnalysis
253 ; CHECK-INVALIDATE-ALL-CG: Finished llvm::Function pass manager run
254 ; CHECK-INVALIDATE-ALL-CG-NOT: Running analysis: NoOpFunctionAnalysis
255 ; CHECK-INVALIDATE-ALL-CG: Invalidating analysis: NoOpCGSCCAnalysis
256 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
257 ; CHECK-INVALIDATE-ALL-CG: Running analysis: NoOpCGSCCAnalysis
258 ; CHECK-INVALIDATE-ALL-CG: Finished CGSCC pass manager run
259 ; CHECK-INVALIDATE-ALL-CG-NOT: Invalidating analysis: NoOpCGSCCAnalysis
260 ; CHECK-INVALIDATE-ALL-CG: Invalidating analysis: NoOpModuleAnalysis
261 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
262 ; CHECK-INVALIDATE-ALL-CG: Running analysis: NoOpModuleAnalysis
263 ; CHECK-INVALIDATE-ALL-CG: Finished llvm::Module pass manager run
264 ; CHECK-INVALIDATE-ALL-CG-NOT: Invalidating analysis: NoOpModuleAnalysis
265 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
266 ; CHECK-INVALIDATE-ALL-CG-NOT: Running analysis: NoOpModuleAnalysis
267 ; CHECK-INVALIDATE-ALL-CG: Finished llvm::Module pass manager run
269 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
270 ; RUN: -passes='require<targetlibinfo>,invalidate<all>,require<targetlibinfo>' \
271 ; RUN: | FileCheck %s --check-prefix=CHECK-TLI
272 ; CHECK-TLI: Starting llvm::Module pass manager run
273 ; CHECK-TLI: Running pass: RequireAnalysisPass
274 ; CHECK-TLI: Running analysis: TargetLibraryAnalysis
275 ; CHECK-TLI: Running pass: InvalidateAllAnalysesPass
276 ; CHECK-TLI-NOT: Invalidating analysis: TargetLibraryAnalysis
277 ; CHECK-TLI: Running pass: RequireAnalysisPass
278 ; CHECK-TLI-NOT: Running analysis: TargetLibraryAnalysis
279 ; CHECK-TLI: Finished llvm::Module pass manager run
281 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
282 ; RUN: -passes='require<targetir>,invalidate<all>,require<targetir>' \
283 ; RUN: | FileCheck %s --check-prefix=CHECK-TIRA
284 ; CHECK-TIRA: Starting llvm::Module pass manager run
285 ; CHECK-TIRA: Running pass: RequireAnalysisPass
286 ; CHECK-TIRA: Running analysis: TargetIRAnalysis
287 ; CHECK-TIRA: Running pass: InvalidateAllAnalysesPass
288 ; CHECK-TIRA-NOT: Invalidating analysis: TargetIRAnalysis
289 ; CHECK-TIRA: Running pass: RequireAnalysisPass
290 ; CHECK-TIRA-NOT: Running analysis: TargetIRAnalysis
291 ; CHECK-TIRA: Finished llvm::Module pass manager run
293 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
294 ; RUN: -passes='require<domtree>' \
295 ; RUN: | FileCheck %s --check-prefix=CHECK-DT
296 ; CHECK-DT: Starting llvm::Module pass manager run
297 ; CHECK-DT: Running pass: RequireAnalysisPass
298 ; CHECK-DT: Running analysis: DominatorTreeAnalysis
299 ; CHECK-DT: Finished llvm::Module pass manager run
301 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
302 ; RUN: -passes='require<basic-aa>' \
303 ; RUN: | FileCheck %s --check-prefix=CHECK-BASIC-AA
304 ; CHECK-BASIC-AA: Starting llvm::Module pass manager run
305 ; CHECK-BASIC-AA: Running pass: RequireAnalysisPass
306 ; CHECK-BASIC-AA: Running analysis: BasicAA
307 ; CHECK-BASIC-AA: Finished llvm::Module pass manager run
309 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
310 ; RUN: -passes='require<aa>' -aa-pipeline='basic-aa' \
311 ; RUN: | FileCheck %s --check-prefix=CHECK-AA
312 ; CHECK-AA: Starting llvm::Module pass manager run
313 ; CHECK-AA: Running pass: RequireAnalysisPass
314 ; CHECK-AA: Running analysis: AAManager
315 ; CHECK-AA: Running analysis: BasicAA
316 ; CHECK-AA: Finished llvm::Module pass manager run
318 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
319 ; RUN: -passes='require<aa>' -aa-pipeline='default' \
320 ; RUN: | FileCheck %s --check-prefix=CHECK-AA-DEFAULT
321 ; CHECK-AA-DEFAULT: Starting llvm::Module pass manager run
322 ; CHECK-AA-DEFAULT: Running pass: RequireAnalysisPass
323 ; CHECK-AA-DEFAULT: Running analysis: AAManager
324 ; CHECK-AA-DEFAULT: Running analysis: BasicAA
325 ; CHECK-AA-DEFAULT: Running analysis: ScopedNoAliasAA
326 ; CHECK-AA-DEFAULT: Running analysis: TypeBasedAA
327 ; CHECK-AA-DEFAULT: Finished llvm::Module pass manager run
329 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
330 ; RUN: -passes='require<aa>,invalidate<domtree>,aa-eval' -aa-pipeline='basic-aa' \
331 ; RUN: | FileCheck %s --check-prefix=CHECK-AA-FUNCTION-INVALIDATE
332 ; CHECK-AA-FUNCTION-INVALIDATE: Starting llvm::Function pass manager run
333 ; CHECK-AA-FUNCTION-INVALIDATE: Running pass: RequireAnalysisPass
334 ; CHECK-AA-FUNCTION-INVALIDATE: Running analysis: AAManager
335 ; CHECK-AA-FUNCTION-INVALIDATE: Running analysis: BasicAA
336 ; CHECK-AA-FUNCTION-INVALIDATE: Running pass: InvalidateAnalysisPass
337 ; CHECK-AA-FUNCTION-INVALIDATE: Invalidating analysis: DominatorTreeAnalysis
338 ; CHECK-AA-FUNCTION-INVALIDATE: Invalidating analysis: BasicAA
339 ; CHECK-AA-FUNCTION-INVALIDATE: Invalidating analysis: AAManager
340 ; CHECK-AA-FUNCTION-INVALIDATE: Running pass: AAEvaluator
341 ; CHECK-AA-FUNCTION-INVALIDATE: Running analysis: AAManager
342 ; CHECK-AA-FUNCTION-INVALIDATE: Running analysis: BasicAA
343 ; CHECK-AA-FUNCTION-INVALIDATE: Finished llvm::Function pass manager run
345 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
346 ; RUN: -passes='require<globals-aa>,function(require<aa>),invalidate<globals-aa>,require<globals-aa>,function(aa-eval)' -aa-pipeline='globals-aa' \
347 ; RUN: | FileCheck %s --check-prefix=CHECK-AA-MODULE-INVALIDATE
348 ; CHECK-AA-MODULE-INVALIDATE: Starting llvm::Module pass manager run
349 ; CHECK-AA-MODULE-INVALIDATE: Running pass: RequireAnalysisPass
350 ; CHECK-AA-MODULE-INVALIDATE: Running analysis: GlobalsAA
351 ; CHECK-AA-MODULE-INVALIDATE: Starting llvm::Function pass manager run
352 ; CHECK-AA-MODULE-INVALIDATE: Running pass: RequireAnalysisPass
353 ; CHECK-AA-MODULE-INVALIDATE: Running analysis: AAManager
354 ; CHECK-AA-MODULE-INVALIDATE: Finished llvm::Function pass manager run
355 ; CHECK-AA-MODULE-INVALIDATE: Running pass: InvalidateAnalysisPass
356 ; CHECK-AA-MODULE-INVALIDATE: Invalidating analysis: AAManager
357 ; CHECK-AA-MODULE-INVALIDATE: Invalidating analysis: GlobalsAA
358 ; CHECK-AA-MODULE-INVALIDATE: Running pass: RequireAnalysisPass
359 ; CHECK-AA-MODULE-INVALIDATE: Running analysis: GlobalsAA
360 ; CHECK-AA-MODULE-INVALIDATE: Starting llvm::Function pass manager run
361 ; CHECK-AA-MODULE-INVALIDATE: Running pass: AAEvaluator
362 ; CHECK-AA-MODULE-INVALIDATE: Running analysis: AAManager
363 ; CHECK-AA-MODULE-INVALIDATE: Finished llvm::Function pass manager run
364 ; CHECK-AA-MODULE-INVALIDATE: Finished llvm::Module pass manager run
366 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
367 ; RUN: -passes='require<memdep>' \
368 ; RUN: | FileCheck %s --check-prefix=CHECK-MEMDEP
369 ; CHECK-MEMDEP: Starting llvm::Module pass manager run
370 ; CHECK-MEMDEP: Running pass: RequireAnalysisPass
371 ; CHECK-MEMDEP: Running analysis: MemoryDependenceAnalysis
372 ; CHECK-MEMDEP: Finished llvm::Module pass manager run
374 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
375 ; RUN: -passes='require<callgraph>' \
376 ; RUN: | FileCheck %s --check-prefix=CHECK-CALLGRAPH
377 ; CHECK-CALLGRAPH: Starting llvm::Module pass manager run
378 ; CHECK-CALLGRAPH: Running pass: RequireAnalysisPass
379 ; CHECK-CALLGRAPH: Running analysis: CallGraphAnalysis
380 ; CHECK-CALLGRAPH: Finished llvm::Module pass manager run
382 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
383 ; RUN: -passes='default<O0>' %s 2>&1 \
384 ; RUN: | FileCheck %s --check-prefix=CHECK-O0
385 ; CHECK-O0: Starting llvm::Module pass manager run
386 ; CHECK-O0-NEXT: Finished llvm::Module pass manager run
388 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
389 ; RUN: -passes='repeat<3>(no-op-module)' %s 2>&1 \
390 ; RUN: | FileCheck %s --check-prefix=CHECK-REPEAT-MODULE-PASS
391 ; CHECK-REPEAT-MODULE-PASS: Starting llvm::Module pass manager run
392 ; CHECK-REPEAT-MODULE-PASS-NEXT: Running pass: RepeatedPass
393 ; CHECK-REPEAT-MODULE-PASS-NEXT: Starting llvm::Module pass manager run
394 ; CHECK-REPEAT-MODULE-PASS-NEXT: Running pass: NoOpModulePass
395 ; CHECK-REPEAT-MODULE-PASS-NEXT: Finished llvm::Module pass manager run
396 ; CHECK-REPEAT-MODULE-PASS-NEXT: Starting llvm::Module pass manager run
397 ; CHECK-REPEAT-MODULE-PASS-NEXT: Running pass: NoOpModulePass
398 ; CHECK-REPEAT-MODULE-PASS-NEXT: Finished llvm::Module pass manager run
399 ; CHECK-REPEAT-MODULE-PASS-NEXT: Starting llvm::Module pass manager run
400 ; CHECK-REPEAT-MODULE-PASS-NEXT: Running pass: NoOpModulePass
401 ; CHECK-REPEAT-MODULE-PASS-NEXT: Finished llvm::Module pass manager run
402 ; CHECK-REPEAT-MODULE-PASS-NEXT: Finished llvm::Module pass manager run
404 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
405 ; RUN: -passes='cgscc(repeat<3>(no-op-cgscc))' %s 2>&1 \
406 ; RUN: | FileCheck %s --check-prefix=CHECK-REPEAT-CGSCC-PASS
407 ; CHECK-REPEAT-CGSCC-PASS: Starting llvm::Module pass manager run
408 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running pass: ModuleToPostOrderCGSCCPassAdaptor
409 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running analysis: InnerAnalysisManagerProxy<{{.*(CGSCCAnalysisManager|AnalysisManager<.*LazyCallGraph::SCC.*>).*}},{{.*}}Module>
410 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running analysis: InnerAnalysisManagerProxy<{{.*(FunctionAnalysisManager|AnalysisManager<.*Function.*>).*}},{{.*}}Module>
411 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running analysis: LazyCallGraphAnalysis
412 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running analysis: TargetLibraryAnalysis
413 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running analysis: PassInstrumentationAnalysis
414 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Starting CGSCC pass manager run
415 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running pass: RepeatedPass
416 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Starting CGSCC pass manager run
417 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running pass: NoOpCGSCCPass
418 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Finished CGSCC pass manager run
419 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Starting CGSCC pass manager run
420 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running pass: NoOpCGSCCPass
421 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Finished CGSCC pass manager run
422 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Starting CGSCC pass manager run
423 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running pass: NoOpCGSCCPass
424 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Finished CGSCC pass manager run
425 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Finished CGSCC pass manager run
426 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Finished llvm::Module pass manager run
428 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
429 ; RUN: -passes='function(repeat<3>(no-op-function))' %s 2>&1 \
430 ; RUN: | FileCheck %s --check-prefix=CHECK-REPEAT-FUNCTION-PASS
431 ; CHECK-REPEAT-FUNCTION-PASS: Starting llvm::Module pass manager run
432 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running pass: ModuleToFunctionPassAdaptor
433 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running analysis: InnerAnalysisManagerProxy<{{.*}}>
434 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running analysis: PassInstrumentationAnalysis
435 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Starting llvm::Function pass manager run
436 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running pass: RepeatedPass
437 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Starting llvm::Function pass manager run
438 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running pass: NoOpFunctionPass
439 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Finished llvm::Function pass manager run
440 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Starting llvm::Function pass manager run
441 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running pass: NoOpFunctionPass
442 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Finished llvm::Function pass manager run
443 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Starting llvm::Function pass manager run
444 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running pass: NoOpFunctionPass
445 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Finished llvm::Function pass manager run
446 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Finished llvm::Function pass manager run
447 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Finished llvm::Module pass manager run
449 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
450 ; RUN: -passes='loop(repeat<3>(no-op-loop))' %s 2>&1 \
451 ; RUN: | FileCheck %s --check-prefix=CHECK-REPEAT-LOOP-PASS
452 ; CHECK-REPEAT-LOOP-PASS: Starting llvm::Module pass manager run
453 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: ModuleToFunctionPassAdaptor
454 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: InnerAnalysisManagerProxy<{{.*}}>
455 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: PassInstrumentationAnalysis
456 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting llvm::Function pass manager run
457 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: FunctionToLoopPassAdaptor
458 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting llvm::Function pass manager run
459 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: LoopSimplify
460 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: LoopAnalysis
461 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: DominatorTreeAnalysis
462 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: AssumptionAnalysis
463 ; CHECK-REPEAT-LOOP-PASS-NEXT: Invalidating all non-preserved analyses
464 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: LCSSAPass
465 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished llvm::Function pass manager run
466 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: AAManager
467 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: TargetLibraryAnalysis
468 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: ScalarEvolutionAnalysis
469 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: TargetIRAnalysis
470 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: InnerAnalysisManagerProxy<{{.*}}>
471 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting Loop pass manager run
472 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: PassInstrumentationAnalysis
473 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: RepeatedPass
474 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting Loop pass manager run
475 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: NoOpLoopPass
476 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished Loop pass manager run
477 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting Loop pass manager run
478 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: NoOpLoopPass
479 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished Loop pass manager run
480 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting Loop pass manager run
481 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: NoOpLoopPass
482 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished Loop pass manager run
483 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished Loop pass manager run
484 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished llvm::Function pass manager run
485 ; CHECK-REPEAT-LOOP-PASS-NEXT: Invalidating all non-preserved analyses
486 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished llvm::Module pass manager run
488 define void @foo(i1 %x, i8* %p1, i8* %p2) {
491 br i1 %x, label %loop, label %exit
494 %tmp1 = load i8, i8* %p2