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: FunctionAnalysisManagerCGSCCProxy
28 ; CHECK-CGSCC-PASS-NEXT: Running analysis: PassInstrumentationAnalysis
29 ; CHECK-CGSCC-PASS-NEXT: Running analysis: OuterAnalysisManagerProxy<{{.*}}LazyCallGraph::SCC{{.*}}>
30 ; CHECK-CGSCC-PASS-NEXT: Starting CGSCC pass manager run
31 ; CHECK-CGSCC-PASS-NEXT: Running pass: NoOpCGSCCPass
32 ; CHECK-CGSCC-PASS-NEXT: Finished CGSCC pass manager run
33 ; CHECK-CGSCC-PASS-NEXT: Finished llvm::Module pass manager run
35 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
36 ; RUN: -passes=no-op-function %s 2>&1 \
37 ; RUN: | FileCheck %s --check-prefix=CHECK-FUNCTION-PASS
38 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
39 ; RUN: -passes='function(no-op-function)' %s 2>&1 \
40 ; RUN: | FileCheck %s --check-prefix=CHECK-FUNCTION-PASS
41 ; CHECK-FUNCTION-PASS: Starting llvm::Module pass manager run
42 ; CHECK-FUNCTION-PASS-NEXT: Running pass: ModuleToFunctionPassAdaptor
43 ; CHECK-FUNCTION-PASS-NEXT: Running analysis: InnerAnalysisManagerProxy<{{.*}}>
44 ; CHECK-FUNCTION-PASS-NEXT: Running analysis: PassInstrumentationAnalysis
45 ; CHECK-FUNCTION-PASS-NEXT: Starting llvm::Function pass manager run
46 ; CHECK-FUNCTION-PASS-NEXT: Running pass: NoOpFunctionPass
47 ; CHECK-FUNCTION-PASS-NEXT: Finished llvm::Function pass manager run
48 ; CHECK-FUNCTION-PASS-NEXT: Finished llvm::Module pass manager run
50 ; RUN: opt -disable-output -debug-pass-manager -passes=print %s 2>&1 \
51 ; RUN: | FileCheck %s --check-prefix=CHECK-MODULE-PRINT
52 ; CHECK-MODULE-PRINT: Starting llvm::Module pass manager run
53 ; CHECK-MODULE-PRINT: Running pass: VerifierPass
54 ; CHECK-MODULE-PRINT: Running pass: PrintModulePass
55 ; CHECK-MODULE-PRINT: ModuleID
56 ; CHECK-MODULE-PRINT: define void @foo(i1 %x, i8* %p1, i8* %p2)
57 ; CHECK-MODULE-PRINT: Running pass: VerifierPass
58 ; CHECK-MODULE-PRINT: Finished llvm::Module pass manager run
60 ; RUN: opt -disable-output -debug-pass-manager -disable-verify -passes='print,verify' %s 2>&1 \
61 ; RUN: | FileCheck %s --check-prefix=CHECK-MODULE-VERIFY
62 ; CHECK-MODULE-VERIFY: Starting llvm::Module pass manager run
63 ; CHECK-MODULE-VERIFY: Running pass: PrintModulePass
64 ; CHECK-MODULE-VERIFY: ModuleID
65 ; CHECK-MODULE-VERIFY: define void @foo(i1 %x, i8* %p1, i8* %p2)
66 ; CHECK-MODULE-VERIFY: Running pass: VerifierPass
67 ; CHECK-MODULE-VERIFY: Finished llvm::Module pass manager run
69 ; RUN: opt -disable-output -debug-pass-manager -passes='function(print)' %s 2>&1 \
70 ; RUN: | FileCheck %s --check-prefix=CHECK-FUNCTION-PRINT
71 ; CHECK-FUNCTION-PRINT: Starting llvm::Module pass manager run
72 ; CHECK-FUNCTION-PRINT: Running pass: VerifierPass
73 ; CHECK-FUNCTION-PRINT: Running pass: ModuleToFunctionPassAdaptor
74 ; CHECK-FUNCTION-PRINT: Running analysis: InnerAnalysisManagerProxy<{{.*}}>
75 ; CHECK-FUNCTION-PRINT: Starting llvm::Function pass manager run
76 ; CHECK-FUNCTION-PRINT: Running pass: PrintFunctionPass
77 ; CHECK-FUNCTION-PRINT-NOT: ModuleID
78 ; CHECK-FUNCTION-PRINT: define void @foo(i1 %x, i8* %p1, i8* %p2)
79 ; CHECK-FUNCTION-PRINT: Finished llvm::Function pass manager run
80 ; CHECK-FUNCTION-PRINT: Running pass: VerifierPass
81 ; CHECK-FUNCTION-PRINT: Finished llvm::Module pass manager run
83 ; RUN: opt -disable-output -debug-pass-manager -disable-verify -passes='function(print,verify)' %s 2>&1 \
84 ; RUN: | FileCheck %s --check-prefix=CHECK-FUNCTION-VERIFY
85 ; CHECK-FUNCTION-VERIFY: Starting llvm::Module pass manager run
86 ; CHECK-FUNCTION-VERIFY: Starting llvm::Function pass manager run
87 ; CHECK-FUNCTION-VERIFY: Running pass: PrintFunctionPass
88 ; CHECK-FUNCTION-VERIFY-NOT: ModuleID
89 ; CHECK-FUNCTION-VERIFY: define void @foo(i1 %x, i8* %p1, i8* %p2)
90 ; CHECK-FUNCTION-VERIFY: Running pass: VerifierPass
91 ; CHECK-FUNCTION-VERIFY: Finished llvm::Function pass manager run
92 ; CHECK-FUNCTION-VERIFY: Finished llvm::Module pass manager run
94 ; RUN: opt -S -o - -passes='no-op-module,no-op-module' %s \
95 ; RUN: | FileCheck %s --check-prefix=CHECK-NOOP
96 ; CHECK-NOOP: define void @foo(i1 %x, i8* %p1, i8* %p2) {
98 ; CHECK-NOOP: store i8 42, i8* %p1
99 ; CHECK-NOOP: br i1 %x, label %loop, label %exit
101 ; CHECK-NOOP: %tmp1 = load i8, i8* %p2
102 ; CHECK-NOOP: br label %loop
104 ; CHECK-NOOP: ret void
107 ; Round trip through bitcode.
108 ; RUN: opt -f -o - -passes='no-op-module,no-op-module' %s \
110 ; RUN: | FileCheck %s --check-prefix=CHECK-NOOP
112 ; RUN: opt -disable-output -debug-pass-manager -verify-each -passes='no-op-module,function(no-op-function)' %s 2>&1 \
113 ; RUN: | FileCheck %s --check-prefix=CHECK-VERIFY-EACH
114 ; CHECK-VERIFY-EACH: Starting llvm::Module pass manager run
115 ; CHECK-VERIFY-EACH: Running pass: VerifierPass
116 ; CHECK-VERIFY-EACH: Running pass: NoOpModulePass
117 ; CHECK-VERIFY-EACH: Running pass: VerifierPass
118 ; CHECK-VERIFY-EACH: Starting llvm::Function pass manager run
119 ; CHECK-VERIFY-EACH: Running pass: NoOpFunctionPass
120 ; CHECK-VERIFY-EACH: Running pass: VerifierPass
121 ; CHECK-VERIFY-EACH: Finished llvm::Function pass manager run
122 ; CHECK-VERIFY-EACH: Running pass: VerifierPass
123 ; CHECK-VERIFY-EACH: Finished llvm::Module pass manager run
125 ; RUN: opt -disable-output -debug-pass-manager -disable-verify -passes='no-op-module,function(no-op-function)' %s 2>&1 \
126 ; RUN: | FileCheck %s --check-prefix=CHECK-NO-VERIFY
127 ; CHECK-NO-VERIFY: Starting llvm::Module pass manager run
128 ; CHECK-NO-VERIFY-NOT: VerifierPass
129 ; CHECK-NO-VERIFY: Running pass: NoOpModulePass
130 ; CHECK-NO-VERIFY-NOT: VerifierPass
131 ; CHECK-NO-VERIFY: Starting llvm::Function pass manager run
132 ; CHECK-NO-VERIFY: Running pass: NoOpFunctionPass
133 ; CHECK-NO-VERIFY-NOT: VerifierPass
134 ; CHECK-NO-VERIFY: Finished llvm::Function pass manager run
135 ; CHECK-NO-VERIFY-NOT: VerifierPass
136 ; CHECK-NO-VERIFY: Finished llvm::Module pass manager run
138 ; RUN: opt -disable-output -debug-pass-manager \
139 ; RUN: -passes='require<no-op-module>,cgscc(require<no-op-cgscc>,function(require<no-op-function>))' %s 2>&1 \
140 ; RUN: | FileCheck %s --check-prefix=CHECK-ANALYSES
141 ; CHECK-ANALYSES: Starting llvm::Module pass manager run
142 ; CHECK-ANALYSES: Running pass: RequireAnalysisPass
143 ; CHECK-ANALYSES: Running analysis: NoOpModuleAnalysis
144 ; CHECK-ANALYSES: Starting CGSCC pass manager run
145 ; CHECK-ANALYSES: Running pass: RequireAnalysisPass
146 ; CHECK-ANALYSES: Running analysis: NoOpCGSCCAnalysis
147 ; CHECK-ANALYSES: Starting llvm::Function pass manager run
148 ; CHECK-ANALYSES: Running pass: RequireAnalysisPass
149 ; CHECK-ANALYSES: Running analysis: NoOpFunctionAnalysis
151 ; Make sure no-op passes that preserve all analyses don't even try to do any
152 ; analysis invalidation.
153 ; RUN: opt -disable-output -debug-pass-manager \
154 ; RUN: -passes='require<no-op-module>,cgscc(require<no-op-cgscc>,function(require<no-op-function>))' %s 2>&1 \
155 ; RUN: | FileCheck %s --check-prefix=CHECK-NO-OP-INVALIDATION
156 ; CHECK-NO-OP-INVALIDATION: Starting llvm::Module pass manager run
157 ; CHECK-NO-OP-INVALIDATION-NOT: Invalidating all non-preserved analyses
159 ; RUN: opt -disable-output -debug-pass-manager \
160 ; RUN: -passes='require<no-op-module>,require<no-op-module>,require<no-op-module>' %s 2>&1 \
161 ; RUN: | FileCheck %s --check-prefix=CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS
162 ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS: Starting llvm::Module pass manager run
163 ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS: Running pass: RequireAnalysisPass
164 ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS: Running analysis: NoOpModuleAnalysis
165 ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS-NOT: Running analysis: NoOpModuleAnalysis
167 ; RUN: opt -disable-output -debug-pass-manager \
168 ; RUN: -passes='require<no-op-module>,invalidate<no-op-module>,require<no-op-module>' %s 2>&1 \
169 ; RUN: | FileCheck %s --check-prefix=CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS
170 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Starting llvm::Module pass manager run
171 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Running pass: RequireAnalysisPass
172 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Running analysis: NoOpModuleAnalysis
173 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Invalidating analysis: NoOpModuleAnalysis
174 ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Running analysis: NoOpModuleAnalysis
176 ; RUN: opt -disable-output -debug-pass-manager \
177 ; RUN: -passes='cgscc(require<no-op-cgscc>,require<no-op-cgscc>,require<no-op-cgscc>)' %s 2>&1 \
178 ; RUN: | FileCheck %s --check-prefix=CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS
179 ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS: Starting llvm::Module pass manager run
180 ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS: Running pass: RequireAnalysisPass
181 ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS: Running analysis: NoOpCGSCCAnalysis
182 ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS-NOT: Running analysis: NoOpCGSCCAnalysis
184 ; RUN: opt -disable-output -debug-pass-manager \
185 ; RUN: -passes='cgscc(require<no-op-cgscc>,invalidate<no-op-cgscc>,require<no-op-cgscc>)' %s 2>&1 \
186 ; RUN: | FileCheck %s --check-prefix=CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS
187 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Starting llvm::Module pass manager run
188 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Running pass: RequireAnalysisPass
189 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Running analysis: NoOpCGSCCAnalysis
190 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Invalidating analysis: NoOpCGSCCAnalysis
191 ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Running analysis: NoOpCGSCCAnalysis
193 ; RUN: opt -disable-output -debug-pass-manager \
194 ; RUN: -passes='function(require<no-op-function>,require<no-op-function>,require<no-op-function>)' %s 2>&1 \
195 ; RUN: | FileCheck %s --check-prefix=CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS
196 ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS: Starting llvm::Module pass manager run
197 ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS: Running pass: RequireAnalysisPass
198 ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS: Running analysis: NoOpFunctionAnalysis
199 ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS-NOT: Running analysis: NoOpFunctionAnalysis
201 ; RUN: opt -disable-output -debug-pass-manager \
202 ; RUN: -passes='function(require<no-op-function>,invalidate<no-op-function>,require<no-op-function>)' %s 2>&1 \
203 ; RUN: | FileCheck %s --check-prefix=CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS
204 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Starting llvm::Module pass manager run
205 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Running pass: RequireAnalysisPass
206 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Running analysis: NoOpFunctionAnalysis
207 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Invalidating analysis: NoOpFunctionAnalysis
208 ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Running analysis: NoOpFunctionAnalysis
210 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
211 ; 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 \
212 ; RUN: | FileCheck %s --check-prefix=CHECK-INVALIDATE-ALL
213 ; CHECK-INVALIDATE-ALL: Starting llvm::Module pass manager run
214 ; CHECK-INVALIDATE-ALL: Running pass: RequireAnalysisPass
215 ; CHECK-INVALIDATE-ALL: Running analysis: NoOpModuleAnalysis
216 ; CHECK-INVALIDATE-ALL: Starting llvm::Module pass manager run
217 ; CHECK-INVALIDATE-ALL: Running pass: RequireAnalysisPass
218 ; CHECK-INVALIDATE-ALL-NOT: Running analysis: NoOpModuleAnalysis
219 ; CHECK-INVALIDATE-ALL: Starting llvm::Function pass manager run
220 ; CHECK-INVALIDATE-ALL: Running pass: RequireAnalysisPass
221 ; CHECK-INVALIDATE-ALL: Running analysis: NoOpFunctionAnalysis
222 ; CHECK-INVALIDATE-ALL: Running pass: InvalidateAllAnalysesPass
223 ; CHECK-INVALIDATE-ALL: Invalidating analysis: NoOpFunctionAnalysis
224 ; CHECK-INVALIDATE-ALL: Running pass: RequireAnalysisPass
225 ; CHECK-INVALIDATE-ALL: Running analysis: NoOpFunctionAnalysis
226 ; CHECK-INVALIDATE-ALL: Finished llvm::Function pass manager run
227 ; CHECK-INVALIDATE-ALL: Invalidating analysis: NoOpModuleAnalysis
228 ; CHECK-INVALIDATE-ALL: Running pass: RequireAnalysisPass
229 ; CHECK-INVALIDATE-ALL: Running analysis: NoOpModuleAnalysis
230 ; CHECK-INVALIDATE-ALL: Finished llvm::Module pass manager run
231 ; CHECK-INVALIDATE-ALL-NOT: Invalidating analysis: NoOpModuleAnalysis
232 ; CHECK-INVALIDATE-ALL: Running pass: RequireAnalysisPass
233 ; CHECK-INVALIDATE-ALL-NOT: Running analysis: NoOpModuleAnalysis
234 ; CHECK-INVALIDATE-ALL: Finished llvm::Module pass manager run
236 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
237 ; 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 \
238 ; RUN: | FileCheck %s --check-prefix=CHECK-INVALIDATE-ALL-CG
239 ; CHECK-INVALIDATE-ALL-CG: Starting llvm::Module pass manager run
240 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
241 ; CHECK-INVALIDATE-ALL-CG: Running analysis: NoOpModuleAnalysis
242 ; CHECK-INVALIDATE-ALL-CG: Starting llvm::Module pass manager run
243 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
244 ; CHECK-INVALIDATE-ALL-CG-NOT: Running analysis: NoOpModuleAnalysis
245 ; CHECK-INVALIDATE-ALL-CG: Starting CGSCC pass manager run
246 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
247 ; CHECK-INVALIDATE-ALL-CG: Running analysis: NoOpCGSCCAnalysis
248 ; CHECK-INVALIDATE-ALL-CG: Starting llvm::Function pass manager run
249 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
250 ; CHECK-INVALIDATE-ALL-CG: Running analysis: NoOpFunctionAnalysis
251 ; CHECK-INVALIDATE-ALL-CG: Running pass: InvalidateAllAnalysesPass
252 ; CHECK-INVALIDATE-ALL-CG: Invalidating analysis: NoOpFunctionAnalysis
253 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
254 ; CHECK-INVALIDATE-ALL-CG: Running analysis: NoOpFunctionAnalysis
255 ; CHECK-INVALIDATE-ALL-CG: Finished llvm::Function pass manager run
256 ; CHECK-INVALIDATE-ALL-CG-NOT: Running analysis: NoOpFunctionAnalysis
257 ; CHECK-INVALIDATE-ALL-CG: Invalidating analysis: NoOpCGSCCAnalysis
258 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
259 ; CHECK-INVALIDATE-ALL-CG: Running analysis: NoOpCGSCCAnalysis
260 ; CHECK-INVALIDATE-ALL-CG: Finished CGSCC pass manager run
261 ; CHECK-INVALIDATE-ALL-CG-NOT: Invalidating analysis: NoOpCGSCCAnalysis
262 ; CHECK-INVALIDATE-ALL-CG: Invalidating analysis: NoOpModuleAnalysis
263 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
264 ; CHECK-INVALIDATE-ALL-CG: Running analysis: NoOpModuleAnalysis
265 ; CHECK-INVALIDATE-ALL-CG: Finished llvm::Module pass manager run
266 ; CHECK-INVALIDATE-ALL-CG-NOT: Invalidating analysis: NoOpModuleAnalysis
267 ; CHECK-INVALIDATE-ALL-CG: Running pass: RequireAnalysisPass
268 ; CHECK-INVALIDATE-ALL-CG-NOT: Running analysis: NoOpModuleAnalysis
269 ; CHECK-INVALIDATE-ALL-CG: Finished llvm::Module pass manager run
271 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
272 ; RUN: -passes='require<targetlibinfo>,invalidate<all>,require<targetlibinfo>' \
273 ; RUN: | FileCheck %s --check-prefix=CHECK-TLI
274 ; CHECK-TLI: Starting llvm::Module pass manager run
275 ; CHECK-TLI: Running pass: RequireAnalysisPass
276 ; CHECK-TLI: Running analysis: TargetLibraryAnalysis
277 ; CHECK-TLI: Running pass: InvalidateAllAnalysesPass
278 ; CHECK-TLI-NOT: Invalidating analysis: TargetLibraryAnalysis
279 ; CHECK-TLI: Running pass: RequireAnalysisPass
280 ; CHECK-TLI-NOT: Running analysis: TargetLibraryAnalysis
281 ; CHECK-TLI: Finished llvm::Module pass manager run
283 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
284 ; RUN: -passes='require<targetir>,invalidate<all>,require<targetir>' \
285 ; RUN: | FileCheck %s --check-prefix=CHECK-TIRA
286 ; CHECK-TIRA: Starting llvm::Module pass manager run
287 ; CHECK-TIRA: Running pass: RequireAnalysisPass
288 ; CHECK-TIRA: Running analysis: TargetIRAnalysis
289 ; CHECK-TIRA: Running pass: InvalidateAllAnalysesPass
290 ; CHECK-TIRA-NOT: Invalidating analysis: TargetIRAnalysis
291 ; CHECK-TIRA: Running pass: RequireAnalysisPass
292 ; CHECK-TIRA-NOT: Running analysis: TargetIRAnalysis
293 ; CHECK-TIRA: Finished llvm::Module pass manager run
295 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
296 ; RUN: -passes='require<domtree>' \
297 ; RUN: | FileCheck %s --check-prefix=CHECK-DT
298 ; CHECK-DT: Starting llvm::Module pass manager run
299 ; CHECK-DT: Running pass: RequireAnalysisPass
300 ; CHECK-DT: Running analysis: DominatorTreeAnalysis
301 ; CHECK-DT: Finished llvm::Module pass manager run
303 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
304 ; RUN: -passes='require<basic-aa>' \
305 ; RUN: | FileCheck %s --check-prefix=CHECK-BASIC-AA
306 ; CHECK-BASIC-AA: Starting llvm::Module pass manager run
307 ; CHECK-BASIC-AA: Running pass: RequireAnalysisPass
308 ; CHECK-BASIC-AA: Running analysis: BasicAA
309 ; CHECK-BASIC-AA: Finished llvm::Module pass manager run
311 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
312 ; RUN: -passes='require<aa>' -aa-pipeline='basic-aa' \
313 ; RUN: | FileCheck %s --check-prefix=CHECK-AA
314 ; CHECK-AA: Starting llvm::Module pass manager run
315 ; CHECK-AA: Running pass: RequireAnalysisPass
316 ; CHECK-AA: Running analysis: AAManager
317 ; CHECK-AA: Running analysis: BasicAA
318 ; CHECK-AA: Finished llvm::Module pass manager run
320 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
321 ; RUN: -passes='require<aa>' -aa-pipeline='default' \
322 ; RUN: | FileCheck %s --check-prefix=CHECK-AA-DEFAULT
323 ; CHECK-AA-DEFAULT: Starting llvm::Module pass manager run
324 ; CHECK-AA-DEFAULT: Running pass: RequireAnalysisPass
325 ; CHECK-AA-DEFAULT: Running analysis: AAManager
326 ; CHECK-AA-DEFAULT: Running analysis: BasicAA
327 ; CHECK-AA-DEFAULT: Running analysis: ScopedNoAliasAA
328 ; CHECK-AA-DEFAULT: Running analysis: TypeBasedAA
329 ; CHECK-AA-DEFAULT: Finished llvm::Module pass manager run
331 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
332 ; RUN: -passes='require<aa>,invalidate<domtree>,aa-eval' -aa-pipeline='basic-aa' \
333 ; RUN: | FileCheck %s --check-prefix=CHECK-AA-FUNCTION-INVALIDATE
334 ; CHECK-AA-FUNCTION-INVALIDATE: Starting llvm::Function pass manager run
335 ; CHECK-AA-FUNCTION-INVALIDATE: Running pass: RequireAnalysisPass
336 ; CHECK-AA-FUNCTION-INVALIDATE: Running analysis: AAManager
337 ; CHECK-AA-FUNCTION-INVALIDATE: Running analysis: BasicAA
338 ; CHECK-AA-FUNCTION-INVALIDATE: Running pass: InvalidateAnalysisPass
339 ; CHECK-AA-FUNCTION-INVALIDATE: Invalidating analysis: DominatorTreeAnalysis
340 ; CHECK-AA-FUNCTION-INVALIDATE: Invalidating analysis: BasicAA
341 ; CHECK-AA-FUNCTION-INVALIDATE: Invalidating analysis: AAManager
342 ; CHECK-AA-FUNCTION-INVALIDATE: Running pass: AAEvaluator
343 ; CHECK-AA-FUNCTION-INVALIDATE: Running analysis: AAManager
344 ; CHECK-AA-FUNCTION-INVALIDATE: Running analysis: BasicAA
345 ; CHECK-AA-FUNCTION-INVALIDATE: Finished llvm::Function pass manager run
347 ; RUN: opt -disable-output -disable-verify -debug-pass-manager %s 2>&1 \
348 ; RUN: -passes='require<globals-aa>,function(require<aa>),invalidate<globals-aa>,require<globals-aa>,function(aa-eval)' -aa-pipeline='globals-aa' \
349 ; RUN: | FileCheck %s --check-prefix=CHECK-AA-MODULE-INVALIDATE
350 ; CHECK-AA-MODULE-INVALIDATE: Starting llvm::Module pass manager run
351 ; CHECK-AA-MODULE-INVALIDATE: Running pass: RequireAnalysisPass
352 ; CHECK-AA-MODULE-INVALIDATE: Running analysis: GlobalsAA
353 ; CHECK-AA-MODULE-INVALIDATE: Starting llvm::Function pass manager run
354 ; CHECK-AA-MODULE-INVALIDATE: Running pass: RequireAnalysisPass
355 ; CHECK-AA-MODULE-INVALIDATE: Running analysis: AAManager
356 ; CHECK-AA-MODULE-INVALIDATE: Finished llvm::Function pass manager run
357 ; CHECK-AA-MODULE-INVALIDATE: Running pass: InvalidateAnalysisPass
358 ; CHECK-AA-MODULE-INVALIDATE: Invalidating analysis: GlobalsAA
359 ; CHECK-AA-MODULE-INVALIDATE: Running pass: RequireAnalysisPass
360 ; CHECK-AA-MODULE-INVALIDATE: Running analysis: GlobalsAA
361 ; CHECK-AA-MODULE-INVALIDATE: Starting llvm::Function pass manager run
362 ; CHECK-AA-MODULE-INVALIDATE: Running pass: AAEvaluator
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: FunctionAnalysisManagerCGSCCProxy
414 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running analysis: PassInstrumentationAnalysis
415 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running analysis: OuterAnalysisManagerProxy<{{.*}}LazyCallGraph::SCC{{.*}}>
416 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Starting CGSCC pass manager run
417 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running pass: RepeatedPass
418 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Starting CGSCC pass manager run
419 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running pass: NoOpCGSCCPass
420 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Finished CGSCC pass manager run
421 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Starting CGSCC pass manager run
422 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running pass: NoOpCGSCCPass
423 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Finished CGSCC pass manager run
424 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Starting CGSCC pass manager run
425 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running pass: NoOpCGSCCPass
426 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Finished CGSCC pass manager run
427 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Finished CGSCC pass manager run
428 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Finished llvm::Module pass manager run
430 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
431 ; RUN: -passes='function(repeat<3>(no-op-function))' %s 2>&1 \
432 ; RUN: | FileCheck %s --check-prefix=CHECK-REPEAT-FUNCTION-PASS
433 ; CHECK-REPEAT-FUNCTION-PASS: Starting llvm::Module pass manager run
434 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running pass: ModuleToFunctionPassAdaptor
435 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running analysis: InnerAnalysisManagerProxy<{{.*}}>
436 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running analysis: PassInstrumentationAnalysis
437 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Starting llvm::Function pass manager run
438 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running pass: RepeatedPass
439 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Starting llvm::Function pass manager run
440 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running pass: NoOpFunctionPass
441 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Finished llvm::Function pass manager run
442 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Starting llvm::Function pass manager run
443 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running pass: NoOpFunctionPass
444 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Finished llvm::Function pass manager run
445 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Starting llvm::Function pass manager run
446 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running pass: NoOpFunctionPass
447 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Finished llvm::Function pass manager run
448 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Finished llvm::Function pass manager run
449 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Finished llvm::Module pass manager run
451 ; RUN: opt -disable-output -disable-verify -debug-pass-manager \
452 ; RUN: -passes='loop(repeat<3>(no-op-loop))' %s 2>&1 \
453 ; RUN: | FileCheck %s --check-prefix=CHECK-REPEAT-LOOP-PASS
454 ; CHECK-REPEAT-LOOP-PASS: Starting llvm::Module pass manager run
455 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: ModuleToFunctionPassAdaptor
456 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: InnerAnalysisManagerProxy<{{.*}}>
457 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: PassInstrumentationAnalysis
458 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting llvm::Function pass manager run
459 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: FunctionToLoopPassAdaptor
460 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting llvm::Function pass manager run
461 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: LoopSimplify
462 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: LoopAnalysis
463 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: DominatorTreeAnalysis
464 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: AssumptionAnalysis
465 ; CHECK-REPEAT-LOOP-PASS-NEXT: Invalidating all non-preserved analyses
466 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: LCSSAPass
467 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished llvm::Function pass manager run
468 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: AAManager
469 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: TargetLibraryAnalysis
470 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: ScalarEvolutionAnalysis
471 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: TargetIRAnalysis
472 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: InnerAnalysisManagerProxy<{{.*}}>
473 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting Loop pass manager run
474 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: PassInstrumentationAnalysis
475 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: RepeatedPass
476 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting Loop pass manager run
477 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: NoOpLoopPass
478 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished Loop pass manager run
479 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting Loop pass manager run
480 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: NoOpLoopPass
481 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished Loop pass manager run
482 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting Loop pass manager run
483 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: NoOpLoopPass
484 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished Loop pass manager run
485 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished Loop pass manager run
486 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished llvm::Function pass manager run
487 ; CHECK-REPEAT-LOOP-PASS-NEXT: Invalidating all non-preserved analyses
488 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished llvm::Module pass manager run
490 define void @foo(i1 %x, i8* %p1, i8* %p2) {
493 br i1 %x, label %loop, label %exit
496 %tmp1 = load i8, i8* %p2