1 ; Validate ThinLTO post link pipeline when we have instrumentation PGO
4 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
5 ; RUN: -passes='thinlto<O1>' -S %s 2>&1 \
6 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O123,CHECK-O1,%llvmcheckext
7 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
8 ; RUN: -passes='thinlto<O2>' -S %s 2>&1 \
9 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O123,CHECK-O2,CHECK-O23SZ,%llvmcheckext
10 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager -passes-ep-pipeline-start='no-op-module' \
11 ; RUN: -passes='thinlto<O3>' -S %s 2>&1 \
12 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O123,CHECK-O3,CHECK-O23SZ,%llvmcheckext
13 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
14 ; RUN: -passes='thinlto<Os>' -S %s 2>&1 \
15 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-OSZ,CHECK-Os,CHECK-O23SZ,%llvmcheckext
16 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
17 ; RUN: -passes='thinlto<Oz>' -S %s 2>&1 \
18 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-OSZ,CHECK-O23SZ,%llvmcheckext
19 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager -debug-info-for-profiling \
20 ; RUN: -passes='thinlto<O2>' -S %s 2>&1 \
21 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O123,CHECK-O2,CHECK-O23SZ,%llvmcheckext
23 ; Suppress FileCheck --allow-unused-prefixes=false diagnostics.
26 ; CHECK-EP-PIPELINE-START: Running pass: NoOpModulePass
27 ; CHECK-O: Running pass: PGOIndirectCallPromotion
28 ; CHECK-O-NEXT: Running analysis: ProfileSummaryAnalysis
29 ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
30 ; CHECK-O-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis
31 ; CHECK-O-NEXT: Running pass: InferFunctionAttrsPass
32 ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis
33 ; CHECK-O-NEXT: Running pass: CoroEarlyPass
34 ; CHECK-O-NEXT: Running pass: LowerExpectIntrinsicPass
35 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
36 ; CHECK-O-NEXT: Running analysis: TargetIRAnalysis
37 ; CHECK-O-NEXT: Running analysis: AssumptionAnalysis
38 ; CHECK-O-NEXT: Running pass: SROAPass
39 ; CHECK-O-NEXT: Running analysis: DominatorTreeAnalysis
40 ; CHECK-O-NEXT: Running pass: EarlyCSEPass
41 ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis
42 ; CHECK-O3-NEXT: Running pass: CallSiteSplittingPass
43 ; CHECK-O-NEXT: Running pass: OpenMPOptPass
44 ; CHECK-O-NEXT: Running pass: LowerTypeTestsPass
45 ; CHECK-O-NEXT: Running pass: IPSCCPPass
46 ; CHECK-O123-NEXT: Running analysis: LoopAnalysis on foo
47 ; CHECK-O-NEXT: Running pass: CalledValuePropagationPass
48 ; CHECK-O-NEXT: Running pass: GlobalOptPass
49 ; CHECK-O-NEXT: Running pass: PromotePass
50 ; CHECK-O-NEXT: Running pass: InstCombinePass
51 ; CHECK-O-NEXT: Running analysis: AAManager
52 ; CHECK-O-NEXT: Running analysis: BasicAA
53 ; CHECK-O-NEXT: Running analysis: ScopedNoAliasAA
54 ; CHECK-O-NEXT: Running analysis: TypeBasedAA
55 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
56 ; CHECK-O-NEXT: Running analysis: BlockFrequencyAnalysis on foo
57 ; CHECK-O-NEXT: Running analysis: BranchProbabilityAnalysis on foo
58 ; CHECK-OSZ-NEXT: Running analysis: LoopAnalysis on foo
59 ; CHECK-O-NEXT: Running analysis: PostDominatorTreeAnalysis on foo
60 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
61 ; CHECK-O-NEXT: Running pass: ModuleInlinerWrapperPass
62 ; CHECK-O-NEXT: Running analysis: InlineAdvisorAnalysis
63 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}GlobalsAA
64 ; CHECK-O-NEXT: Running analysis: GlobalsAA
65 ; CHECK-O-NEXT: Running analysis: CallGraphAnalysis
66 ; CHECK-O-NEXT: Running pass: InvalidateAnalysisPass<{{.*}}AAManager
67 ; CHECK-O-NEXT: Invalidating analysis: AAManager
68 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}ProfileSummaryAnalysis
69 ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
70 ; CHECK-O-NEXT: Running analysis: LazyCallGraphAnalysis
71 ; CHECK-O-NEXT: Running analysis: FunctionAnalysisManagerCGSCCProxy
72 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy<{{.*}}LazyCallGraph::SCC{{.*}}>
73 ; CHECK-O-NEXT: Running pass: DevirtSCCRepeatedPass
74 ; CHECK-O-NEXT: Running pass: InlinerPass
75 ; CHECK-O-NEXT: Running pass: InlinerPass
76 ; CHECK-O-NEXT: Running pass: PostOrderFunctionAttrsPass
77 ; CHECK-O3-NEXT: Running pass: ArgumentPromotionPass
78 ; CHECK-O2-NEXT: Running pass: OpenMPOptCGSCCPass
79 ; CHECK-O3-NEXT: Running pass: OpenMPOptCGSCCPass
80 ; CHECK-O-NEXT: Running pass: SROAPass
81 ; CHECK-O-NEXT: Running pass: EarlyCSEPass
82 ; CHECK-O-NEXT: Running analysis: MemorySSAAnalysis
83 ; CHECK-O-NEXT: Running analysis: AAManager
84 ; CHECK-O23SZ-NEXT: Running pass: SpeculativeExecutionPass
85 ; CHECK-O23SZ-NEXT: Running pass: JumpThreadingPass
86 ; CHECK-O23SZ-NEXT: Running analysis: LazyValueAnalysis
87 ; CHECK-O23SZ-NEXT: Running pass: CorrelatedValuePropagationPass
88 ; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis
89 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
90 ; CHECK-O-NEXT: Running pass: InstCombinePass
91 ; CHECK-O23SZ-NEXT: Running pass: AggressiveInstCombinePass
92 ; CHECK-O23SZ-NEXT: Running pass: ConstraintEliminationPass
93 ; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass
94 ; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass
95 ; CHECK-O3-NEXT: Running pass: LibCallsShrinkWrapPass
96 ; CHECK-O23SZ-NEXT: Running pass: TailCallElimPass
97 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
98 ; CHECK-O-NEXT: Running pass: ReassociatePass
99 ; CHECK-O-NEXT: Running pass: LoopSimplifyPass
100 ; CHECK-O-NEXT: Running pass: LCSSAPass
101 ; CHECK-O-NEXT: Running analysis: ScalarEvolutionAnalysis
102 ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
103 ; CHECK-O-NEXT: Running pass: LoopInstSimplifyPass
104 ; CHECK-O-NEXT: Running pass: LoopSimplifyCFGPass
105 ; CHECK-O-NEXT: Running pass: LICM
106 ; CHECK-O-NEXT: Running pass: LoopRotatePass
107 ; CHECK-O-NEXT: Running pass: LICM
108 ; CHECK-O-NEXT: Running pass: SimpleLoopUnswitchPass
109 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
110 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
111 ; CHECK-O-NEXT: Running pass: InstCombinePass
112 ; CHECK-O-NEXT: Running pass: LoopSimplifyPass
113 ; CHECK-O-NEXT: Running pass: LCSSAPass
114 ; CHECK-O-NEXT: Running pass: LoopIdiomRecognizePass
115 ; CHECK-O-NEXT: Running pass: IndVarSimplifyPass
116 ; CHECK-O-NEXT: Running pass: LoopDeletionPass
117 ; CHECK-O-NEXT: Running pass: LoopFullUnrollPass
118 ; CHECK-O-NEXT: Running pass: SROAPass on foo
119 ; CHECK-O23SZ-NEXT: Running pass: VectorCombinePass
120 ; CHECK-O23SZ-NEXT: Running pass: MergedLoadStoreMotionPass
121 ; CHECK-O23SZ-NEXT: Running pass: GVNPass
122 ; CHECK-O23SZ-NEXT: Running analysis: MemoryDependenceAnalysis
123 ; CHECK-O1-NEXT: Running pass: MemCpyOptPass
124 ; CHECK-O-NEXT: Running pass: SCCPPass
125 ; CHECK-O-NEXT: Running pass: BDCEPass
126 ; CHECK-O-NEXT: Running analysis: DemandedBitsAnalysis
127 ; CHECK-O-NEXT: Running pass: InstCombinePass
128 ; CHECK-O23SZ-NEXT: Running pass: JumpThreadingPass
129 ; CHECK-O23SZ-NEXT: Running analysis: LazyValueAnalysis
130 ; CHECK-O23SZ-NEXT: Running pass: CorrelatedValuePropagationPass
131 ; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis
132 ; CHECK-O1-NEXT: Running pass: CoroElidePass
133 ; CHECK-O-NEXT: Running pass: ADCEPass
134 ; CHECK-O23SZ-NEXT: Running pass: MemCpyOptPass
135 ; CHECK-O23SZ-NEXT: Running pass: DSEPass
136 ; CHECK-O23SZ-NEXT: Running pass: MoveAutoInitPass on foo
137 ; CHECK-O23SZ-NEXT: Running pass: LoopSimplifyPass
138 ; CHECK-O23SZ-NEXT: Running pass: LCSSAPass
139 ; CHECK-O23SZ-NEXT: Running pass: LICMPass
140 ; CHECK-O23SZ-NEXT: Running pass: CoroElidePass
141 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
142 ; CHECK-O-NEXT: Running pass: InstCombinePass
143 ; CHECK-O-NEXT: Running pass: PostOrderFunctionAttrsPass
144 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}ShouldNotRunFunctionPassesAnalysis
145 ; CHECK-O-NEXT: Running analysis: ShouldNotRunFunctionPassesAnalysis
146 ; CHECK-O-NEXT: Running pass: CoroSplitPass
147 ; CHECK-O-NEXT: Running pass: InvalidateAnalysisPass<{{.*}}ShouldNotRunFunctionPassesAnalysis
148 ; CHECK-O-NEXT: Invalidating analysis: ShouldNotRunFunctionPassesAnalysis
149 ; CHECK-O-NEXT: Invalidating analysis: InlineAdvisorAnalysis
150 ; CHECK-O-NEXT: Running pass: DeadArgumentEliminationPass
151 ; CHECK-O-NEXT: Running pass: CoroCleanupPass
152 ; CHECK-O-NEXT: Running pass: GlobalOptPass
153 ; CHECK-O-NEXT: Running pass: GlobalDCEPass
154 ; CHECK-O-NEXT: Running pass: EliminateAvailableExternallyPass
155 ; CHECK-O-NEXT: Running pass: ReversePostOrderFunctionAttrsPass
156 ; CHECK-O-NEXT: Running pass: RecomputeGlobalsAAPass
157 ; CHECK-O-NEXT: Running pass: Float2IntPass
158 ; CHECK-O-NEXT: Running pass: LowerConstantIntrinsicsPass
159 ; CHECK-O3-NEXT: Running pass: ControlHeightReductionPass
160 ; CHECK-O3-NEXT: Running analysis: RegionInfoAnalysis
161 ; CHECK-O3-NEXT: Running analysis: DominanceFrontierAnalysis
162 ; CHECK-EXT: Running pass: {{.*}}::Bye
163 ; CHECK-O-NEXT: Running pass: LoopSimplifyPass on foo
164 ; CHECK-O-NEXT: Running pass: LCSSAPass on foo
165 ; CHECK-O-NEXT: Running pass: LoopRotatePass
166 ; CHECK-O-NEXT: Running pass: LoopDeletionPass
167 ; CHECK-O-NEXT: Running pass: LoopDistributePass
168 ; CHECK-O-NEXT: Running analysis: LoopAccessAnalysis on foo
169 ; CHECK-O-NEXT: Running pass: InjectTLIMappings
170 ; CHECK-O-NEXT: Running pass: LoopVectorizePass
171 ; CHECK-O-NEXT: Running pass: LoopLoadEliminationPass
172 ; CHECK-O-NEXT: Running pass: InstCombinePass
173 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
174 ; CHECK-O2-NEXT: Running pass: SLPVectorizerPass
175 ; CHECK-O3-NEXT: Running pass: SLPVectorizerPass
176 ; CHECK-Os-NEXT: Running pass: SLPVectorizerPass
177 ; CHECK-O-NEXT: Running pass: VectorCombinePass
178 ; CHECK-O-NEXT: Running pass: InstCombinePass
179 ; CHECK-O-NEXT: Running pass: LoopUnrollPass
180 ; CHECK-O-NEXT: Running pass: WarnMissedTransformationsPass
181 ; CHECK-O-NEXT: Running pass: SROAPass
182 ; CHECK-O-NEXT: Running pass: InstCombinePass
183 ; CHECK-O-NEXT: Running pass: LoopSimplifyPass
184 ; CHECK-O-NEXT: Running pass: LCSSAPass
185 ; CHECK-O-NEXT: Running pass: LICMPass
186 ; CHECK-O-NEXT: Running pass: AlignmentFromAssumptionsPass
187 ; CHECK-O-NEXT: Running pass: LoopSinkPass
188 ; CHECK-O-NEXT: Running pass: InstSimplifyPass
189 ; CHECK-O-NEXT: Running pass: DivRemPairsPass
190 ; CHECK-O-NEXT: Running pass: TailCallElimPass
191 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
192 ; CHECK-O-NEXT: Running pass: GlobalDCEPass
193 ; CHECK-O-NEXT: Running pass: ConstantMergePass
194 ; CHECK-O-NEXT: Running pass: CGProfilePass
195 ; CHECK-O-NEXT: Running pass: RelLookupTableConverterPass
196 ; CHECK-O-NEXT: Running pass: AnnotationRemarksPass on foo
197 ; CHECK-O-NEXT: Running pass: PrintModulePass
199 ; Make sure we get the IR back out without changes when we print the module.
200 ; CHECK-O-LABEL: define void @foo(i32 %n) local_unnamed_addr {
201 ; CHECK-O-NEXT: entry:
202 ; CHECK-O-NEXT: br label %loop
204 ; CHECK-O-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
205 ; CHECK-O-NEXT: %iv.next = add i32 %iv, 1
206 ; CHECK-O-NEXT: tail call void @bar()
207 ; CHECK-O-NEXT: %cmp = icmp eq i32 %iv, %n
208 ; CHECK-O-NEXT: br i1 %cmp, label %exit, label %loop
210 ; CHECK-O-NEXT: ret void
213 ; Ignore a bunch of intervening metadata containing profile data.
216 declare void @bar() local_unnamed_addr
218 define void @foo(i32 %n) local_unnamed_addr {
222 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
223 %iv.next = add i32 %iv, 1
224 tail call void @bar()
225 %cmp = icmp eq i32 %iv, %n
226 br i1 %cmp, label %exit, label %loop
231 !llvm.module.flags = !{!0}
233 !0 = !{i32 1, !"ProfileSummary", !1}
234 !1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
235 !2 = !{!"ProfileFormat", !"InstrProf"}
236 !3 = !{!"TotalCount", i64 0}
237 !4 = !{!"MaxCount", i64 0}
238 !5 = !{!"MaxInternalCount", i64 0}
239 !6 = !{!"MaxFunctionCount", i64 0}
240 !7 = !{!"NumCounts", i64 0}
241 !8 = !{!"NumFunctions", i64 0}
242 !9 = !{!"DetailedSummary", !10}
243 !10 = !{!11, !12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26}
244 !11 = !{i32 10000, i64 0, i32 0}
245 !12 = !{i32 100000, i64 0, i32 0}
246 !13 = !{i32 200000, i64 0, i32 0}
247 !14 = !{i32 300000, i64 0, i32 0}
248 !15 = !{i32 400000, i64 0, i32 0}
249 !16 = !{i32 500000, i64 0, i32 0}
250 !17 = !{i32 600000, i64 0, i32 0}
251 !18 = !{i32 700000, i64 0, i32 0}
252 !19 = !{i32 800000, i64 0, i32 0}
253 !20 = !{i32 900000, i64 0, i32 0}
254 !21 = !{i32 950000, i64 0, i32 0}
255 !22 = !{i32 990000, i64 0, i32 0}
256 !23 = !{i32 999000, i64 0, i32 0}
257 !24 = !{i32 999900, i64 0, i32 0}
258 !25 = !{i32 999990, i64 0, i32 0}
259 !26 = !{i32 999999, i64 0, i32 0}