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: TargetLibraryAnalysis
58 ; CHECK-O-NEXT: Running analysis: AAManager
59 ; CHECK-O-NEXT: Running analysis: BasicAA
60 ; CHECK-O-NEXT: Running analysis: ScopedNoAliasAA
61 ; CHECK-O-NEXT: Running analysis: TypeBasedAA
62 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
63 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
64 ; CHECK-O-NEXT: Running pass: AlwaysInlinerPass
65 ; CHECK-PRELINK-O-NEXT: Running analysis: ProfileSummaryAnalysis
66 ; CHECK-O-NEXT: Running pass: ModuleInlinerWrapperPass
67 ; CHECK-O-NEXT: Running analysis: InlineAdvisorAnalysis
68 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}GlobalsAA
69 ; CHECK-O-NEXT: Running analysis: GlobalsAA
70 ; CHECK-O-NEXT: Running analysis: CallGraphAnalysis
71 ; CHECK-O-NEXT: Running pass: InvalidateAnalysisPass<{{.*}}AAManager
72 ; CHECK-O-NEXT: Invalidating analysis: AAManager
73 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}ProfileSummaryAnalysis
74 ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
75 ; CHECK-O-NEXT: Running analysis: LazyCallGraphAnalysis
76 ; CHECK-O-NEXT: Running analysis: FunctionAnalysisManagerCGSCCProxy
77 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
78 ; CHECK-O-NEXT: Running pass: DevirtSCCRepeatedPass
79 ; CHECK-O-NEXT: Running pass: InlinerPass
80 ; CHECK-O-NEXT: Running pass: PostOrderFunctionAttrsPass
81 ; CHECK-O3-NEXT: Running pass: ArgumentPromotionPass
82 ; CHECK-O2-NEXT: Running pass: OpenMPOptCGSCCPass on (foo)
83 ; CHECK-O3-NEXT: Running pass: OpenMPOptCGSCCPass on (foo)
84 ; CHECK-O-NEXT: Running pass: SROAPass
85 ; CHECK-O-NEXT: Running pass: EarlyCSEPass
86 ; CHECK-O-NEXT: Running analysis: MemorySSAAnalysis
87 ; CHECK-O-NEXT: Running analysis: AAManager
88 ; CHECK-O23SZ-NEXT: Running pass: SpeculativeExecutionPass
89 ; CHECK-O23SZ-NEXT: Running pass: JumpThreadingPass
90 ; CHECK-O23SZ-NEXT: Running analysis: LazyValueAnalysis
91 ; CHECK-O23SZ-NEXT: Running pass: CorrelatedValuePropagationPass
92 ; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis
93 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
94 ; CHECK-O-NEXT: Running pass: InstCombinePass
95 ; CHECK-O23SZ-NEXT: Running pass: AggressiveInstCombinePass
96 ; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass
97 ; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass
98 ; CHECK-O3-NEXT: Running pass: LibCallsShrinkWrapPass
99 ; CHECK-O23SZ-NEXT: Running pass: TailCallElimPass
100 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
101 ; CHECK-O-NEXT: Running pass: ReassociatePass
102 ; CHECK-O23SZ-NEXT: Running pass: ConstraintEliminationPass
103 ; CHECK-O23SZ-NEXT: Running analysis: LoopAnalysis
104 ; CHECK-O23SZ-NEXT: Running analysis: ScalarEvolutionAnalysis
105 ; CHECK-O-NEXT: Running pass: LoopSimplifyPass
106 ; CHECK-O1-NEXT: Running analysis: LoopAnalysis
107 ; CHECK-O-NEXT: Running pass: LCSSAPass
108 ; CHECK-O1-NEXT: Running analysis: ScalarEvolutionAnalysis
109 ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
110 ; CHECK-O-NEXT: Running pass: LoopInstSimplifyPass
111 ; CHECK-O-NEXT: Running pass: LoopSimplifyCFGPass
112 ; CHECK-O-NEXT: Running pass: LICM
113 ; CHECK-O-NEXT: Running pass: LoopRotatePass
114 ; CHECK-O-NEXT: Running pass: LICM
115 ; CHECK-O-NEXT: Running pass: SimpleLoopUnswitchPass
116 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
117 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
118 ; CHECK-O-NEXT: Running pass: InstCombinePass
119 ; CHECK-O-NEXT: Running pass: LoopSimplifyPass
120 ; CHECK-O-NEXT: Running pass: LCSSAPass
121 ; CHECK-O-NEXT: Running pass: LoopIdiomRecognizePass
122 ; CHECK-O-NEXT: Running pass: IndVarSimplifyPass
123 ; CHECK-O-NEXT: Running pass: LoopDeletionPass
124 ; CHECK-O-NEXT: Running pass: LoopFullUnrollPass
125 ; CHECK-O-NEXT: Running pass: SROAPass on foo
126 ; CHECK-O23SZ-NEXT: Running pass: VectorCombinePass
127 ; CHECK-O23SZ-NEXT: Running pass: MergedLoadStoreMotionPass
128 ; CHECK-O23SZ-NEXT: Running pass: GVNPass
129 ; CHECK-O23SZ-NEXT: Running analysis: MemoryDependenceAnalysis
130 ; CHECK-O1-NEXT: Running pass: MemCpyOptPass
131 ; CHECK-O1-NEXT: Running analysis: PostDominatorTreeAnalysis
132 ; CHECK-O-NEXT: Running pass: SCCPPass
133 ; CHECK-O-NEXT: Running pass: BDCEPass
134 ; CHECK-O-NEXT: Running analysis: DemandedBitsAnalysis
135 ; CHECK-O-NEXT: Running pass: InstCombinePass
136 ; CHECK-O23SZ-NEXT: Running pass: JumpThreadingPass
137 ; CHECK-O23SZ-NEXT: Running analysis: LazyValueAnalysis
138 ; CHECK-O23SZ-NEXT: Running pass: CorrelatedValuePropagationPass
139 ; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis
140 ; CHECK-O1-NEXT: Running pass: CoroElidePass
141 ; CHECK-O-NEXT: Running pass: ADCEPass
142 ; CHECK-O23SZ-NEXT: Running analysis: PostDominatorTreeAnalysis
143 ; CHECK-O23SZ-NEXT: Running pass: MemCpyOptPass
144 ; CHECK-O23SZ-NEXT: Running pass: DSEPass
145 ; CHECK-O23SZ-NEXT: Running pass: MoveAutoInitPass on foo
146 ; CHECK-O23SZ-NEXT: Running pass: LoopSimplifyPass
147 ; CHECK-O23SZ-NEXT: Running pass: LCSSAPass
148 ; CHECK-O23SZ-NEXT: Running pass: LICMPass on loop
149 ; CHECK-O23SZ-NEXT: Running pass: CoroElidePass
150 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
151 ; CHECK-O-NEXT: Running pass: InstCombinePass
152 ; CHECK-O-NEXT: Running pass: PostOrderFunctionAttrsPass
153 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}ShouldNotRunFunctionPassesAnalysis
154 ; CHECK-O-NEXT: Running analysis: ShouldNotRunFunctionPassesAnalysis
155 ; CHECK-O-NEXT: Running pass: CoroSplitPass
156 ; CHECK-O-NEXT: Running pass: InvalidateAnalysisPass<{{.*}}ShouldNotRunFunctionPassesAnalysis
157 ; CHECK-O-NEXT: Invalidating analysis: ShouldNotRunFunctionPassesAnalysis
158 ; CHECK-O-NEXT: Invalidating analysis: InlineAdvisorAnalysis
159 ; CHECK-O-NEXT: Running pass: DeadArgumentEliminationPass
160 ; CHECK-O-NEXT: Running pass: CoroCleanupPass
161 ; CHECK-POSTLINK-O-NEXT: Running pass: GlobalOptPass
162 ; CHECK-POSTLINK-O-NEXT: Running pass: GlobalDCEPass
163 ; CHECK-POSTLINK-O-NEXT: Running pass: EliminateAvailableExternallyPass
164 ; CHECK-POSTLINK-O-NEXT: Running pass: ReversePostOrderFunctionAttrsPass
165 ; CHECK-POSTLINK-O-NEXT: Running pass: RecomputeGlobalsAAPass
166 ; CHECK-POST-EP-OPT-EARLY-NEXT: Running pass: NoOpModulePass
167 ; CHECK-POSTLINK-O-NEXT: Running pass: Float2IntPass
168 ; CHECK-POSTLINK-O-NEXT: Running pass: LowerConstantIntrinsicsPass
169 ; CHECK-POSTLINK-O3-NEXT: Running pass: ControlHeightReductionPass
170 ; CHECK-EXT: Running pass: {{.*}}::Bye
171 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopSimplifyPass
172 ; CHECK-POSTLINK-O-NEXT: Running pass: LCSSAPass
173 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopRotatePass
174 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopDeletionPass
175 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopDistributePass
176 ; CHECK-POSTLINK-O-NEXT: Running analysis: LoopAccessAnalysis on foo
177 ; CHECK-POSTLINK-O-NEXT: Running pass: InjectTLIMappings
178 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopVectorizePass
179 ; CHECK-POSTLINK-O-NEXT: Running pass: InferAlignmentPass
180 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopLoadEliminationPass
181 ; CHECK-POSTLINK-O-NEXT: Running pass: InstCombinePass
182 ; CHECK-POSTLINK-O-NEXT: Running pass: SimplifyCFGPass
183 ; CHECK-POSTLINK-O2-NEXT: Running pass: SLPVectorizerPass
184 ; CHECK-POSTLINK-O3-NEXT: Running pass: SLPVectorizerPass
185 ; CHECK-POSTLINK-Os-NEXT: Running pass: SLPVectorizerPass
186 ; CHECK-POSTLINK-O-NEXT: Running pass: VectorCombinePass
187 ; CHECK-POSTLINK-O-NEXT: Running pass: InstCombinePass
188 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopUnrollPass
189 ; CHECK-POSTLINK-O-NEXT: Running pass: WarnMissedTransformationsPass
190 ; CHECK-POSTLINK-O-NEXT: Running pass: SROAPass
191 ; CHECK-POSTLINK-O-NEXT: Running pass: InferAlignmentPass
192 ; CHECK-POSTLINK-O-NEXT: Running pass: InstCombinePass
193 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopSimplifyPass
194 ; CHECK-POSTLINK-O-NEXT: Running pass: LCSSAPass
195 ; CHECK-POSTLINK-O-NEXT: Running pass: LICMPass
196 ; CHECK-POSTLINK-O-NEXT: Running pass: AlignmentFromAssumptionsPass
197 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopSinkPass
198 ; CHECK-POSTLINK-O-NEXT: Running pass: InstSimplifyPass
199 ; CHECK-POSTLINK-O-NEXT: Running pass: DivRemPairsPass
200 ; CHECK-POSTLINK-O-NEXT: Running pass: TailCallElimPass
201 ; CHECK-POSTLINK-O-NEXT: Running pass: SimplifyCFGPass
202 ; CHECK-POST-EP-OPT-LAST-NEXT: Running pass: NoOpModulePass
203 ; CHECK-POSTLINK-O-NEXT: Running pass: GlobalDCEPass
204 ; CHECK-POSTLINK-O-NEXT: Running pass: ConstantMergePass
205 ; CHECK-POSTLINK-O-NEXT: Running pass: CGProfilePass
206 ; CHECK-POSTLINK-O-NEXT: Running pass: RelLookupTableConverterPass
207 ; CHECK-EP-OPT-EARLY-NEXT: Running pass: NoOpModulePass
208 ; CHECK-EP-OPT-LAST-NEXT: Running pass: NoOpModulePass
209 ; CHECK-O-NEXT: Running pass: AnnotationRemarksPass on foo
210 ; CHECK-O-NEXT: Running pass: PrintModulePass
212 ; Make sure we get the IR back out without changes when we print the module.
213 ; CHECK-O-LABEL: define void @foo(i32 %n) local_unnamed_addr {
214 ; CHECK-O-NEXT: entry:
215 ; CHECK-O-NEXT: br label %loop
217 ; CHECK-O-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
218 ; CHECK-O-NEXT: %iv.next = add i32 %iv, 1
219 ; CHECK-O-NEXT: tail call void @bar()
220 ; CHECK-O-NEXT: %cmp = icmp eq i32 %iv, %n
221 ; CHECK-O-NEXT: br i1 %cmp, label %exit, label %loop
223 ; CHECK-O-NEXT: ret void
227 declare void @bar() local_unnamed_addr
229 define void @foo(i32 %n) local_unnamed_addr {
233 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
234 %iv.next = add i32 %iv, 1
235 tail call void @bar()
236 %cmp = icmp eq i32 %iv, %n
237 br i1 %cmp, label %exit, label %loop