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 -debug-pass-manager \
12 ; RUN: -passes='thinlto-pre-link<O1>,name-anon-globals' -S %s 2>&1 \
13 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O1,CHECK-PRELINK-O,CHECK-PRELINK-O-NODIS,CHECK-PRELINK-O1
14 ; RUN: opt -disable-verify -debug-pass-manager \
15 ; RUN: -passes='thinlto-pre-link<O2>,name-anon-globals' -S %s 2>&1 \
16 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O2,CHECK-PRELINK-O,CHECK-PRELINK-O-NODIS,CHECK-PRELINK-O2
17 ; RUN: opt -disable-verify -debug-pass-manager \
18 ; RUN: -passes='thinlto-pre-link<O3>,name-anon-globals' -S -passes-ep-pipeline-start='no-op-module' %s 2>&1 \
19 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O3,CHECK-PRELINK-O,CHECK-PRELINK-O-NODIS,CHECK-PRELINK-O3,CHECK-EP-PIPELINE-START
20 ; RUN: opt -disable-verify -debug-pass-manager \
21 ; RUN: -passes='thinlto-pre-link<Os>,name-anon-globals' -S %s 2>&1 \
22 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-Os,CHECK-PRELINK-O,CHECK-PRELINK-O-NODIS,CHECK-PRELINK-Os
23 ; RUN: opt -disable-verify -debug-pass-manager \
24 ; RUN: -passes='thinlto-pre-link<Oz>,name-anon-globals' -S %s 2>&1 \
25 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-Oz,CHECK-PRELINK-O,CHECK-PRELINK-O-NODIS,CHECK-PRELINK-Oz
26 ; RUN: opt -disable-verify -debug-pass-manager -new-pm-debug-info-for-profiling \
27 ; RUN: -passes='thinlto-pre-link<O2>,name-anon-globals' -S %s 2>&1 \
28 ; RUN: | FileCheck %s --check-prefixes=CHECK-DIS,CHECK-O,CHECK-O2,CHECK-PRELINK-O,CHECK-PRELINK-O2
31 ; RUN: opt -disable-verify -debug-pass-manager \
32 ; RUN: -passes='thinlto<O1>' -S %s 2>&1 \
33 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O1,CHECK-POSTLINK-O,CHECK-POSTLINK-O1
34 ; RUN: opt -disable-verify -debug-pass-manager \
35 ; RUN: -passes='thinlto<O2>' -S %s 2>&1 \
36 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O2,CHECK-POSTLINK-O,CHECK-POSTLINK-O2
37 ; RUN: opt -disable-verify -debug-pass-manager -passes-ep-pipeline-start='no-op-module' \
38 ; RUN: -passes='thinlto<O3>' -S %s 2>&1 \
39 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O3,CHECK-POSTLINK-O,CHECK-POSTLINK-O3
40 ; RUN: opt -disable-verify -debug-pass-manager \
41 ; RUN: -passes='thinlto<Os>' -S %s 2>&1 \
42 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-Os,CHECK-POSTLINK-O,CHECK-POSTLINK-Os
43 ; RUN: opt -disable-verify -debug-pass-manager \
44 ; RUN: -passes='thinlto<Oz>' -S %s 2>&1 \
45 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-Oz,CHECK-POSTLINK-O,CHECK-POSTLINK-Oz
46 ; RUN: opt -disable-verify -debug-pass-manager -new-pm-debug-info-for-profiling \
47 ; RUN: -passes='thinlto<O2>' -S %s 2>&1 \
48 ; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O2,CHECK-POSTLINK-O,CHECK-POSTLINK-O2
50 ; CHECK-O: Running analysis: PassInstrumentationAnalysis
51 ; CHECK-O-NEXT: Starting llvm::Module pass manager run.
52 ; CHECK-O-NEXT: Running pass: PassManager<{{.*}}Module{{.*}}>
53 ; CHECK-O-NEXT: Starting llvm::Module pass manager run.
54 ; CHECK-O-NEXT: Running pass: ForceFunctionAttrsPass
55 ; CHECK-EP-PIPELINE-START-NEXT: Running pass: NoOpModulePass
56 ; CHECK-DIS-NEXT: Running pass: ModuleToFunctionPassAdaptor<{{.*}}AddDiscriminatorsPass{{.*}}>
57 ; CHECK-DIS-NEXT: Running analysis: InnerAnalysisManagerProxy
58 ; CHECK-O-NEXT: Running pass: PassManager<{{.*}}Module{{.*}}>
59 ; CHECK-O-NEXT: Starting llvm::Module pass manager run.
60 ; CHECK-POSTLINK-O-NEXT: Running pass: PGOIndirectCallPromotion
61 ; CHECK-POSTLINK-O-NEXT: Running analysis: ProfileSummaryAnalysis
62 ; CHECK-POSTLINK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
63 ; CHECK-POSTLINK-O-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis
64 ; CHECK-POSTLINK-O-NEXT: Running analysis: PassInstrumentationAnalysis
65 ; CHECK-O-NEXT: Running pass: InferFunctionAttrsPass
66 ; CHECK-PRELINK-O-NODIS-NEXT: Running analysis: InnerAnalysisManagerProxy
67 ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis
68 ; CHECK-O-NEXT: Running analysis: PassInstrumentationAnalysis
69 ; CHECK-O-NEXT: Running pass: ModuleToFunctionPassAdaptor<{{.*}}PassManager{{.*}}>
70 ; CHECK-PRELINK-O-NEXT: Running analysis: PassInstrumentationAnalysis
71 ; CHECK-O-NEXT: Starting llvm::Function pass manager run.
72 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
73 ; CHECK-O-NEXT: Running analysis: TargetIRAnalysis
74 ; CHECK-O-NEXT: Running analysis: AssumptionAnalysis
75 ; CHECK-O-NEXT: Running pass: SROA
76 ; CHECK-O-NEXT: Running analysis: DominatorTreeAnalysis
77 ; CHECK-O-NEXT: Running pass: EarlyCSEPass
78 ; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis
79 ; CHECK-O-NEXT: Running pass: LowerExpectIntrinsicPass
80 ; CHECK-O3-NEXT: Running pass: CallSiteSplittingPass
81 ; CHECK-O-NEXT: Finished llvm::Function pass manager run.
82 ; CHECK-O-NEXT: Running pass: IPSCCPPass
83 ; CHECK-O-NEXT: Running pass: CalledValuePropagationPass
84 ; CHECK-O-NEXT: Running pass: GlobalOptPass
85 ; CHECK-O-NEXT: Running pass: ModuleToFunctionPassAdaptor<{{.*}}PromotePass>
86 ; CHECK-O-NEXT: Running pass: DeadArgumentEliminationPass
87 ; CHECK-O-NEXT: Running pass: ModuleToFunctionPassAdaptor<{{.*}}PassManager{{.*}}>
88 ; CHECK-O-NEXT: Starting llvm::Function pass manager run.
89 ; CHECK-O-NEXT: Running pass: InstCombinePass
90 ; CHECK-PRELINK-O-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis
91 ; CHECK-O-NEXT: Running analysis: AAManager
92 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
93 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
94 ; CHECK-O-NEXT: Finished llvm::Function pass manager run.
95 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}GlobalsAA
96 ; CHECK-O-NEXT: Running analysis: GlobalsAA
97 ; CHECK-O-NEXT: Running analysis: CallGraphAnalysis
98 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}ProfileSummaryAnalysis
99 ; CHECK-PRELINK-O-NEXT: Running analysis: ProfileSummaryAnalysis
100 ; CHECK-O-NEXT: Running pass: ModuleToPostOrderCGSCCPassAdaptor<{{.*}}LazyCallGraph{{.*}}>
101 ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
102 ; CHECK-O-NEXT: Running analysis: LazyCallGraphAnalysis
103 ; CHECK-O-NEXT: Running analysis: FunctionAnalysisManagerCGSCCProxy
104 ; CHECK-O-NEXT: Running analysis: PassInstrumentationAnalysis
105 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy<{{.*}}LazyCallGraph::SCC{{.*}}>
106 ; CHECK-O-NEXT: Starting CGSCC pass manager run.
107 ; CHECK-O-NEXT: Running pass: InlinerPass
108 ; CHECK-O-NEXT: Running pass: PostOrderFunctionAttrsPass
109 ; CHECK-O3-NEXT: Running pass: ArgumentPromotionPass
110 ; CHECK-O-NEXT: Running pass: CGSCCToFunctionPassAdaptor<{{.*}}PassManager{{.*}}>
111 ; CHECK-O-NEXT: Starting llvm::Function pass manager run.
112 ; CHECK-O-NEXT: Running pass: SROA
113 ; CHECK-O-NEXT: Running pass: EarlyCSEPass
114 ; CHECK-O-NEXT: Running analysis: MemorySSAAnalysis
115 ; CHECK-O-NEXT: Running pass: SpeculativeExecutionPass
116 ; CHECK-O-NEXT: Running pass: JumpThreadingPass
117 ; CHECK-O-NEXT: Running analysis: LazyValueAnalysis
118 ; CHECK-O-NEXT: Running pass: CorrelatedValuePropagationPass
119 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
120 ; CHECK-O3-NEXT: Running pass: AggressiveInstCombinePass
121 ; CHECK-O-NEXT: Running pass: InstCombinePass
122 ; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass
123 ; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass
124 ; CHECK-O3-NEXT: Running pass: LibCallsShrinkWrapPass
125 ; CHECK-O-NEXT: Running pass: TailCallElimPass
126 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
127 ; CHECK-O-NEXT: Running pass: ReassociatePass
128 ; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}OptimizationRemarkEmitterAnalysis
129 ; CHECK-O-NEXT: Running pass: FunctionToLoopPassAdaptor<{{.*}}LoopStandardAnalysisResults{{.*}}>
130 ; CHECK-O-NEXT: Starting llvm::Function pass manager run
131 ; CHECK-O-NEXT: Running pass: LoopSimplifyPass
132 ; CHECK-O-NEXT: Running analysis: LoopAnalysis
133 ; CHECK-O-NEXT: Running pass: LCSSAPass
134 ; CHECK-O-NEXT: Finished llvm::Function pass manager run
135 ; CHECK-O-NEXT: Running analysis: ScalarEvolutionAnalysis
136 ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
137 ; CHECK-O-NEXT: Starting Loop pass manager run.
138 ; CHECK-O-NEXT: Running analysis: PassInstrumentationAnalysis
139 ; CHECK-O-NEXT: Running pass: LoopInstSimplifyPass
140 ; CHECK-O-NEXT: Running pass: LoopSimplifyCFGPass
141 ; CHECK-O-NEXT: Running pass: LoopRotatePass
142 ; CHECK-O-NEXT: Running pass: LICM
143 ; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
144 ; CHECK-O-NEXT: Running pass: SimpleLoopUnswitchPass
145 ; CHECK-O-NEXT: Finished Loop pass manager run.
146 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
147 ; CHECK-O-NEXT: Running pass: InstCombinePass
148 ; CHECK-O-NEXT: Running pass: FunctionToLoopPassAdaptor<{{.*}}LoopStandardAnalysisResults{{.*}}>
149 ; CHECK-O-NEXT: Starting llvm::Function pass manager run
150 ; CHECK-O-NEXT: Running pass: LoopSimplifyPass
151 ; CHECK-O-NEXT: Running pass: LCSSAPass
152 ; CHECK-O-NEXT: Finished llvm::Function pass manager run
153 ; CHECK-O-NEXT: Starting Loop pass manager run.
154 ; CHECK-O-NEXT: Running pass: IndVarSimplifyPass
155 ; CHECK-O-NEXT: Running pass: LoopIdiomRecognizePass
156 ; CHECK-O-NEXT: Running pass: LoopDeletionPass
157 ; CHECK-O-NEXT: Running pass: LoopFullUnrollPass
158 ; CHECK-O-NEXT: Finished Loop pass manager run.
159 ; CHECK-Os-NEXT: Running pass: MergedLoadStoreMotionPass
160 ; CHECK-Os-NEXT: Running pass: GVN
161 ; CHECK-Os-NEXT: Running analysis: MemoryDependenceAnalysis
162 ; CHECK-Os-NEXT: Running analysis: PhiValuesAnalysis
163 ; CHECK-Oz-NEXT: Running pass: MergedLoadStoreMotionPass
164 ; CHECK-Oz-NEXT: Running pass: GVN
165 ; CHECK-Oz-NEXT: Running analysis: MemoryDependenceAnalysis
166 ; CHECK-Oz-NEXT: Running analysis: PhiValuesAnalysis
167 ; CHECK-O2-NEXT: Running pass: MergedLoadStoreMotionPass
168 ; CHECK-O2-NEXT: Running pass: GVN
169 ; CHECK-O2-NEXT: Running analysis: MemoryDependenceAnalysis
170 ; CHECK-O2-NEXT: Running analysis: PhiValuesAnalysis
171 ; CHECK-O3-NEXT: Running pass: MergedLoadStoreMotionPass
172 ; CHECK-O3-NEXT: Running pass: GVN
173 ; CHECK-O3-NEXT: Running analysis: MemoryDependenceAnalysis
174 ; CHECK-O3-NEXT: Running analysis: PhiValuesAnalysis
175 ; CHECK-O-NEXT: Running pass: MemCpyOptPass
176 ; CHECK-O1-NEXT: Running analysis: MemoryDependenceAnalysis
177 ; CHECK-O1-NEXT: Running analysis: PhiValuesAnalysis
178 ; CHECK-O-NEXT: Running pass: SCCPPass
179 ; CHECK-O-NEXT: Running pass: BDCEPass
180 ; CHECK-O-NEXT: Running analysis: DemandedBitsAnalysis
181 ; CHECK-O-NEXT: Running pass: InstCombinePass
182 ; CHECK-O-NEXT: Running pass: JumpThreadingPass
183 ; CHECK-O-NEXT: Running pass: CorrelatedValuePropagationPass
184 ; CHECK-O-NEXT: Running pass: DSEPass
185 ; CHECK-O-NEXT: Running pass: FunctionToLoopPassAdaptor<{{.*}}LICMPass{{.*}}>
186 ; CHECK-O-NEXT: Starting llvm::Function pass manager run
187 ; CHECK-O-NEXT: Running pass: LoopSimplifyPass
188 ; CHECK-O-NEXT: Running pass: LCSSAPass
189 ; CHECK-O-NEXT: Finished llvm::Function pass manager run
190 ; CHECK-O-NEXT: Running pass: ADCEPass
191 ; CHECK-O-NEXT: Running analysis: PostDominatorTreeAnalysis
192 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
193 ; CHECK-O-NEXT: Running pass: InstCombinePass
194 ; CHECK-O-NEXT: Finished llvm::Function pass manager run.
195 ; CHECK-O-NEXT: Finished CGSCC pass manager run.
196 ; CHECK-O-NEXT: Finished llvm::Module pass manager run.
197 ; CHECK-PRELINK-O-NEXT: Running pass: GlobalOptPass
198 ; CHECK-POSTLINK-O-NEXT: Running pass: PassManager<{{.*}}Module{{.*}}>
199 ; CHECK-POSTLINK-O-NEXT: Starting llvm::Module pass manager run.
200 ; CHECK-POSTLINK-O-NEXT: Running pass: GlobalOptPass
201 ; CHECK-POSTLINK-O-NEXT: Running pass: GlobalDCEPass
202 ; CHECK-POSTLINK-O-NEXT: Running pass: EliminateAvailableExternallyPass
203 ; CHECK-POSTLINK-O-NEXT: Running pass: ReversePostOrderFunctionAttrsPass
204 ; CHECK-POSTLINK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}GlobalsAA
205 ; CHECK-POSTLINK-O-NEXT: Running pass: ModuleToFunctionPassAdaptor<{{.*}}PassManager{{.*}}>
206 ; CHECK-POSTLINK-O-NEXT: Starting llvm::Function pass manager run.
207 ; CHECK-POSTLINK-O-NEXT: Running pass: Float2IntPass
208 ; CHECK-POSTLINK-O-NEXT: Running pass: LowerConstantIntrinsicsPass
209 ; CHECK-POSTLINK-O-NEXT: Running pass: FunctionToLoopPassAdaptor<{{.*}}LoopRotatePass
210 ; CHECK-POSTLINK-O-NEXT: Starting llvm::Function pass manager run
211 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopSimplifyPass
212 ; CHECK-POSTLINK-O-NEXT: Running pass: LCSSAPass
213 ; CHECK-POSTLINK-O-NEXT: Finished llvm::Function pass manager run
214 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopDistributePass
215 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopVectorizePass
216 ; CHECK-POSTLINK-O-NEXT: Running analysis: BlockFrequencyAnalysis
217 ; CHECK-POSTLINK-O-NEXT: Running analysis: BranchProbabilityAnalysis
218 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopLoadEliminationPass
219 ; CHECK-POSTLINK-O-NEXT: Running analysis: LoopAccessAnalysis
220 ; CHECK-POSTLINK-O-NEXT: Running pass: InstCombinePass
221 ; CHECK-POSTLINK-O-NEXT: Running pass: SimplifyCFGPass
222 ; CHECK-POSTLINK-O-NEXT: Running pass: InstCombinePass
223 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopUnrollPass
224 ; CHECK-POSTLINK-O-NEXT: Running pass: WarnMissedTransformationsPass
225 ; CHECK-POSTLINK-O-NEXT: Running pass: InstCombinePass
226 ; CHECK-POSTLINK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}OptimizationRemarkEmitterAnalysis
227 ; CHECK-POSTLINK-O-NEXT: Running pass: FunctionToLoopPassAdaptor<{{.*}}LICMPass
228 ; CHECK-POSTLINK-O-NEXT: Starting llvm::Function pass manager run
229 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopSimplifyPass
230 ; CHECK-POSTLINK-O-NEXT: Running pass: LCSSAPass
231 ; CHECK-POSTLINK-O-NEXT: Finished llvm::Function pass manager run
232 ; CHECK-POSTLINK-O-NEXT: Running pass: AlignmentFromAssumptionsPass
233 ; CHECK-POSTLINK-O-NEXT: Running pass: LoopSinkPass
234 ; CHECK-POSTLINK-O-NEXT: Running pass: InstSimplifyPass
235 ; CHECK-POSTLINK-O-NEXT: Running pass: DivRemPairsPass
236 ; CHECK-POSTLINK-O-NEXT: Running pass: SimplifyCFGPass
237 ; CHECK-POSTLINK-O-NEXT: Running pass: SpeculateAroundPHIsPass
238 ; CHECK-POSTLINK-O-NEXT: Finished llvm::Function pass manager run.
239 ; CHECK-POSTLINK-O-NEXT: Running pass: CGProfilePass
240 ; CHECK-POSTLINK-O-NEXT: Running pass: GlobalDCEPass
241 ; CHECK-POSTLINK-O-NEXT: Running pass: ConstantMergePass
242 ; CHECK-POSTLINK-O-NEXT: Finished llvm::Module pass manager run.
243 ; CHECK-O-NEXT: Finished llvm::Module pass manager run.
244 ; CHECK-PRELINK-O-NEXT: Running pass: NameAnonGlobalPass
245 ; CHECK-O-NEXT: Running pass: PrintModulePass
247 ; Make sure we get the IR back out without changes when we print the module.
248 ; CHECK-O-LABEL: define void @foo(i32 %n) local_unnamed_addr {
249 ; CHECK-O-NEXT: entry:
250 ; CHECK-O-NEXT: br label %loop
252 ; CHECK-O-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
253 ; CHECK-O-NEXT: %iv.next = add i32 %iv, 1
254 ; CHECK-O-NEXT: tail call void @bar()
255 ; CHECK-O-NEXT: %cmp = icmp eq i32 %iv, %n
256 ; CHECK-O-NEXT: br i1 %cmp, label %exit, label %loop
258 ; CHECK-O-NEXT: ret void
261 ; CHECK-O-NEXT: Finished llvm::Module pass manager run.
263 declare void @bar() local_unnamed_addr
265 define void @foo(i32 %n) local_unnamed_addr {
269 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
270 %iv.next = add i32 %iv, 1
271 tail call void @bar()
272 %cmp = icmp eq i32 %iv, %n
273 br i1 %cmp, label %exit, label %loop