[sanitizer] Improve FreeBSD ASLR detection
[llvm-project.git] / llvm / test / Other / new-pm-thinlto-postlink-samplepgo-defaults.ll
blob0868d81ee81e4d7b612380a254e8486f71716f9e
1 ; Validate ThinLTO postlink pipeline when we have Sample PGO
3 ; RUN: opt -disable-verify -verify-cfg-preserved=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
4 ; RUN:     -pgo-kind=pgo-sample-use-pipeline -profile-file='%S/Inputs/new-pm-thinlto-samplepgo-defaults.prof' \
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-cfg-preserved=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
8 ; RUN:     -pgo-kind=pgo-sample-use-pipeline -profile-file='%S/Inputs/new-pm-thinlto-samplepgo-defaults.prof' \
9 ; RUN:     -passes='thinlto<O2>' -S  %s 2>&1 \
10 ; RUN:     | FileCheck %s --check-prefixes=CHECK-O,CHECK-O2,CHECK-O23SZ,%llvmcheckext
11 ; RUN: opt -disable-verify -verify-cfg-preserved=0 -eagerly-invalidate-analyses=0 -debug-pass-manager -passes-ep-pipeline-start='no-op-module' \
12 ; RUN:     -pgo-kind=pgo-sample-use-pipeline -profile-file='%S/Inputs/new-pm-thinlto-samplepgo-defaults.prof' \
13 ; RUN:     -passes='thinlto<O3>' -S  %s 2>&1 \
14 ; RUN:     | FileCheck %s --check-prefixes=CHECK-O,CHECK-O3,CHECK-O23SZ,%llvmcheckext
15 ; RUN: opt -disable-verify -verify-cfg-preserved=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
16 ; RUN:     -pgo-kind=pgo-sample-use-pipeline -profile-file='%S/Inputs/new-pm-thinlto-samplepgo-defaults.prof' \
17 ; RUN:     -passes='thinlto<Os>' -S %s 2>&1 \
18 ; RUN:     | FileCheck %s --check-prefixes=CHECK-O,CHECK-Os,CHECK-O23SZ,%llvmcheckext
19 ; RUN: opt -disable-verify -verify-cfg-preserved=0 -eagerly-invalidate-analyses=0 -debug-pass-manager \
20 ; RUN:     -pgo-kind=pgo-sample-use-pipeline -profile-file='%S/Inputs/new-pm-thinlto-samplepgo-defaults.prof' \
21 ; RUN:     -passes='thinlto<Oz>' -S %s 2>&1 \
22 ; RUN:     | FileCheck %s --check-prefixes=CHECK-O,CHECK-Oz,CHECK-O23SZ,%llvmcheckext
23 ; RUN: opt -disable-verify -verify-cfg-preserved=0 -eagerly-invalidate-analyses=0 -debug-pass-manager -new-pm-debug-info-for-profiling \
24 ; RUN:     -pgo-kind=pgo-sample-use-pipeline -profile-file='%S/Inputs/new-pm-thinlto-samplepgo-defaults.prof' \
25 ; RUN:     -passes='thinlto<O2>' -S  %s 2>&1 \
26 ; RUN:     | FileCheck %s --check-prefixes=CHECK-O,CHECK-O2,CHECK-O23SZ,%llvmcheckext
28 ; Suppress FileCheck --allow-unused-prefixes=false diagnostics.
29 ; CHECK-NOEXT: {{^}}
31 ; CHECK-O: Running pass: Annotation2Metadata
32 ; CHECK-O-NEXT: Running pass: ForceFunctionAttrsPass
33 ; CHECK-EP-PIPELINE-START-NEXT: Running pass: NoOpModulePass
34 ; CHECK-O-NEXT: Running pass: InferFunctionAttrsPass
35 ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
36 ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis
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-O-NEXT: Running pass: CoroEarlyPass
46 ; CHECK-O3-NEXT: Running pass: CallSiteSplittingPass
47 ; CHECK-O-NEXT: Running pass: InstCombinePass on foo
48 ; CHECK-O-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis on foo
49 ; CHECK-O-NEXT: Running analysis: AAManager on foo
50 ; CHECK-O-NEXT: Running analysis: BasicAA
51 ; CHECK-O-NEXT: Running analysis: ScopedNoAliasAA
52 ; CHECK-O-NEXT: Running analysis: TypeBasedAA
53 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
54 ; CHECK-O-NEXT: Running pass: SampleProfileLoaderPass
55 ; CHECK-O-NEXT: Running analysis: ProfileSummaryAnalysis
56 ; CHECK-O-NEXT: Running analysis: CallGraphAnalysis
57 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}ProfileSummaryAnalysis
58 ; CHECK-O-NEXT: Running pass: PGOIndirectCallPromotion
59 ; CHECK-O-NEXT: Running pass: OpenMPOptPass
60 ; CHECK-O-NEXT: Running pass: LowerTypeTestsPass
61 ; CHECK-O-NEXT: Running pass: IPSCCPPass
62 ; CHECK-O-NEXT: Running pass: CalledValuePropagationPass
63 ; CHECK-O-NEXT: Running pass: GlobalOptPass
64 ; CHECK-O-NEXT: Running pass: PromotePass
65 ; CHECK-O-NEXT: Running pass: DeadArgumentEliminationPass
66 ; CHECK-O-NEXT: Running pass: InstCombinePass
67 ; CHECK-O-NEXT: Running analysis: BlockFrequencyAnalysis on foo
68 ; These next two can appear in any order since they are accessed as parameters
69 ; on the same call to BlockFrequencyInfo::calculate.
70 ; CHECK-O-DAG: Running analysis: LoopAnalysis on foo
71 ; CHECK-O-DAG: Running analysis: BranchProbabilityAnalysis on foo
72 ; CHECK-O-NEXT: Running analysis: PostDominatorTreeAnalysis on foo
73 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass on foo
75 ; CHECK-O-NEXT: Running pass: ModuleInlinerWrapperPass
76 ; CHECK-O-NEXT: Running analysis: InlineAdvisorAnalysis
77 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}GlobalsAA
78 ; CHECK-O-NEXT: Running analysis: GlobalsAA
79 ; CHECK-O-NEXT: Running pass: InvalidateAnalysisPass<{{.*}}AAManager
80 ; CHECK-O-NEXT: Invalidating analysis: AAManager
81 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}ProfileSummaryAnalysis
82 ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
83 ; CHECK-O-NEXT: Running analysis: LazyCallGraphAnalysis
84 ; CHECK-O-NEXT: Running analysis: FunctionAnalysisManagerCGSCCProxy
85 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
86 ; CHECK-O-NEXT: Running pass: DevirtSCCRepeatedPass
87 ; CHECK-O-NEXT: Running pass: InlinerPass
88 ; CHECK-O-NEXT: Running pass: InlinerPass
89 ; CHECK-O-NEXT: Running pass: PostOrderFunctionAttrsPass
90 ; CHECK-O-NEXT: Running analysis: AAManager
91 ; CHECK-O3-NEXT: Running pass: ArgumentPromotionPass
92 ; CHECK-O2-NEXT: Running pass: OpenMPOptCGSCCPass
93 ; CHECK-O3-NEXT: Running pass: OpenMPOptCGSCCPass
94 ; CHECK-O-NEXT: Running pass: SROAPass
95 ; CHECK-O-NEXT: Running pass: EarlyCSEPass
96 ; CHECK-O-NEXT: Running analysis: MemorySSAAnalysis
97 ; CHECK-O23SZ-NEXT: Running pass: SpeculativeExecutionPass
98 ; CHECK-O23SZ-NEXT: Running pass: JumpThreadingPass
99 ; CHECK-O23SZ-NEXT: Running analysis: LazyValueAnalysis
100 ; CHECK-O23SZ-NEXT: Running pass: CorrelatedValuePropagationPass
101 ; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis
102 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
103 ; CHECK-O-NEXT: Running pass: InstCombinePass
104 ; CHECK-O3-NEXT: Running pass: AggressiveInstCombinePass
105 ; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass
106 ; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass
107 ; CHECK-O3-NEXT: Running pass: LibCallsShrinkWrapPass
108 ; CHECK-O23SZ-NEXT: Running pass: TailCallElimPass
109 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
110 ; CHECK-O-NEXT: Running pass: ReassociatePass
111 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}OptimizationRemarkEmitterAnalysis
112 ; CHECK-O-NEXT: Running pass: LoopSimplifyPass
113 ; CHECK-O-NEXT: Running pass: LCSSAPass
114 ; CHECK-O-NEXT: Running analysis: ScalarEvolutionAnalysis
115 ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
116 ; CHECK-O-NEXT: Running pass: LoopInstSimplifyPass
117 ; CHECK-O-NEXT: Running pass: LoopSimplifyCFGPass
118 ; CHECK-O-NEXT: Running pass: LICM
119 ; CHECK-O-NEXT: Running pass: LoopRotatePass
120 ; CHECK-O-NEXT: Running pass: LICM
121 ; CHECK-O-NEXT: Running pass: SimpleLoopUnswitchPass
122 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
123 ; CHECK-O-NEXT: Running pass: InstCombinePass
124 ; CHECK-O-NEXT: Running pass: LoopSimplifyPass
125 ; CHECK-O-NEXT: Running pass: LCSSAPass
126 ; CHECK-O-NEXT: Running pass: LoopIdiomRecognizePass
127 ; CHECK-O-NEXT: Running pass: IndVarSimplifyPass
128 ; CHECK-O-NEXT: Running pass: LoopDeletionPass
129 ; CHECK-O-NEXT: Running pass: LoopFullUnrollPass
130 ; CHECK-O-NEXT: Running pass: SROAPass on foo
131 ; CHECK-Os-NEXT: Running pass: MergedLoadStoreMotionPass
132 ; CHECK-Os-NEXT: Running pass: GVNPass
133 ; CHECK-Os-NEXT: Running analysis: MemoryDependenceAnalysis
134 ; CHECK-Os-NEXT: Running analysis: PhiValuesAnalysis
135 ; CHECK-Oz-NEXT: Running pass: MergedLoadStoreMotionPass
136 ; CHECK-Oz-NEXT: Running pass: GVNPass
137 ; CHECK-Oz-NEXT: Running analysis: MemoryDependenceAnalysis
138 ; CHECK-Oz-NEXT: Running analysis: PhiValuesAnalysis
139 ; CHECK-O2-NEXT: Running pass: MergedLoadStoreMotionPass
140 ; CHECK-O2-NEXT: Running pass: GVNPass
141 ; CHECK-O2-NEXT: Running analysis: MemoryDependenceAnalysis
142 ; CHECK-O2-NEXT: Running analysis: PhiValuesAnalysis
143 ; CHECK-O3-NEXT: Running pass: MergedLoadStoreMotionPass
144 ; CHECK-O3-NEXT: Running pass: GVNPass
145 ; CHECK-O3-NEXT: Running analysis: MemoryDependenceAnalysis
146 ; CHECK-O3-NEXT: Running analysis: PhiValuesAnalysis
147 ; CHECK-O1-NEXT: Running pass: MemCpyOptPass
148 ; CHECK-O-NEXT: Running pass: SCCPPass
149 ; CHECK-O-NEXT: Running pass: BDCEPass
150 ; CHECK-O-NEXT: Running analysis: DemandedBitsAnalysis
151 ; CHECK-O-NEXT: Running pass: InstCombinePass
152 ; CHECK-O23SZ-NEXT: Running pass: JumpThreadingPass
153 ; CHECK-O23SZ-NEXT: Running analysis: LazyValueAnalysis
154 ; CHECK-O23SZ-NEXT: Running pass: CorrelatedValuePropagationPass
155 ; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis
156 ; CHECK-O1-NEXT: Running pass: CoroElidePass
157 ; CHECK-O-NEXT: Running pass: ADCEPass
158 ; CHECK-O23SZ-NEXT: Running pass: MemCpyOptPass
159 ; CHECK-O23SZ-NEXT: Running pass: DSEPass
160 ; CHECK-O23SZ-NEXT: Running pass: LoopSimplifyPass
161 ; CHECK-O23SZ-NEXT: Running pass: LCSSAPass
162 ; CHECK-O23SZ-NEXT: Running pass: LICMPass
163 ; CHECK-O23SZ-NEXT: Running pass: CoroElidePass
164 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
165 ; CHECK-O-NEXT: Running pass: InstCombinePass
166 ; CHECK-O3-NEXT: Running pass: ControlHeightReductionPass on foo
167 ; CHECK-O3-NEXT: Running analysis: RegionInfoAnalysis on foo
168 ; CHECK-O3-NEXT: Running analysis: DominanceFrontierAnalysis on foo
169 ; CHECK-O-NEXT: Running pass: CoroSplitPass
170 ; CHECK-O-NEXT: Invalidating analysis: InlineAdvisorAnalysis
171 ; CHECK-O-NEXT: Running pass: GlobalOptPass
172 ; CHECK-O-NEXT: Running pass: GlobalDCEPass
173 ; CHECK-O-NEXT: Running pass: EliminateAvailableExternallyPass
174 ; CHECK-O-NEXT: Running pass: ReversePostOrderFunctionAttrsPass
175 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}GlobalsAA
176 ; CHECK-O-NEXT: Running pass: Float2IntPass
177 ; CHECK-O-NEXT: Running pass: LowerConstantIntrinsicsPass
178 ; CHECK-EXT: Running pass: {{.*}}::Bye
179 ; CHECK-O-NEXT: Running pass: LoopSimplifyPass
180 ; CHECK-O-NEXT: Running pass: LCSSAPass
181 ; CHECK-O-NEXT: Running pass: LoopRotatePass
182 ; CHECK-O-NEXT: Running pass: LoopDeletionPass
183 ; CHECK-O-NEXT: Running pass: LoopDistributePass
184 ; CHECK-O-NEXT: Running pass: InjectTLIMappings
185 ; CHECK-O-NEXT: Running pass: LoopVectorizePass
186 ; CHECK-O-NEXT: Running pass: LoopLoadEliminationPass
187 ; CHECK-O-NEXT: Running analysis: LoopAccessAnalysis
188 ; CHECK-O-NEXT: Running pass: InstCombinePass
189 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
190 ; CHECK-O2-NEXT: Running pass: SLPVectorizerPass
191 ; CHECK-O3-NEXT: Running pass: SLPVectorizerPass
192 ; CHECK-Os-NEXT: Running pass: SLPVectorizerPass
193 ; CHECK-O-NEXT: Running pass: VectorCombinePass
194 ; CHECK-O-NEXT: Running pass: InstCombinePass
195 ; CHECK-O-NEXT: Running pass: LoopUnrollPass
196 ; CHECK-O-NEXT: Running pass: WarnMissedTransformationsPass
197 ; CHECK-O-NEXT: Running pass: InstCombinePass
198 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}OptimizationRemarkEmitterAnalysis
199 ; CHECK-O-NEXT: Running pass: LoopSimplifyPass
200 ; CHECK-O-NEXT: Running pass: LCSSAPass
201 ; CHECK-O-NEXT: Running pass: LICMPass
202 ; CHECK-O-NEXT: Running pass: AlignmentFromAssumptionsPass
203 ; CHECK-O-NEXT: Running pass: LoopSinkPass
204 ; CHECK-O-NEXT: Running pass: InstSimplifyPass
205 ; CHECK-O-NEXT: Running pass: DivRemPairsPass
206 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
207 ; CHECK-O-NEXT: Running pass: CoroCleanupPass
208 ; CHECK-O-NEXT: Running pass: CGProfilePass
209 ; CHECK-O-NEXT: Running pass: GlobalDCEPass
210 ; CHECK-O-NEXT: Running pass: ConstantMergePass
211 ; CHECK-O-NEXT: Running pass: RelLookupTableConverterPass
212 ; CHECK-O-NEXT: Running analysis: TargetIRAnalysis
213 ; CHECK-O-NEXT: Running pass: AnnotationRemarksPass on foo
214 ; CHECK-O-NEXT: Running pass: PrintModulePass
216 ; Make sure we get the IR back out without changes when we print the module.
217 ; CHECK-O-LABEL: define void @foo(i32 %n) local_unnamed_addr
218 ; CHECK-O-NEXT: entry:
219 ; CHECK-O-NEXT:   br label %loop
220 ; CHECK-O:      loop:
221 ; CHECK-O-NEXT:   %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
222 ; CHECK-O-NEXT:   %iv.next = add i32 %iv, 1
223 ; CHECK-O-NEXT:   tail call void @bar()
224 ; CHECK-O-NEXT:   %cmp = icmp eq i32 %iv, %n
225 ; CHECK-O-NEXT:   br i1 %cmp, label %exit, label %loop
226 ; CHECK-O:      exit:
227 ; CHECK-O-NEXT:   ret void
228 ; CHECK-O-NEXT: }
230 ; Ignore a bunch of intervening metadata containing profile data.
233 declare void @bar() local_unnamed_addr
235 define void @foo(i32 %n) local_unnamed_addr {
236 entry:
237   br label %loop
238 loop:
239   %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
240   %iv.next = add i32 %iv, 1
241   tail call void @bar()
242   %cmp = icmp eq i32 %iv, %n
243   br i1 %cmp, label %exit, label %loop
244 exit:
245   ret void