2017-01-20 07:39:28 +08:00
|
|
|
; The IR below was crafted so as:
|
|
|
|
; 1) To have a loop, so we create a loop pass manager
|
|
|
|
; 2) To be "immutable" in the sense that no pass in the standard
|
|
|
|
; pipeline will modify it.
|
|
|
|
; Since no transformations take place, we don't expect any analyses
|
|
|
|
; to be invalidated.
|
|
|
|
; Any invalidation that shows up here is a bug, unless we started modifying
|
|
|
|
; the IR, in which case we need to make it immutable harder.
|
|
|
|
|
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
|
|
|
; RUN: -passes='default<O1>' -S %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-O --check-prefix=CHECK-O1
|
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
|
|
|
; RUN: -passes='default<O2>' -S %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-O --check-prefix=CHECK-O2
|
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
|
|
|
; RUN: -passes='default<O3>' -S %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-O --check-prefix=CHECK-O3
|
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
|
|
|
; RUN: -passes='default<Os>' -S %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-O --check-prefix=CHECK-Os
|
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
|
|
|
; RUN: -passes='default<Oz>' -S %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-O --check-prefix=CHECK-Oz
|
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
|
|
|
; RUN: -passes='lto-pre-link<O2>' -S %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-O --check-prefix=CHECK-O2
|
|
|
|
|
2017-01-20 17:30:03 +08:00
|
|
|
; CHECK-O: Starting llvm::Module pass manager run.
|
|
|
|
; CHECK-O-NEXT: Running pass: PassManager<{{.*}}Module{{.*}}>
|
|
|
|
; CHECK-O-NEXT: Starting llvm::Module pass manager run.
|
|
|
|
; CHECK-O-NEXT: Running pass: ForceFunctionAttrsPass
|
|
|
|
; CHECK-O-NEXT: Running pass: InferFunctionAttrsPass
|
|
|
|
; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis
|
|
|
|
; CHECK-O-NEXT: Running pass: ModuleToFunctionPassAdaptor<{{.*}}PassManager{{.*}}>
|
|
|
|
; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
|
|
|
|
; CHECK-O-NEXT: Starting llvm::Function pass manager run.
|
|
|
|
; CHECK-O-NEXT: Running pass: SimplifyCFGPass
|
|
|
|
; CHECK-O-NEXT: Running analysis: TargetIRAnalysis
|
|
|
|
; CHECK-O-NEXT: Running analysis: AssumptionAnalysis
|
|
|
|
; CHECK-O-NEXT: Running pass: SROA
|
|
|
|
; CHECK-O-NEXT: Running analysis: DominatorTreeAnalysis
|
|
|
|
; CHECK-O-NEXT: Running pass: EarlyCSEPass
|
|
|
|
; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis
|
|
|
|
; CHECK-O-NEXT: Running pass: LowerExpectIntrinsicPass
|
|
|
|
; CHECK-O-NEXT: Running pass: GVNHoistPass
|
|
|
|
; CHECK-O-NEXT: Running analysis: AAManager
|
|
|
|
; CHECK-O-NEXT: Running analysis: MemoryDependenceAnalysis
|
|
|
|
; CHECK-O-NEXT: Running analysis: MemorySSAAnalysis
|
|
|
|
; CHECK-O-NEXT: Finished llvm::Function pass manager run.
|
|
|
|
; CHECK-O-NEXT: Running pass: IPSCCPPass
|
|
|
|
; CHECK-O-NEXT: Running pass: GlobalOptPass
|
|
|
|
; CHECK-O-NEXT: Running pass: ModuleToFunctionPassAdaptor<{{.*}}PromotePass>
|
|
|
|
; CHECK-O-NEXT: Running pass: DeadArgumentEliminationPass
|
|
|
|
; CHECK-O-NEXT: Running pass: ModuleToFunctionPassAdaptor<{{.*}}PassManager{{.*}}>
|
|
|
|
; CHECK-O-NEXT: Starting llvm::Function pass manager run.
|
|
|
|
; CHECK-O-NEXT: Running pass: InstCombinePass
|
|
|
|
; CHECK-O-NEXT: Running pass: SimplifyCFGPass
|
|
|
|
; CHECK-O-NEXT: Finished llvm::Function pass manager run.
|
2017-02-13 23:26:22 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: PGOIndirectCallPromotion
|
2017-02-12 13:34:04 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}GlobalsAA
|
|
|
|
; CHECK-O-NEXT: Running analysis: GlobalsAA
|
|
|
|
; CHECK-O-NEXT: Running analysis: CallGraphAnalysis
|
2017-01-20 17:30:03 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: ModuleToPostOrderCGSCCPassAdaptor<{{.*}}LazyCallGraph{{.*}}>
|
|
|
|
; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
|
|
|
|
; CHECK-O-NEXT: Running analysis: LazyCallGraphAnalysis
|
|
|
|
; CHECK-O-NEXT: Starting CGSCC pass manager run.
|
|
|
|
; CHECK-O-NEXT: Running pass: InlinerPass
|
|
|
|
; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy<{{.*}}LazyCallGraph{{.*}}>
|
2017-01-22 18:34:01 +08:00
|
|
|
; CHECK-O-NEXT: Running analysis: FunctionAnalysisManagerCGSCCProxy
|
2017-01-20 17:30:03 +08:00
|
|
|
; CHECK-O-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis
|
|
|
|
; CHECK-O-NEXT: Running pass: PostOrderFunctionAttrsPass
|
2017-02-10 07:54:57 +08:00
|
|
|
; CHECK-O3-NEXT: Running pass: ArgumentPromotionPass
|
2017-01-20 17:30:03 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: CGSCCToFunctionPassAdaptor<{{.*}}PassManager{{.*}}>
|
|
|
|
; CHECK-O-NEXT: Starting llvm::Function pass manager run.
|
|
|
|
; CHECK-O-NEXT: Running pass: SROA
|
|
|
|
; CHECK-O-NEXT: Running pass: EarlyCSEPass
|
|
|
|
; CHECK-O-NEXT: Running pass: SpeculativeExecutionPass
|
|
|
|
; CHECK-O-NEXT: Running pass: JumpThreadingPass
|
|
|
|
; CHECK-O-NEXT: Running analysis: LazyValueAnalysis
|
|
|
|
; CHECK-O-NEXT: Running pass: CorrelatedValuePropagationPass
|
|
|
|
; CHECK-O-NEXT: Running pass: SimplifyCFGPass
|
|
|
|
; CHECK-O-NEXT: Running pass: InstCombinePass
|
|
|
|
; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass
|
|
|
|
; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass
|
|
|
|
; CHECK-O3-NEXT: Running pass: LibCallsShrinkWrapPass
|
|
|
|
; CHECK-O-NEXT: Running pass: TailCallElimPass
|
|
|
|
; CHECK-O-NEXT: Running pass: SimplifyCFGPass
|
|
|
|
; CHECK-O-NEXT: Running pass: ReassociatePass
|
2017-02-10 07:54:57 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}OptimizationRemarkEmitterAnalysis
|
2017-01-20 17:30:03 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: FunctionToLoopPassAdaptor<{{.*}}LoopStandardAnalysisResults{{.*}}>
|
|
|
|
; CHECK-O-NEXT: Running analysis: LoopAnalysis
|
|
|
|
; CHECK-O-NEXT: Running analysis: ScalarEvolutionAnalysis
|
2017-02-10 16:26:58 +08:00
|
|
|
; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
|
2017-01-20 17:30:03 +08:00
|
|
|
; CHECK-O-NEXT: Starting Loop pass manager run.
|
2017-01-27 07:21:17 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: LoopRotatePass
|
|
|
|
; CHECK-O-NEXT: Running pass: LICM
|
|
|
|
; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
|
2017-01-20 17:30:03 +08:00
|
|
|
; CHECK-O-NEXT: Finished Loop pass manager run.
|
|
|
|
; CHECK-O-NEXT: Running pass: SimplifyCFGPass
|
|
|
|
; CHECK-O-NEXT: Running pass: InstCombinePass
|
|
|
|
; CHECK-O-NEXT: Running pass: FunctionToLoopPassAdaptor<{{.*}}LoopStandardAnalysisResults{{.*}}>
|
|
|
|
; CHECK-O-NEXT: Starting Loop pass manager run.
|
2017-01-27 07:21:17 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: IndVarSimplifyPass
|
|
|
|
; CHECK-O-NEXT: Running pass: LoopIdiomRecognizePass
|
|
|
|
; CHECK-O-NEXT: Running pass: LoopDeletionPass
|
|
|
|
; CHECK-O-NEXT: Running pass: LoopUnrollPass
|
2017-01-20 17:30:03 +08:00
|
|
|
; CHECK-O-NEXT: Finished Loop pass manager run.
|
|
|
|
; CHECK-Os-NEXT: Running pass: MergedLoadStoreMotionPass
|
|
|
|
; CHECK-Os-NEXT: Running pass: GVN
|
|
|
|
; CHECK-Oz-NEXT: Running pass: MergedLoadStoreMotionPass
|
|
|
|
; CHECK-Oz-NEXT: Running pass: GVN
|
|
|
|
; CHECK-O2-NEXT: Running pass: MergedLoadStoreMotionPass
|
|
|
|
; CHECK-O2-NEXT: Running pass: GVN
|
|
|
|
; CHECK-O3-NEXT: Running pass: MergedLoadStoreMotionPass
|
|
|
|
; CHECK-O3-NEXT: Running pass: GVN
|
|
|
|
; CHECK-O-NEXT: Running pass: MemCpyOptPass
|
|
|
|
; CHECK-O-NEXT: Running pass: SCCPPass
|
|
|
|
; CHECK-O-NEXT: Running pass: BDCEPass
|
|
|
|
; CHECK-O-NEXT: Running analysis: DemandedBitsAnalysis
|
|
|
|
; CHECK-O-NEXT: Running pass: InstCombinePass
|
|
|
|
; CHECK-O-NEXT: Running pass: JumpThreadingPass
|
|
|
|
; CHECK-O-NEXT: Running pass: CorrelatedValuePropagationPass
|
|
|
|
; CHECK-O-NEXT: Running pass: DSEPass
|
2017-01-27 07:21:17 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: FunctionToLoopPassAdaptor<{{.*}}LICMPass{{.*}}>
|
2017-01-20 17:30:03 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: ADCEPass
|
|
|
|
; CHECK-O-NEXT: Running analysis: PostDominatorTreeAnalysis
|
|
|
|
; CHECK-O-NEXT: Running pass: SimplifyCFGPass
|
|
|
|
; CHECK-O-NEXT: Running pass: InstCombinePass
|
|
|
|
; CHECK-O-NEXT: Finished llvm::Function pass manager run.
|
|
|
|
; CHECK-O-NEXT: Finished CGSCC pass manager run.
|
|
|
|
; CHECK-O-NEXT: Running pass: EliminateAvailableExternallyPass
|
|
|
|
; CHECK-O-NEXT: Running pass: ReversePostOrderFunctionAttrsPass
|
2017-02-12 13:34:04 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}GlobalsAA
|
2017-01-20 17:30:03 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: ModuleToFunctionPassAdaptor<{{.*}}PassManager{{.*}}>
|
|
|
|
; CHECK-O-NEXT: Starting llvm::Function pass manager run.
|
|
|
|
; CHECK-O-NEXT: Running pass: Float2IntPass
|
2017-01-27 08:50:21 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: FunctionToLoopPassAdaptor<{{.*}}LoopRotatePass
|
2017-01-20 17:30:03 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: LoopDistributePass
|
|
|
|
; CHECK-O-NEXT: Running pass: LoopVectorizePass
|
|
|
|
; CHECK-O-NEXT: Running analysis: BlockFrequencyAnalysis
|
|
|
|
; CHECK-O-NEXT: Running analysis: BranchProbabilityAnalysis
|
2017-01-27 09:32:26 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: LoopLoadEliminationPass
|
|
|
|
; CHECK-O-NEXT: Running analysis: LoopAccessAnalysis
|
2017-01-20 17:30:03 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: InstCombinePass
|
|
|
|
; CHECK-O-NEXT: Running pass: SLPVectorizerPass
|
|
|
|
; CHECK-O-NEXT: Running pass: SimplifyCFGPass
|
|
|
|
; CHECK-O-NEXT: Running pass: InstCombinePass
|
2017-01-27 08:50:21 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: FunctionToLoopPassAdaptor<{{.*}}LoopUnrollPass
|
|
|
|
; CHECK-O-NEXT: Running pass: InstCombinePass
|
2017-02-10 07:54:57 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}OptimizationRemarkEmitterAnalysis
|
2017-01-27 08:50:21 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: FunctionToLoopPassAdaptor<{{.*}}LICMPass
|
2017-01-20 17:30:03 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: AlignmentFromAssumptionsPass
|
2017-01-27 08:50:21 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: LoopSinkPass
|
|
|
|
; CHECK-O-NEXT: Running pass: InstSimplifierPass
|
2017-01-20 17:30:03 +08:00
|
|
|
; CHECK-O-NEXT: Finished llvm::Function pass manager run.
|
|
|
|
; CHECK-O-NEXT: Running pass: GlobalDCEPass
|
|
|
|
; CHECK-O-NEXT: Running pass: ConstantMergePass
|
|
|
|
; CHECK-O-NEXT: Finished llvm::Module pass manager run.
|
|
|
|
; CHECK-O-NEXT: Running pass: PrintModulePass
|
|
|
|
;
|
|
|
|
; Make sure we get the IR back out without changes when we print the module.
|
|
|
|
; CHECK-O-LABEL: define void @foo(i32 %n) local_unnamed_addr {
|
|
|
|
; CHECK-O-NEXT: entry:
|
|
|
|
; CHECK-O-NEXT: br label %loop
|
|
|
|
; CHECK-O: loop:
|
|
|
|
; CHECK-O-NEXT: %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
|
|
|
|
; CHECK-O-NEXT: %iv.next = add i32 %iv, 1
|
|
|
|
; CHECK-O-NEXT: tail call void @bar()
|
|
|
|
; CHECK-O-NEXT: %cmp = icmp eq i32 %iv, %n
|
|
|
|
; CHECK-O-NEXT: br i1 %cmp, label %exit, label %loop
|
|
|
|
; CHECK-O: exit:
|
|
|
|
; CHECK-O-NEXT: ret void
|
|
|
|
; CHECK-O-NEXT: }
|
|
|
|
;
|
|
|
|
; CHECK-O-NEXT: Finished llvm::Module pass manager run.
|
2017-01-20 07:39:28 +08:00
|
|
|
|
|
|
|
declare void @bar() local_unnamed_addr
|
|
|
|
|
|
|
|
define void @foo(i32 %n) local_unnamed_addr {
|
|
|
|
entry:
|
|
|
|
br label %loop
|
|
|
|
loop:
|
|
|
|
%iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
|
|
|
|
%iv.next = add i32 %iv, 1
|
|
|
|
tail call void @bar()
|
|
|
|
%cmp = icmp eq i32 %iv, %n
|
|
|
|
br i1 %cmp, label %exit, label %loop
|
|
|
|
exit:
|
|
|
|
ret void
|
|
|
|
}
|