Re-land [openmp] Fix warnings when building on Windows with latest MSVC or Clang...
[llvm-project.git] / llvm / test / Other / new-pm-thinlto-prelink-pgo-defaults.ll
blob09f9f0f48baddb292d2a575452f43362fa786c8d
1 ; Validate ThinLTO prelink pipeline when we have instrumentation PGO
3 ; RUN: llvm-profdata merge %S/Inputs/new-pm-thinlto-prelink-pgo-defaults.proftext -o %t.profdata
5 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
6 ; RUN:     -pgo-kind=pgo-instr-use-pipeline -profile-file='%t.profdata' \
7 ; RUN:     -passes='thinlto-pre-link<O1>' -S %s 2>&1 \
8 ; RUN:     | FileCheck %s --check-prefixes=CHECK-O,CHECK-O1
9 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
10 ; RUN:     -pgo-kind=pgo-instr-use-pipeline -profile-file='%t.profdata' \
11 ; RUN:     -passes='thinlto-pre-link<O2>' -S  %s 2>&1 \
12 ; RUN:     | FileCheck %s --check-prefixes=CHECK-O,CHECK-O2,CHECK-O23SZ
13 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
14 ; RUN:     -pgo-kind=pgo-instr-use-pipeline -profile-file='%t.profdata' \
15 ; RUN:     -passes='thinlto-pre-link<O3>' -S -passes-ep-pipeline-start='no-op-module' %s 2>&1 \
16 ; RUN:     | FileCheck %s --check-prefixes=CHECK-O,CHECK-O3,CHECK-O23SZ,CHECK-EP-PIPELINE-START
17 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
18 ; RUN:     -pgo-kind=pgo-instr-use-pipeline -profile-file='%t.profdata' \
19 ; RUN:     -passes='thinlto-pre-link<Os>' -S %s 2>&1 \
20 ; RUN:     | FileCheck %s --check-prefixes=CHECK-O,CHECK-O23SZ
21 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
22 ; RUN:     -pgo-kind=pgo-instr-use-pipeline -profile-file='%t.profdata' \
23 ; RUN:     -passes='thinlto-pre-link<Oz>' -S %s 2>&1 \
24 ; RUN:     | FileCheck %s --check-prefixes=CHECK-O,CHECK-O23SZ
25 ; RUN: opt -disable-verify -verify-analysis-invalidation=0 -eagerly-invalidate-analyses=0 -debug-pass-manager -debug-info-for-profiling \
26 ; RUN:     -pgo-kind=pgo-instr-use-pipeline -profile-file='%t.profdata' \
27 ; RUN:     -passes='thinlto-pre-link<O2>' -S  %s 2>&1 \
28 ; RUN:     | FileCheck %s --check-prefixes=CHECK-O,CHECK-O2,CHECK-O23SZ
30 ; CHECK-O: Running pass: Annotation2Metadata
31 ; CHECK-O-NEXT: Running pass: ForceFunctionAttrsPass
32 ; CHECK-EP-PIPELINE-START-NEXT: Running pass: NoOpModulePass
33 ; CHECK-O-NEXT: Running pass: InferFunctionAttrsPass
34 ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
35 ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis
36 ; CHECK-O-NEXT: Running pass: CoroEarlyPass
37 ; CHECK-O-NEXT: Running pass: LowerExpectIntrinsicPass
38 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
39 ; CHECK-O-NEXT: Running analysis: TargetIRAnalysis
40 ; CHECK-O-NEXT: Running analysis: AssumptionAnalysis
41 ; CHECK-O-NEXT: Running pass: SROAPass
42 ; CHECK-O-NEXT: Running analysis: DominatorTreeAnalysis
43 ; CHECK-O-NEXT: Running pass: EarlyCSEPass
44 ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis
45 ; CHECK-O3-NEXT: Running pass: CallSiteSplittingPass
46 ; CHECK-O-NEXT: Running pass: OpenMPOptPass
47 ; CHECK-O-NEXT: Running pass: IPSCCPPass
48 ; CHECK-O-NEXT: Running pass: CalledValuePropagationPass
49 ; CHECK-O-NEXT: Running pass: GlobalOptPass
50 ; CHECK-O-NEXT: Running pass: PromotePass
51 ; CHECK-O-NEXT: Running pass: InstCombinePass
52 ; CHECK-O-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis
53 ; CHECK-O-NEXT: Running analysis: AAManager
54 ; CHECK-O-NEXT: Running analysis: BasicAA
55 ; CHECK-O-NEXT: Running analysis: ScopedNoAliasAA
56 ; CHECK-O-NEXT: Running analysis: TypeBasedAA
57 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
58 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
59 ; CHECK-O-NEXT: Running pass: ModuleInlinerWrapperPass
60 ; CHECK-O-NEXT: Running analysis: InlineAdvisorAnalysis
61 ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
62 ; CHECK-O-NEXT: Running analysis: LazyCallGraphAnalysis
63 ; CHECK-O-NEXT: Running analysis: FunctionAnalysisManagerCGSCCProxy on (foo)
64 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
65 ; CHECK-O-NEXT: Running pass: InlinerPass on (foo)
66 ; CHECK-O-NEXT: Running pass: InlinerPass on (foo)
67 ; CHECK-O-NEXT: Running pass: SROAPass on foo
68 ; CHECK-O-NEXT: Running pass: EarlyCSEPass on foo
69 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass on foo
70 ; CHECK-O-NEXT: Running pass: InstCombinePass on foo
71 ; CHECK-O-NEXT: Invalidating analysis: InlineAdvisorAnalysis
72 ; CHECK-O-NEXT: Running pass: GlobalDCEPass
73 ; CHECK-O-NEXT: Running pass: PGOInstrumentationUse
74 ; CHECK-O-NEXT: Running analysis: ProfileSummaryAnalysis
75 ; CHECK-O-NEXT: Running analysis: BranchProbabilityAnalysis on foo
76 ; CHECK-O-NEXT: Running analysis: LoopAnalysis on foo
77 ; CHECK-O-NEXT: Running analysis: PostDominatorTreeAnalysis on foo
78 ; CHECK-O-NEXT: Running analysis: BlockFrequencyAnalysis on foo
79 ; CHECK-O-NEXT: Invalidating analysis: InnerAnalysisManagerProxy
80 ; CHECK-O-NEXT: Invalidating analysis: LazyCallGraphAnalysis on
81 ; CHECK-O-NEXT: Invalidating analysis: InnerAnalysisManagerProxy
82 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}ProfileSummaryAnalysis
83 ; CHECK-O-NEXT: Running pass: PGOIndirectCallPromotion on
84 ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
85 ; CHECK-O-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis on foo
86 ; CHECK-O-NEXT: Running pass: AlwaysInlinerPass
87 ; CHECK-O-NEXT: Running pass: ModuleInlinerWrapperPass
88 ; CHECK-O-NEXT: Running analysis: InlineAdvisorAnalysis
89 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}GlobalsAA
90 ; CHECK-O-NEXT: Running analysis: GlobalsAA
91 ; CHECK-O-NEXT: Running analysis: CallGraphAnalysis
92 ; CHECK-O-NEXT: Running pass: InvalidateAnalysisPass<{{.*}}AAManager
93 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}ProfileSummaryAnalysis
94 ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
95 ; CHECK-O-NEXT: Running analysis: LazyCallGraphAnalysis
96 ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis on foo
97 ; CHECK-O-NEXT: Running analysis: FunctionAnalysisManagerCGSCCProxy
98 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy<{{.*}}LazyCallGraph::SCC{{.*}}>
99 ; CHECK-O-NEXT: Running pass: DevirtSCCRepeatedPass
100 ; CHECK-O-NEXT: Running pass: InlinerPass
101 ; CHECK-O-NEXT: Running pass: PostOrderFunctionAttrsPass
102 ; CHECK-O3-NEXT: Running pass: ArgumentPromotionPass
103 ; CHECK-O2-NEXT: Running pass: OpenMPOptCGSCCPass
104 ; CHECK-O3-NEXT: Running pass: OpenMPOptCGSCCPass
105 ; CHECK-O-NEXT: Running pass: SROAPass
106 ; CHECK-O-NEXT: Running analysis: DominatorTreeAnalysis
107 ; CHECK-O-NEXT: Running analysis: AssumptionAnalysis
108 ; CHECK-O-NEXT: Running analysis: TargetIRAnalysis
109 ; CHECK-O-NEXT: Running pass: EarlyCSEPass
110 ; CHECK-O-NEXT: Running analysis: MemorySSAAnalysis
111 ; CHECK-O-NEXT: Running analysis: AAManager
112 ; CHECK-O-NEXT: Running analysis: BasicAA
113 ; CHECK-O-NEXT: Running analysis: ScopedNoAliasAA
114 ; CHECK-O-NEXT: Running analysis: TypeBasedAA
115 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
116 ; CHECK-O23SZ-NEXT: Running pass: SpeculativeExecutionPass
117 ; CHECK-O23SZ-NEXT: Running pass: JumpThreadingPass
118 ; CHECK-O23SZ-NEXT: Running analysis: LazyValueAnalysis
119 ; CHECK-O23SZ-NEXT: Running pass: CorrelatedValuePropagationPass
120 ; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis
121 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
122 ; CHECK-O-NEXT: Running pass: InstCombinePass
123 ; CHECK-O-NEXT: Running analysis: BlockFrequencyAnalysis on foo
124 ; CHECK-O-NEXT: Running analysis: BranchProbabilityAnalysis on foo
125 ; CHECK-O-NEXT: Running analysis: LoopAnalysis on foo
126 ; CHECK-O-NEXT: Running analysis: PostDominatorTreeAnalysis on foo
127 ; CHECK-O23SZ-NEXT: Running pass: AggressiveInstCombinePass
128 ; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass
129 ; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass
130 ; CHECK-O3-NEXT: Running pass: LibCallsShrinkWrapPass
131 ; CHECK-O2-NEXT: Running pass: PGOMemOPSizeOpt
132 ; CHECK-O3-NEXT: Running pass: PGOMemOPSizeOpt
133 ; CHECK-O23SZ-NEXT: Running pass: TailCallElimPass
134 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
135 ; CHECK-O-NEXT: Running pass: ReassociatePass
136 ; CHECK-O23SZ-NEXT: Running pass: ConstraintEliminationPass
137 ; CHECK-O23SZ-NEXT: Running analysis: ScalarEvolutionAnalysis
138 ; CHECK-O-NEXT: Running pass: LoopSimplifyPass
139 ; CHECK-O-NEXT: Running pass: LCSSAPass
140 ; CHECK-O1-NEXT: Running analysis: ScalarEvolutionAnalysis
141 ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
142 ; CHECK-O-NEXT: Running pass: LoopInstSimplifyPass
143 ; CHECK-O-NEXT: Running pass: LoopSimplifyCFGPass
144 ; CHECK-O-NEXT: Running pass: LICM
145 ; CHECK-O-NEXT: Running pass: LoopRotatePass
146 ; CHECK-O-NEXT: Running pass: LICM
147 ; CHECK-O-NEXT: Running pass: SimpleLoopUnswitchPass
148 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
149 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
150 ; CHECK-O-NEXT: Running pass: InstCombinePass
151 ; CHECK-O-NEXT: Running pass: LoopSimplifyPass
152 ; CHECK-O-NEXT: Running pass: LCSSAPass
153 ; CHECK-O-NEXT: Running pass: LoopIdiomRecognizePass
154 ; CHECK-O-NEXT: Running pass: IndVarSimplifyPass
155 ; CHECK-O-NEXT: Running pass: LoopDeletionPass
156 ; CHECK-O-NEXT: Running pass: LoopFullUnrollPass
157 ; CHECK-O-NEXT: Running pass: SROAPass on foo
158 ; CHECK-O23SZ-NEXT: Running pass: VectorCombinePass
159 ; CHECK-O23SZ-NEXT: Running pass: MergedLoadStoreMotionPass
160 ; CHECK-O23SZ-NEXT: Running pass: GVNPass
161 ; CHECK-O23SZ-NEXT: Running analysis: MemoryDependenceAnalysis
162 ; CHECK-O1-NEXT: Running pass: MemCpyOptPass
163 ; CHECK-O-NEXT: Running pass: SCCPPass
164 ; CHECK-O-NEXT: Running pass: BDCEPass
165 ; CHECK-O-NEXT: Running analysis: DemandedBitsAnalysis
166 ; CHECK-O-NEXT: Running pass: InstCombinePass
167 ; CHECK-O23SZ-NEXT: Running pass: JumpThreadingPass
168 ; CHECK-O23SZ-NEXT: Running analysis: LazyValueAnalysis
169 ; CHECK-O23SZ-NEXT: Running pass: CorrelatedValuePropagationPass
170 ; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis
171 ; CHECK-O1-NEXT: Running pass: CoroElidePass
172 ; CHECK-O-NEXT: Running pass: ADCEPass
173 ; CHECK-O23SZ-NEXT: Running pass: MemCpyOptPass
174 ; CHECK-O23SZ-NEXT: Running pass: DSEPass
175 ; CHECK-O23SZ-NEXT: Running pass: MoveAutoInitPass on foo
176 ; CHECK-O23SZ-NEXT: Running pass: LoopSimplifyPass
177 ; CHECK-O23SZ-NEXT: Running pass: LCSSAPass
178 ; CHECK-O23SZ-NEXT: Running pass: LICMPass
179 ; CHECK-O23SZ-NEXT: Running pass: CoroElidePass
180 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
181 ; CHECK-O-NEXT: Running pass: InstCombinePass
182 ; CHECK-O-NEXT: Running pass: PostOrderFunctionAttrsPass
183 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}ShouldNotRunFunctionPassesAnalysis
184 ; CHECK-O-NEXT: Running analysis: ShouldNotRunFunctionPassesAnalysis
185 ; CHECK-O-NEXT: Running pass: CoroSplitPass
186 ; CHECK-O-NEXT: Running pass: InvalidateAnalysisPass<{{.*}}ShouldNotRunFunctionPassesAnalysis
187 ; CHECK-O-NEXT: Invalidating analysis: ShouldNotRunFunctionPassesAnalysis
188 ; CHECK-O-NEXT: Invalidating analysis: InlineAdvisorAnalysis
189 ; CHECK-O-NEXT: Running pass: DeadArgumentEliminationPass
190 ; CHECK-O-NEXT: Running pass: CoroCleanupPass
191 ; CHECK-O-NEXT: Running pass: GlobalOptPass
192 ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis on bar
193 ; CHECK-O-NEXT: Running pass: GlobalDCEPass
194 ; CHECK-EXT: Running pass: {{.*}}::Bye
195 ; CHECK-O-NEXT: Running pass: AnnotationRemarksPass on foo
196 ; CHECK-O-NEXT: Running pass: CanonicalizeAliasesPass
197 ; CHECK-O-NEXT: Running pass: NameAnonGlobalPass
198 ; CHECK-O-NEXT: Running pass: PrintModulePass
200 ; Make sure we get the IR back out without changes when we print the module.
201 ; CHECK-O-LABEL: define void @foo(i32 %n) local_unnamed_addr {
202 ; CHECK-O-NEXT: entry:
203 ; CHECK-O-NEXT:   br label %loop
204 ; CHECK-O:      loop:
205 ; CHECK-O-NEXT:   %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
206 ; CHECK-O-NEXT:   %iv.next = add i32 %iv, 1
207 ; CHECK-O-NEXT:   tail call void @bar()
208 ; CHECK-O-NEXT:   %cmp = icmp eq i32 %iv, %n
209 ; CHECK-O-NEXT:   br i1 %cmp, label %exit, label %loop
210 ; CHECK-O:      exit:
211 ; CHECK-O-NEXT:   ret void
212 ; CHECK-O-NEXT: }
214 ; Ignore a bunch of intervening metadata containing profile data.
217 declare void @bar() local_unnamed_addr
219 define void @foo(i32 %n) local_unnamed_addr {
220 entry:
221   br label %loop
222 loop:
223   %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
224   %iv.next = add i32 %iv, 1
225   tail call void @bar()
226   %cmp = icmp eq i32 %iv, %n
227   br i1 %cmp, label %exit, label %loop
228 exit:
229   ret void