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