Index: test/Other/new-pass-manager.ll =================================================================== --- test/Other/new-pass-manager.ll +++ test/Other/new-pass-manager.ll @@ -384,89 +384,6 @@ ; CHECK-O0-NEXT: Finished llvm::Module pass manager run ; RUN: opt -disable-output -disable-verify -debug-pass-manager \ -; RUN: -passes='default' %s 2>&1 \ -; RUN: | FileCheck %s --check-prefix=CHECK-O --check-prefix=CHECK-O1 -; RUN: opt -disable-output -disable-verify -debug-pass-manager \ -; RUN: -passes='default' %s 2>&1 \ -; RUN: | FileCheck %s --check-prefix=CHECK-O --check-prefix=CHECK-O2 -; RUN: opt -disable-output -disable-verify -debug-pass-manager \ -; RUN: -passes='default' %s 2>&1 \ -; RUN: | FileCheck %s --check-prefix=CHECK-O --check-prefix=CHECK-Os -; RUN: opt -disable-output -disable-verify -debug-pass-manager \ -; RUN: -passes='default' %s 2>&1 \ -; RUN: | FileCheck %s --check-prefix=CHECK-O --check-prefix=CHECK-Oz -; RUN: opt -disable-output -disable-verify -debug-pass-manager \ -; RUN: -passes='lto-pre-link' %s 2>&1 \ -; RUN: | FileCheck %s --check-prefix=CHECK-O --check-prefix=CHECK-O2 -; CHECK-O: Starting llvm::Module pass manager run -; CHECK-O: Starting llvm::Module pass manager run -; CHECK-O: Running pass: ForceFunctionAttrsPass -; CHECK-O: Running pass: InferFunctionAttrsPass -; CHECK-O: Starting llvm::Function pass manager run. -; CHECK-O: Running pass: SimplifyCFGPass -; CHECK-O: Running pass: SROA -; CHECK-O: Running pass: EarlyCSEPass -; CHECK-O: Running pass: LowerExpectIntrinsicPass -; CHECK-O: Running pass: GVNHoistPass -; CHECK-O: Finished llvm::Function pass manager run. -; CHECK-O: Running pass: IPSCCPPass -; CHECK-O: Running pass: GlobalOptPass -; CHECK-O: Running pass: ModuleToFunctionPassAdaptor<{{.*}}PromotePass> -; CHECK-O: Running pass: DeadArgumentEliminationPass -; CHECK-O: Starting llvm::Function pass manager run. -; CHECK-O: Running pass: InstCombinePass -; CHECK-O: Running pass: SimplifyCFGPass -; CHECK-O: Finished llvm::Function pass manager run. -; CHECK-O: Starting CGSCC pass manager run. -; CHECK-O: Starting llvm::Function pass manager run. -; CHECK-O: Running pass: SROA -; CHECK-O: Running pass: EarlyCSEPass -; CHECK-O: Running pass: SpeculativeExecutionPass -; CHECK-O: Running pass: JumpThreadingPass -; CHECK-O: Running pass: CorrelatedValuePropagationPass -; CHECK-O: Running pass: SimplifyCFGPass -; CHECK-O: Running pass: InstCombinePass -; CHECK-O1: Running pass: LibCallsShrinkWrapPass -; CHECK-O2: Running pass: LibCallsShrinkWrapPass -; CHECK-Os-NOT: Running pass: LibCallsShrinkWrapPass -; CHECK-Oz-NOT: Running pass: LibCallsShrinkWrapPass -; CHECK-O: Running pass: TailCallElimPass -; CHECK-O: Running pass: SimplifyCFGPass -; CHECK-O: Running pass: ReassociatePass -; CHECK-O: Starting Loop pass manager run. -; CHECK-O: Finished Loop pass manager run. -; CHECK-O: Running pass: SimplifyCFGPass -; CHECK-O: Running pass: InstCombinePass -; CHECK-O: Starting Loop pass manager run. -; CHECK-O: Finished Loop pass manager run. -; CHECK-O: Running pass: MemCpyOptPass -; CHECK-O: Running pass: SCCPPass -; CHECK-O: Running pass: BDCEPass -; CHECK-O: Running pass: InstCombinePass -; CHECK-O: Running pass: JumpThreadingPass -; CHECK-O: Running pass: CorrelatedValuePropagationPass -; CHECK-O: Running pass: DSEPass -; CHECK-O: Running pass: ADCEPass -; CHECK-O: Running pass: SimplifyCFGPass -; CHECK-O: Running pass: InstCombinePass -; CHECK-O: Finished llvm::Function pass manager run. -; CHECK-O: Finished CGSCC pass manager run. -; CHECK-O: Running pass: EliminateAvailableExternallyPass -; CHECK-O: Running pass: ReversePostOrderFunctionAttrsPass -; CHECK-O: Starting llvm::Function pass manager run. -; CHECK-O: Running pass: Float2IntPass -; CHECK-O: Running pass: LoopDistributePass -; CHECK-O: Running pass: LoopVectorizePass -; CHECK-O: Running pass: InstCombinePass -; CHECK-O: Running pass: SLPVectorizerPass -; CHECK-O: Running pass: SimplifyCFGPass -; CHECK-O: Running pass: InstCombinePass -; CHECK-O: Running pass: AlignmentFromAssumptionsPass -; CHECK-O: Finished llvm::Function pass manager run. -; CHECK-O: Running pass: GlobalDCEPass -; CHECK-O: Running pass: ConstantMergePass - -; RUN: opt -disable-output -disable-verify -debug-pass-manager \ ; RUN: -passes='lto' %s 2>&1 \ ; RUN: | FileCheck %s --check-prefix=CHECK-LTO-O2 ; CHECK-LTO-O2: Starting llvm::Module pass manager run Index: test/Other/new-pm-defaults.ll =================================================================== --- test/Other/new-pm-defaults.ll +++ test/Other/new-pm-defaults.ll @@ -0,0 +1,174 @@ +; 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' -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' -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' -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' -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' -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' -S %s 2>&1 \ +; RUN: | FileCheck %s --check-prefix=CHECK-O --check-prefix=CHECK-O2 + +;CHECK-O: Starting llvm::Module pass manager run. +;CHECK-O-NEXT: Running pass: PassManager +;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 > +;CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy, llvm::Module> +;CHECK-O-NEXT: Starting llvm::Function pass manager run. +;CHECK-O-NEXT: Running pass: SimplifyCFGPass on foo +;CHECK-O-NEXT: Running analysis: TargetIRAnalysis +;CHECK-O-NEXT: Running analysis: AssumptionAnalysis +;CHECK-O-NEXT: Running pass: SROA on foo +;CHECK-O-NEXT: Running analysis: DominatorTreeAnalysis +;CHECK-O-NEXT: Running pass: EarlyCSEPass on foo +;CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis +;CHECK-O-NEXT: Running pass: LowerExpectIntrinsicPass on foo +;CHECK-O-NEXT: Running pass: GVNHoistPass on foo +;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 +;CHECK-O-NEXT: Running pass: DeadArgumentEliminationPass +;CHECK-O-NEXT: Running pass: ModuleToFunctionPassAdaptor > +;CHECK-O-NEXT: Starting llvm::Function pass manager run. +;CHECK-O-NEXT: Running pass: InstCombinePass on foo +;CHECK-O-NEXT: Running pass: SimplifyCFGPass on foo +;CHECK-O-NEXT: Finished llvm::Function pass manager run. +;CHECK-O-NEXT: Running pass: ModuleToPostOrderCGSCCPassAdaptor, llvm::LazyCallGraph&, llvm::CGSCCUpdateResult&> > +;CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy, llvm::Module> +;CHECK-O-NEXT: Running analysis: LazyCallGraphAnalysis +;CHECK-O-NEXT: Starting CGSCC pass manager run. +;CHECK-O-NEXT: Running pass: InlinerPass on (foo) +;CHECK-O-NEXT: Running analysis: FunctionAnalysisManagerCGSCCProxy +;CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy, llvm::LazyCallGraph::SCC> +;CHECK-O-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis +;CHECK-O-NEXT: Running pass: PostOrderFunctionAttrsPass on (foo) +;CHECK-O-NEXT: Running pass: CGSCCToFunctionPassAdaptor > on (foo) +;CHECK-O-NEXT: Starting llvm::Function pass manager run. +;CHECK-O-NEXT: Running pass: SROA on foo +;CHECK-O-NEXT: Running pass: EarlyCSEPass on foo +;CHECK-O-NEXT: Running pass: SpeculativeExecutionPass on foo +;CHECK-O-NEXT: Running pass: JumpThreadingPass on foo +;CHECK-O-NEXT: Running analysis: LazyValueAnalysis +;CHECK-O-NEXT: Invalidating analysis: LazyValueAnalysis +;CHECK-O-NEXT: Running pass: CorrelatedValuePropagationPass on foo +;CHECK-O-NEXT: Running analysis: LazyValueAnalysis +;CHECK-O-NEXT: Invalidating analysis: LazyValueAnalysis +;CHECK-O-NEXT: Running pass: SimplifyCFGPass on foo +;CHECK-O-NEXT: Running pass: InstCombinePass on foo +;CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass on foo +;CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass on foo +;CHECK-O3-NEXT: Running pass: LibCallsShrinkWrapPass on foo +;CHECK-O-NEXT: Running pass: TailCallElimPass on foo +;CHECK-O-NEXT: Running pass: SimplifyCFGPass on foo +;CHECK-O-NEXT: Running pass: ReassociatePass on foo +;CHECK-O-NEXT: Running pass: FunctionToLoopPassAdaptor, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&> > on foo +;CHECK-O-NEXT: Running analysis: LoopAnalysis +;CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy, llvm::Function> +;CHECK-O-NEXT: Running analysis: ScalarEvolutionAnalysis +;CHECK-O-NEXT: Starting Loop pass manager run. +;CHECK-O-NEXT: Finished Loop pass manager run. +;CHECK-O-NEXT: Running pass: SimplifyCFGPass on foo +;CHECK-O-NEXT: Running pass: InstCombinePass on foo +;CHECK-O-NEXT: Running pass: FunctionToLoopPassAdaptor, llvm::LoopStandardAnalysisResults&, llvm::LPMUpdater&> > on foo +;CHECK-O-NEXT: Starting Loop pass manager run. +;CHECK-O-NEXT: Finished Loop pass manager run. +;CHECK-Os-NEXT: Running pass: MergedLoadStoreMotionPass on foo +;CHECK-Os-NEXT: Running pass: GVN on foo +;CHECK-Oz-NEXT: Running pass: MergedLoadStoreMotionPass on foo +;CHECK-Oz-NEXT: Running pass: GVN on foo +;CHECK-O2-NEXT: Running pass: MergedLoadStoreMotionPass on foo +;CHECK-O2-NEXT: Running pass: GVN on foo +;CHECK-O3-NEXT: Running pass: MergedLoadStoreMotionPass on foo +;CHECK-O3-NEXT: Running pass: GVN on foo +;CHECK-O-NEXT: Running pass: MemCpyOptPass on foo +;CHECK-O-NEXT: Running pass: SCCPPass on foo +;CHECK-O-NEXT: Running pass: BDCEPass on foo +;CHECK-O-NEXT: Running analysis: DemandedBitsAnalysis +;CHECK-O-NEXT: Running pass: InstCombinePass on foo +;CHECK-O-NEXT: Running pass: JumpThreadingPass on foo +;CHECK-O-NEXT: Running analysis: LazyValueAnalysis +;CHECK-O-NEXT: Invalidating analysis: LazyValueAnalysis +;CHECK-O-NEXT: Running pass: CorrelatedValuePropagationPass on foo +;CHECK-O-NEXT: Running analysis: LazyValueAnalysis +;CHECK-O-NEXT: Invalidating analysis: LazyValueAnalysis +;CHECK-O-NEXT: Running pass: DSEPass on foo +;CHECK-O-NEXT: Running pass: ADCEPass on foo +;CHECK-O-NEXT: Running analysis: PostDominatorTreeAnalysis +;CHECK-O-NEXT: Running pass: SimplifyCFGPass on foo +;CHECK-O-NEXT: Running pass: InstCombinePass on foo +;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 +;CHECK-O-NEXT: Running analysis: CallGraphAnalysis +;CHECK-O-NEXT: Invalidating analysis: CallGraphAnalysis +;CHECK-O-NEXT: Running pass: ModuleToFunctionPassAdaptor > +;CHECK-O-NEXT: Starting llvm::Function pass manager run. +;CHECK-O-NEXT: Running pass: Float2IntPass on foo +;CHECK-O-NEXT: Running pass: LoopDistributePass on foo +;CHECK-O-NEXT: Running pass: LoopVectorizePass on foo +;CHECK-O-NEXT: Running analysis: BlockFrequencyAnalysis +;CHECK-O-NEXT: Running analysis: BranchProbabilityAnalysis +;CHECK-O-NEXT: Running pass: InstCombinePass on foo +;CHECK-O-NEXT: Running pass: SLPVectorizerPass on foo +;CHECK-O-NEXT: Running pass: SimplifyCFGPass on foo +;CHECK-O-NEXT: Running pass: InstCombinePass on foo +;CHECK-O-NEXT: Running pass: AlignmentFromAssumptionsPass on foo +;CHECK-O-NEXT: Invalidating analysis: ScalarEvolutionAnalysis +;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 +;CHECK-O: 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. + +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 +}