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