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-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
12 ; RUN: -passes='thinlto<O1>' -S %s 2>&1 \
13 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O1,CHECK-POSTLINK-O,%llvmcheckext
14 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
15 ; RUN: -passes='thinlto<O2>' -S %s 2>&1 \
16 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O2,CHECK-O23SZ,CHECK-POSTLINK-O,%llvmcheckext,CHECK-POSTLINK-O2
17 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager -passes-ep-pipeline-start='no-op-module' \
18 ; RUN: -passes='thinlto<O3>' -S %s 2>&1 \
19 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O3,CHECK-O23SZ,CHECK-POSTLINK-O,%llvmcheckext,CHECK-POSTLINK-O3
20 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager -passes-ep-optimizer-early='no-op-module' \
21 ; RUN: -passes='thinlto<O3>' -S %s 2>&1 \
22 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O3,CHECK-O23SZ,CHECK-POSTLINK-O,%llvmcheckext,CHECK-POSTLINK-O3,CHECK-POST-EP-OPT-EARLY
23 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager -passes-ep-optimizer-last='no-op-module' \
24 ; RUN: -passes='thinlto<O3>' -S %s 2>&1 \
25 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O3,CHECK-O23SZ,CHECK-POSTLINK-O,%llvmcheckext,CHECK-POSTLINK-O3,CHECK-POST-EP-OPT-LAST
26 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
27 ; RUN: -passes='thinlto<Os>' -S %s 2>&1 \
28 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O23SZ,CHECK-POSTLINK-O,%llvmcheckext,CHECK-POSTLINK-Os
29 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
30 ; RUN: -passes='thinlto<Oz>' -S %s 2>&1 \
31 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O23SZ,CHECK-POSTLINK-O,%llvmcheckext
32 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager -debug-info-for-profiling \
33 ; RUN: -passes='thinlto<O2>' -S %s 2>&1 \
34 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O2,CHECK-O23SZ,CHECK-POSTLINK-O,%llvmcheckext,CHECK-POSTLINK-O2
36 ; Suppress FileCheck --allow-unused-prefixes=false diagnostics.
39 ; CHECK-EP-PIPELINE-START: Running pass: NoOpModulePass
40 ; CHECK-DIS: Running analysis: InnerAnalysisManagerProxy
41 ; CHECK-DIS-NEXT: Running pass: AddDiscriminatorsPass
42 ; CHECK-POSTLINK-O: Running pass: PGOIndirectCallPromotion
43 ; CHECK-POSTLINK-O-NEXT: Running analysis: ProfileSummaryAnalysis
44 ; CHECK-POSTLINK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
45 ; CHECK-POSTLINK-O-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis
46 ; CHECK-O-NEXT: Running pass: OpenMPOptPass
47 ; CHECK-POSTLINK-O-NEXT: Running pass: LowerTypeTestsPass
48 ; CHECK-O-NEXT: Running pass: IPSCCPPass
49 ; CHECK-O-NEXT: Running analysis: DominatorTreeAnalysis
50 ; CHECK-O-NEXT: Running analysis: AssumptionAnalysis
51 ; CHECK-O-NEXT: Running analysis: TargetIRAnalysis
52 ; CHECK-O-NEXT: Running pass: CalledValuePropagationPass
53 ; CHECK-O-NEXT: Running pass: GlobalOptPass
54 ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis
55 ; CHECK-O-NEXT: Running pass: PromotePass
56 ; CHECK-O-NEXT: Running pass: InstCombinePass
57 ; CHECK-O-NEXT: Running analysis: LastRunTrackingAnalysis
58 ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis
59 ; CHECK-O-NEXT: Running analysis: AAManager
60 ; CHECK-O-NEXT: Running analysis: BasicAA
61 ; CHECK-O-NEXT: Running analysis: ScopedNoAliasAA
62 ; CHECK-O-NEXT: Running analysis: TypeBasedAA
63 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
64 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
65 ; CHECK-O-NEXT: Running pass: AlwaysInlinerPass
66 ; CHECK-PRELINK-O-NEXT: Running analysis: ProfileSummaryAnalysis
67 ; CHECK-O-NEXT: Running pass: ModuleInlinerWrapperPass
68 ; CHECK-O-NEXT: Running analysis: InlineAdvisorAnalysis
69 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}GlobalsAA
70 ; CHECK-O-NEXT: Running analysis: GlobalsAA
71 ; CHECK-O-NEXT: Running analysis: CallGraphAnalysis
72 ; CHECK-O-NEXT: Running pass: InvalidateAnalysisPass<{{.*}}AAManager
73 ; CHECK-O-NEXT: Invalidating analysis: AAManager
74 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}ProfileSummaryAnalysis
75 ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
76 ; CHECK-O-NEXT: Running analysis: LazyCallGraphAnalysis
77 ; CHECK-O-NEXT: Running analysis: FunctionAnalysisManagerCGSCCProxy
78 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
79 ; CHECK-O-NEXT: Running pass: DevirtSCCRepeatedPass
80 ; CHECK-O-NEXT: Running pass: InlinerPass
81 ; CHECK-O-NEXT: Running pass: PostOrderFunctionAttrsPass
82 ; CHECK-O3-NEXT: Running pass: ArgumentPromotionPass
83 ; CHECK-O2-NEXT: Running pass: OpenMPOptCGSCCPass on (foo)
84 ; CHECK-O3-NEXT: Running pass: OpenMPOptCGSCCPass on (foo)
85 ; CHECK-O-NEXT: Running pass: SROAPass
86 ; CHECK-O-NEXT: Running pass: EarlyCSEPass
87 ; CHECK-O-NEXT: Running analysis: MemorySSAAnalysis
88 ; CHECK-O-NEXT: Running analysis: AAManager
89 ; CHECK-O23SZ-NEXT: Running pass: SpeculativeExecutionPass
90 ; CHECK-O23SZ-NEXT: Running pass: JumpThreadingPass
91 ; CHECK-O23SZ-NEXT: Running analysis: LazyValueAnalysis
92 ; CHECK-O23SZ-NEXT: Running pass: CorrelatedValuePropagationPass
93 ; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis
94 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
95 ; CHECK-O-NEXT: Running pass: InstCombinePass
96 ; CHECK-O23SZ-NEXT: Running pass: AggressiveInstCombinePass
97 ; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass
98 ; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass
99 ; CHECK-O3-NEXT: Running pass: LibCallsShrinkWrapPass
100 ; CHECK-O23SZ-NEXT: Running pass: TailCallElimPass
101 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
102 ; CHECK-O-NEXT: Running pass: ReassociatePass
103 ; CHECK-O23SZ-NEXT: Running pass: ConstraintEliminationPass
104 ; CHECK-O23SZ-NEXT: Running analysis: LoopAnalysis
105 ; CHECK-O23SZ-NEXT: Running analysis: ScalarEvolutionAnalysis
106 ; CHECK-O-NEXT: Running pass: LoopSimplifyPass
107 ; CHECK-O1-NEXT: Running analysis: LoopAnalysis
108 ; CHECK-O-NEXT: Running pass: LCSSAPass
109 ; CHECK-O1-NEXT: Running analysis: ScalarEvolutionAnalysis
110 ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
111 ; CHECK-O-NEXT: Running pass: LoopInstSimplifyPass
112 ; CHECK-O-NEXT: Running pass: LoopSimplifyCFGPass
113 ; CHECK-O-NEXT: Running pass: LICM
114 ; CHECK-O-NEXT: Running pass: LoopRotatePass
115 ; CHECK-O-NEXT: Running pass: LICM
116 ; CHECK-O-NEXT: Running pass: SimpleLoopUnswitchPass
117 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
118 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
119 ; CHECK-O-NEXT: Running pass: InstCombinePass
120 ; CHECK-O-NEXT: Running pass: LoopSimplifyPass
121 ; CHECK-O-NEXT: Running pass: LCSSAPass
122 ; CHECK-O-NEXT: Running pass: LoopIdiomRecognizePass
123 ; CHECK-O-NEXT: Running pass: IndVarSimplifyPass
124 ; CHECK-O-NEXT: Running pass: LoopDeletionPass
125 ; CHECK-O-NEXT: Running pass: LoopFullUnrollPass
126 ; CHECK-O-NEXT: Running pass: SROAPass on foo
127 ; CHECK-O23SZ-NEXT: Running pass: VectorCombinePass
128 ; CHECK-O23SZ-NEXT: Running pass: MergedLoadStoreMotionPass
129 ; CHECK-O23SZ-NEXT: Running pass: GVNPass
130 ; CHECK-O23SZ-NEXT: Running analysis: MemoryDependenceAnalysis
131 ; CHECK-O1-NEXT: Running pass: MemCpyOptPass
132 ; CHECK-O1-NEXT: Running analysis: PostDominatorTreeAnalysis
133 ; CHECK-O-NEXT: Running pass: SCCPPass
134 ; CHECK-O-NEXT: Running pass: BDCEPass
135 ; CHECK-O-NEXT: Running analysis: DemandedBitsAnalysis
136 ; CHECK-O-NEXT: Running pass: InstCombinePass
137 ; CHECK-O23SZ-NEXT: Running pass: JumpThreadingPass
138 ; CHECK-O23SZ-NEXT: Running analysis: LazyValueAnalysis
139 ; CHECK-O23SZ-NEXT: Running pass: CorrelatedValuePropagationPass
140 ; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis
141 ; CHECK-O1-NEXT: Running pass: CoroElidePass
142 ; CHECK-O-NEXT: Running pass: ADCEPass
143 ; CHECK-O23SZ-NEXT: Running analysis: PostDominatorTreeAnalysis
144 ; CHECK-O23SZ-NEXT: Running pass: MemCpyOptPass
145 ; CHECK-O23SZ-NEXT: Running pass: DSEPass
146 ; CHECK-O23SZ-NEXT: Running pass: MoveAutoInitPass on foo
147 ; CHECK-O23SZ-NEXT: Running pass: LoopSimplifyPass
148 ; CHECK-O23SZ-NEXT: Running pass: LCSSAPass
149 ; CHECK-O23SZ-NEXT: Running pass: LICMPass on loop
150 ; CHECK-O23SZ-NEXT: Running pass: CoroElidePass
151 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
152 ; CHECK-O-NEXT: Running pass: InstCombinePass
153 ; CHECK-O-NEXT: Running pass: PostOrderFunctionAttrsPass
154 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}ShouldNotRunFunctionPassesAnalysis
155 ; CHECK-O-NEXT: Running analysis: ShouldNotRunFunctionPassesAnalysis
156 ; CHECK-O-NEXT: Running pass: CoroSplitPass
157 ; CHECK-O-NEXT: Running pass: CoroAnnotationElidePass
158 ; CHECK-O-NEXT: Running pass: InvalidateAnalysisPass<{{.*}}ShouldNotRunFunctionPassesAnalysis
159 ; CHECK-O-NEXT: Invalidating analysis: ShouldNotRunFunctionPassesAnalysis
160 ; CHECK-O-NEXT: Invalidating analysis: InlineAdvisorAnalysis
161 ; CHECK-O-NEXT: Running pass: DeadArgumentEliminationPass
162 ; CHECK-O-NEXT: Running pass: CoroCleanupPass
163 ; CHECK-POSTLINK-O-NEXT: Running pass: GlobalOptPass
164 ; CHECK-POSTLINK-O-NEXT: Running pass: GlobalDCEPass
165 ; CHECK-POSTLINK-O-NEXT: Running pass: EliminateAvailableExternallyPass
166 ; CHECK-POSTLINK-O-NEXT: Running pass: ReversePostOrderFunctionAttrsPass
167 ; CHECK-POSTLINK-O-NEXT: Running pass: RecomputeGlobalsAAPass
168 ; CHECK-POST-EP-OPT-EARLY-NEXT: Running pass: NoOpModulePass
169 ; CHECK-POSTLINK-O-NEXT: Running pass: Float2IntPass
170 ; CHECK-POSTLINK-O-NEXT: Running pass: LowerConstantIntrinsicsPass
171 ; CHECK-POSTLINK-O3-NEXT: Running pass: ControlHeightReductionPass
172 ; CHECK-EXT: Running pass: {{.*}}::Bye
173 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopSimplifyPass
174 ; CHECK-POSTLINK-O-NEXT: Running pass: LCSSAPass
175 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopRotatePass
176 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopDeletionPass
177 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopDistributePass
178 ; CHECK-POSTLINK-O-NEXT: Running analysis: LoopAccessAnalysis on foo
179 ; CHECK-POSTLINK-O-NEXT: Running pass: InjectTLIMappings
180 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopVectorizePass
181 ; CHECK-POSTLINK-O-NEXT: Running pass: InferAlignmentPass
182 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopLoadEliminationPass
183 ; CHECK-POSTLINK-O-NEXT: Running pass: InstCombinePass
184 ; CHECK-POSTLINK-O-NEXT: Running pass: SimplifyCFGPass
185 ; CHECK-POSTLINK-O2-NEXT: Running pass: SLPVectorizerPass
186 ; CHECK-POSTLINK-O3-NEXT: Running pass: SLPVectorizerPass
187 ; CHECK-POSTLINK-Os-NEXT: Running pass: SLPVectorizerPass
188 ; CHECK-POSTLINK-O-NEXT: Running pass: VectorCombinePass
189 ; CHECK-POSTLINK-O-NEXT: Running pass: InstCombinePass
190 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopUnrollPass
191 ; CHECK-POSTLINK-O-NEXT: Running pass: WarnMissedTransformationsPass
192 ; CHECK-POSTLINK-O-NEXT: Running pass: SROAPass
193 ; CHECK-POSTLINK-O-NEXT: Running pass: InferAlignmentPass
194 ; CHECK-POSTLINK-O-NEXT: Running pass: InstCombinePass
195 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopSimplifyPass
196 ; CHECK-POSTLINK-O-NEXT: Running pass: LCSSAPass
197 ; CHECK-POSTLINK-O-NEXT: Running pass: LICMPass
198 ; CHECK-POSTLINK-O-NEXT: Running pass: AlignmentFromAssumptionsPass
199 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopSinkPass
200 ; CHECK-POSTLINK-O-NEXT: Running pass: InstSimplifyPass
201 ; CHECK-POSTLINK-O-NEXT: Running pass: DivRemPairsPass
202 ; CHECK-POSTLINK-O-NEXT: Running pass: TailCallElimPass
203 ; CHECK-POSTLINK-O-NEXT: Running pass: SimplifyCFGPass
204 ; CHECK-POST-EP-OPT-LAST-NEXT: Running pass: NoOpModulePass
205 ; CHECK-POSTLINK-O-NEXT: Running pass: GlobalDCEPass
206 ; CHECK-POSTLINK-O-NEXT: Running pass: ConstantMergePass
207 ; CHECK-POSTLINK-O-NEXT: Running pass: CGProfilePass
208 ; CHECK-POSTLINK-O-NEXT: Running pass: RelLookupTableConverterPass
209 ; CHECK-EP-OPT-EARLY-NEXT: Running pass: NoOpModulePass
210 ; CHECK-EP-OPT-LAST-NEXT: Running pass: NoOpModulePass
211 ; CHECK-O-NEXT: Running pass: AnnotationRemarksPass on foo
212 ; CHECK-O-NEXT: Running pass: PrintModulePass
214 ; Make sure we get the IR back out without changes when we print the module.
215 ; CHECK-O-LABEL: define void @foo(i32 %n) local_unnamed_addr {
216 ; CHECK-O-NEXT: entry:
217 ; CHECK-O-NEXT: br label %loop
219 ; CHECK-O-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
220 ; CHECK-O-NEXT: %iv.next = add i32 %iv, 1
221 ; CHECK-O-NEXT: tail call void @bar()
222 ; CHECK-O-NEXT: %cmp = icmp eq i32 %iv, %n
223 ; CHECK-O-NEXT: br i1 %cmp, label %exit, label %loop
225 ; CHECK-O-NEXT: ret void
229 declare void @bar() local_unnamed_addr
231 define void @foo(i32 %n) local_unnamed_addr {
235 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
236 %iv.next = add i32 %iv, 1
237 tail call void @bar()
238 %cmp = icmp eq i32 %iv, %n
239 br i1 %cmp, label %exit, label %loop