1 ; The IR below was crafted so as:
2 ; 1) To have a loop, so we create a loop pass manager
3 ; 2) To be "immutable" in the sense that no pass in the standard
4 ; pipeline will modify it.
5 ; Since no transformations take place, we don't expect any analyses
7 ; Any invalidation that shows up here is a bug, unless we started modifying
8 ; the IR, in which case we need to make it immutable harder.
11 ; RUN: opt -disable-verify -verify-cfg-preserved=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
12 ; RUN: -passes='thinlto-pre-link<O1>' -S %s 2>&1 \
13 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O1,CHECK-PRELINK-O,CHECK-PRELINK-O-NODIS
14 ; RUN: opt -disable-verify -verify-cfg-preserved=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
15 ; RUN: -passes='thinlto-pre-link<O2>' -S %s 2>&1 \
16 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O2,CHECK-O23SZ,CHECK-PRELINK-O,CHECK-PRELINK-O-NODIS
17 ; RUN: opt -disable-verify -verify-cfg-preserved=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
18 ; RUN: -passes='thinlto-pre-link<O3>' -S -passes-ep-pipeline-start='no-op-module' %s 2>&1 \
19 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O3,CHECK-O23SZ,CHECK-PRELINK-O,CHECK-PRELINK-O-NODIS,CHECK-EP-PIPELINE-START
20 ; RUN: opt -disable-verify -verify-cfg-preserved=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
21 ; RUN: -passes='thinlto-pre-link<Os>' -S %s 2>&1 \
22 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-Os,CHECK-O23SZ,CHECK-PRELINK-O,CHECK-PRELINK-O-NODIS
23 ; RUN: opt -disable-verify -verify-cfg-preserved=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
24 ; RUN: -passes='thinlto-pre-link<Oz>' -S %s 2>&1 \
25 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-Oz,CHECK-O23SZ,CHECK-PRELINK-O,CHECK-PRELINK-O-NODIS
26 ; RUN: opt -disable-verify -verify-cfg-preserved=0 -eagerly-invalidate-analyses=0 -debug-pass-manager -new-pm-debug-info-for-profiling \
27 ; RUN: -passes='thinlto-pre-link<O2>' -S %s 2>&1 \
28 ; RUN: | FileCheck %s --check-prefixes=CHECK-DIS,CHECK-O,CHECK-O2,CHECK-O23SZ,CHECK-PRELINK-O
31 ; RUN: opt -disable-verify -verify-cfg-preserved=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
32 ; RUN: -passes='thinlto<O1>' -S %s 2>&1 \
33 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O1,CHECK-POSTLINK-O,%llvmcheckext
34 ; RUN: opt -disable-verify -verify-cfg-preserved=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
35 ; RUN: -passes='thinlto<O2>' -S %s 2>&1 \
36 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O2,CHECK-O23SZ,CHECK-POSTLINK-O,%llvmcheckext,CHECK-POSTLINK-O2
37 ; RUN: opt -disable-verify -verify-cfg-preserved=0 -eagerly-invalidate-analyses=0 -debug-pass-manager -passes-ep-pipeline-start='no-op-module' \
38 ; RUN: -passes='thinlto<O3>' -S %s 2>&1 \
39 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O3,CHECK-O23SZ,CHECK-POSTLINK-O,%llvmcheckext,CHECK-POSTLINK-O3
40 ; RUN: opt -disable-verify -verify-cfg-preserved=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
41 ; RUN: -passes='thinlto<Os>' -S %s 2>&1 \
42 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-Os,CHECK-O23SZ,CHECK-POSTLINK-O,%llvmcheckext,CHECK-POSTLINK-Os
43 ; RUN: opt -disable-verify -verify-cfg-preserved=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
44 ; RUN: -passes='thinlto<Oz>' -S %s 2>&1 \
45 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-Oz,CHECK-O23SZ,CHECK-POSTLINK-O,%llvmcheckext
46 ; RUN: opt -disable-verify -verify-cfg-preserved=0 -eagerly-invalidate-analyses=0 -debug-pass-manager -new-pm-debug-info-for-profiling \
47 ; RUN: -passes='thinlto<O2>' -S %s 2>&1 \
48 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O2,CHECK-O23SZ,CHECK-POSTLINK-O,%llvmcheckext,CHECK-POSTLINK-O2
50 ; Suppress FileCheck --allow-unused-prefixes=false diagnostics.
53 ; CHECK-O: Running pass: Annotation2Metadata
54 ; CHECK-O-NEXT: Running pass: ForceFunctionAttrsPass
55 ; CHECK-EP-PIPELINE-START-NEXT: Running pass: NoOpModulePass
56 ; CHECK-DIS-NEXT: Running analysis: InnerAnalysisManagerProxy
57 ; CHECK-DIS-NEXT: Running pass: AddDiscriminatorsPass
58 ; CHECK-POSTLINK-O-NEXT: Running pass: PGOIndirectCallPromotion
59 ; CHECK-POSTLINK-O-NEXT: Running analysis: ProfileSummaryAnalysis
60 ; CHECK-POSTLINK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
61 ; CHECK-POSTLINK-O-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis
62 ; CHECK-O-NEXT: Running pass: InferFunctionAttrsPass
63 ; CHECK-PRELINK-O-NODIS-NEXT: Running analysis: InnerAnalysisManagerProxy
64 ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis
65 ; CHECK-O-NEXT: Running pass: CoroEarlyPass
66 ; CHECK-O-NEXT: Running pass: LowerExpectIntrinsicPass
67 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
68 ; CHECK-O-NEXT: Running analysis: TargetIRAnalysis
69 ; CHECK-O-NEXT: Running analysis: AssumptionAnalysis
70 ; CHECK-O-NEXT: Running pass: SROAPass
71 ; CHECK-O-NEXT: Running analysis: DominatorTreeAnalysis
72 ; CHECK-O-NEXT: Running pass: EarlyCSEPass
73 ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis
74 ; CHECK-O3-NEXT: Running pass: CallSiteSplittingPass
75 ; CHECK-O-NEXT: Running pass: OpenMPOptPass
76 ; CHECK-POSTLINK-O-NEXT: Running pass: LowerTypeTestsPass
77 ; CHECK-O-NEXT: Running pass: IPSCCPPass
78 ; CHECK-O-NEXT: Running pass: CalledValuePropagationPass
79 ; CHECK-O-NEXT: Running pass: GlobalOptPass
80 ; CHECK-O-NEXT: Running pass: PromotePass
81 ; CHECK-O-NEXT: Running pass: DeadArgumentEliminationPass
82 ; CHECK-O-NEXT: Running pass: InstCombinePass
83 ; CHECK-PRELINK-O-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis
84 ; CHECK-O-NEXT: Running analysis: AAManager
85 ; CHECK-O-NEXT: Running analysis: BasicAA
86 ; CHECK-O-NEXT: Running analysis: ScopedNoAliasAA
87 ; CHECK-O-NEXT: Running analysis: TypeBasedAA
88 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
89 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
90 ; CHECK-O-NEXT: Running pass: ModuleInlinerWrapperPass
91 ; CHECK-O-NEXT: Running analysis: InlineAdvisorAnalysis
92 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}GlobalsAA
93 ; CHECK-O-NEXT: Running analysis: GlobalsAA
94 ; CHECK-O-NEXT: Running analysis: CallGraphAnalysis
95 ; CHECK-O-NEXT: Running pass: InvalidateAnalysisPass<{{.*}}AAManager
96 ; CHECK-O-NEXT: Invalidating analysis: AAManager
97 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}ProfileSummaryAnalysis
98 ; CHECK-PRELINK-O-NEXT: Running analysis: ProfileSummaryAnalysis
99 ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
100 ; CHECK-O-NEXT: Running analysis: LazyCallGraphAnalysis
101 ; CHECK-O-NEXT: Running analysis: FunctionAnalysisManagerCGSCCProxy
102 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
103 ; CHECK-O-NEXT: Running pass: DevirtSCCRepeatedPass
104 ; CHECK-O-NEXT: Running pass: InlinerPass
105 ; CHECK-O-NEXT: Running pass: InlinerPass
106 ; CHECK-O-NEXT: Running pass: PostOrderFunctionAttrsPass
107 ; CHECK-O-NEXT: Running analysis: AAManager
108 ; CHECK-O3-NEXT: Running pass: ArgumentPromotionPass
109 ; CHECK-O2-NEXT: Running pass: OpenMPOptCGSCCPass on (foo)
110 ; CHECK-O3-NEXT: Running pass: OpenMPOptCGSCCPass on (foo)
111 ; CHECK-O-NEXT: Running pass: SROAPass
112 ; CHECK-O-NEXT: Running pass: EarlyCSEPass
113 ; CHECK-O-NEXT: Running analysis: MemorySSAAnalysis
114 ; CHECK-O23SZ-NEXT: Running pass: SpeculativeExecutionPass
115 ; CHECK-O23SZ-NEXT: Running pass: JumpThreadingPass
116 ; CHECK-O23SZ-NEXT: Running analysis: LazyValueAnalysis
117 ; CHECK-O23SZ-NEXT: Running pass: CorrelatedValuePropagationPass
118 ; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis
119 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
120 ; CHECK-O-NEXT: Running pass: InstCombinePass
121 ; CHECK-O3-NEXT: Running pass: AggressiveInstCombinePass
122 ; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass
123 ; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass
124 ; CHECK-O3-NEXT: Running pass: LibCallsShrinkWrapPass
125 ; CHECK-O23SZ-NEXT: Running pass: TailCallElimPass
126 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
127 ; CHECK-O-NEXT: Running pass: ReassociatePass
128 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}OptimizationRemarkEmitterAnalysis
129 ; CHECK-O-NEXT: Running pass: LoopSimplifyPass
130 ; CHECK-O-NEXT: Running analysis: LoopAnalysis
131 ; CHECK-O-NEXT: Running pass: LCSSAPass
132 ; CHECK-O-NEXT: Running analysis: ScalarEvolutionAnalysis
133 ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
134 ; CHECK-O-NEXT: Running pass: LoopInstSimplifyPass
135 ; CHECK-O-NEXT: Running pass: LoopSimplifyCFGPass
136 ; CHECK-O-NEXT: Running pass: LICM
137 ; CHECK-O-NEXT: Running pass: LoopRotatePass
138 ; CHECK-O-NEXT: Running pass: LICM
139 ; CHECK-O-NEXT: Running pass: SimpleLoopUnswitchPass
140 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
141 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
142 ; CHECK-O-NEXT: Running pass: InstCombinePass
143 ; CHECK-O-NEXT: Running pass: LoopSimplifyPass
144 ; CHECK-O-NEXT: Running pass: LCSSAPass
145 ; CHECK-O-NEXT: Running pass: LoopIdiomRecognizePass
146 ; CHECK-O-NEXT: Running pass: IndVarSimplifyPass
147 ; CHECK-O-NEXT: Running pass: LoopDeletionPass
148 ; CHECK-O-NEXT: Running pass: LoopFullUnrollPass
149 ; CHECK-O-NEXT: Running pass: SROAPass on foo
150 ; CHECK-Os-NEXT: Running pass: MergedLoadStoreMotionPass
151 ; CHECK-Os-NEXT: Running pass: GVNPass
152 ; CHECK-Os-NEXT: Running analysis: MemoryDependenceAnalysis
153 ; CHECK-Os-NEXT: Running analysis: PhiValuesAnalysis
154 ; CHECK-Oz-NEXT: Running pass: MergedLoadStoreMotionPass
155 ; CHECK-Oz-NEXT: Running pass: GVNPass
156 ; CHECK-Oz-NEXT: Running analysis: MemoryDependenceAnalysis
157 ; CHECK-Oz-NEXT: Running analysis: PhiValuesAnalysis
158 ; CHECK-O2-NEXT: Running pass: MergedLoadStoreMotionPass
159 ; CHECK-O2-NEXT: Running pass: GVNPass
160 ; CHECK-O2-NEXT: Running analysis: MemoryDependenceAnalysis
161 ; CHECK-O2-NEXT: Running analysis: PhiValuesAnalysis
162 ; CHECK-O3-NEXT: Running pass: MergedLoadStoreMotionPass
163 ; CHECK-O3-NEXT: Running pass: GVNPass
164 ; CHECK-O3-NEXT: Running analysis: MemoryDependenceAnalysis
165 ; CHECK-O3-NEXT: Running analysis: PhiValuesAnalysis
166 ; CHECK-O1-NEXT: Running pass: MemCpyOptPass
167 ; CHECK-O-NEXT: Running pass: SCCPPass
168 ; CHECK-O-NEXT: Running pass: BDCEPass
169 ; CHECK-O-NEXT: Running analysis: DemandedBitsAnalysis
170 ; CHECK-O-NEXT: Running pass: InstCombinePass
171 ; CHECK-O23SZ-NEXT: Running pass: JumpThreadingPass
172 ; CHECK-O23SZ-NEXT: Running analysis: LazyValueAnalysis
173 ; CHECK-O23SZ-NEXT: Running pass: CorrelatedValuePropagationPass
174 ; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis
175 ; CHECK-O1-NEXT: Running pass: CoroElidePass
176 ; CHECK-O-NEXT: Running pass: ADCEPass
177 ; CHECK-O-NEXT: Running analysis: PostDominatorTreeAnalysis
178 ; CHECK-O23SZ-NEXT: Running pass: MemCpyOptPass
179 ; CHECK-O23SZ-NEXT: Running pass: DSEPass
180 ; CHECK-O23SZ-NEXT: Running pass: LoopSimplifyPass
181 ; CHECK-O23SZ-NEXT: Running pass: LCSSAPass
182 ; CHECK-O23SZ-NEXT: Running pass: LICMPass on Loop at depth 1 containing: %loop
183 ; CHECK-O23SZ-NEXT: Running pass: CoroElidePass
184 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
185 ; CHECK-O-NEXT: Running pass: InstCombinePass
186 ; CHECK-O-NEXT: Running analysis: ShouldNotRunFunctionPassesAnalysis
187 ; CHECK-O-NEXT: Running pass: CoroSplitPass
188 ; CHECK-O-NEXT: Running pass: InvalidateAnalysisPass<{{.*}}ShouldNotRunFunctionPassesAnalysis
189 ; CHECK-O-NEXT: Invalidating analysis: ShouldNotRunFunctionPassesAnalysis
190 ; CHECK-O-NEXT: Invalidating analysis: InlineAdvisorAnalysis
191 ; CHECK-O-NEXT: Running pass: CoroCleanupPass
192 ; CHECK-PRELINK-O-NEXT: Running pass: GlobalOptPass
193 ; CHECK-POSTLINK-O-NEXT: Running pass: GlobalOptPass
194 ; CHECK-POSTLINK-O-NEXT: Running pass: GlobalDCEPass
195 ; CHECK-POSTLINK-O-NEXT: Running pass: EliminateAvailableExternallyPass
196 ; CHECK-POSTLINK-O-NEXT: Running pass: ReversePostOrderFunctionAttrsPass
197 ; CHECK-POSTLINK-O-NEXT: Running pass: RecomputeGlobalsAAPass
198 ; CHECK-POSTLINK-O-NEXT: Running pass: Float2IntPass
199 ; CHECK-POSTLINK-O-NEXT: Running pass: LowerConstantIntrinsicsPass
200 ; CHECK-EXT: Running pass: {{.*}}::Bye
201 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopSimplifyPass
202 ; CHECK-POSTLINK-O-NEXT: Running pass: LCSSAPass
203 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopRotatePass
204 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopDeletionPass
205 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopDistributePass
206 ; CHECK-POSTLINK-O-NEXT: Running pass: InjectTLIMappings
207 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopVectorizePass
208 ; CHECK-POSTLINK-O-NEXT: Running analysis: BlockFrequencyAnalysis
209 ; CHECK-POSTLINK-O-NEXT: Running analysis: BranchProbabilityAnalysis
210 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopLoadEliminationPass
211 ; CHECK-POSTLINK-O-NEXT: Running analysis: LoopAccessAnalysis
212 ; CHECK-POSTLINK-O-NEXT: Running pass: InstCombinePass
213 ; CHECK-POSTLINK-O-NEXT: Running pass: SimplifyCFGPass
214 ; CHECK-POSTLINK-O2-NEXT: Running pass: SLPVectorizerPass
215 ; CHECK-POSTLINK-O3-NEXT: Running pass: SLPVectorizerPass
216 ; CHECK-POSTLINK-Os-NEXT: Running pass: SLPVectorizerPass
217 ; CHECK-POSTLINK-O-NEXT: Running pass: VectorCombinePass
218 ; CHECK-POSTLINK-O-NEXT: Running pass: InstCombinePass
219 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopUnrollPass
220 ; CHECK-POSTLINK-O-NEXT: Running pass: WarnMissedTransformationsPass
221 ; CHECK-POSTLINK-O-NEXT: Running pass: InstCombinePass
222 ; CHECK-POSTLINK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}OptimizationRemarkEmitterAnalysis
223 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopSimplifyPass
224 ; CHECK-POSTLINK-O-NEXT: Running pass: LCSSAPass
225 ; CHECK-POSTLINK-O-NEXT: Running pass: LICMPass
226 ; CHECK-POSTLINK-O-NEXT: Running pass: AlignmentFromAssumptionsPass
227 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopSinkPass
228 ; CHECK-POSTLINK-O-NEXT: Running pass: InstSimplifyPass
229 ; CHECK-POSTLINK-O-NEXT: Running pass: DivRemPairsPass
230 ; CHECK-POSTLINK-O-NEXT: Running pass: TailCallElimPass
231 ; CHECK-POSTLINK-O-NEXT: Running pass: SimplifyCFGPass
232 ; CHECK-POSTLINK-O-NEXT: Running pass: GlobalDCEPass
233 ; CHECK-POSTLINK-O-NEXT: Running pass: ConstantMergePass
234 ; CHECK-POSTLINK-O-NEXT: Running pass: CGProfilePass
235 ; CHECK-POSTLINK-O-NEXT: Running pass: RelLookupTableConverterPass
236 ; CHECK-O-NEXT: Running pass: AnnotationRemarksPass on foo
237 ; CHECK-PRELINK-O-NEXT: Running pass: CanonicalizeAliasesPass
238 ; CHECK-PRELINK-O-NEXT: Running pass: NameAnonGlobalPass
239 ; CHECK-O-NEXT: Running pass: PrintModulePass
241 ; Make sure we get the IR back out without changes when we print the module.
242 ; CHECK-O-LABEL: define void @foo(i32 %n) local_unnamed_addr {
243 ; CHECK-O-NEXT: entry:
244 ; CHECK-O-NEXT: br label %loop
246 ; CHECK-O-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
247 ; CHECK-O-NEXT: %iv.next = add i32 %iv, 1
248 ; CHECK-O-NEXT: tail call void @bar()
249 ; CHECK-O-NEXT: %cmp = icmp eq i32 %iv, %n
250 ; CHECK-O-NEXT: br i1 %cmp, label %exit, label %loop
252 ; CHECK-O-NEXT: ret void
256 declare void @bar() local_unnamed_addr
258 define void @foo(i32 %n) local_unnamed_addr {
262 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
263 %iv.next = add i32 %iv, 1
264 tail call void @bar()
265 %cmp = icmp eq i32 %iv, %n
266 br i1 %cmp, label %exit, label %loop