2017-01-24 08:57:39 +08:00
|
|
|
; Basic test for the new LTO pipeline.
|
|
|
|
; For now the only difference is between -O1 and everything else, so
|
|
|
|
; -O2, -O3, -Os, -Oz are the same.
|
|
|
|
|
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
|
|
|
; RUN: -passes='lto<O1>' -S %s 2>&1 \
|
2017-07-28 00:54:15 +08:00
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-O --check-prefix=CHECK-O1
|
2017-01-24 08:57:39 +08:00
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
|
|
|
; RUN: -passes='lto<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='lto<O3>' -S %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-O --check-prefix=CHECK-O2
|
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
|
|
|
; RUN: -passes='lto<Os>' -S %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-O --check-prefix=CHECK-O2
|
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
|
|
|
; RUN: -passes='lto<Oz>' -S %s 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-O --check-prefix=CHECK-O2
|
[PM] Enable registration of out-of-tree passes with PassBuilder
Summary:
This patch adds a callback registration API to the PassBuilder,
enabling registering out-of-tree passes with it.
Through the Callback API, callers may register callbacks with the
various stages at which passes are added into pass managers, including
parsing of a pass pipeline as well as at extension points within the
default -O pipelines.
Registering utilities like `require<>` and `invalidate<>` needs to be
handled manually by the caller, but a helper is provided.
Additionally, adding passes at pipeline extension points is exposed
through the opt tool. This patch adds a `-passes-ep-X` commandline
option for every extension point X, which opt parses into pipelines
inserted into that extension point.
Reviewers: chandlerc
Reviewed By: chandlerc
Subscribers: lksbhm, grosser, davide, mehdi_amini, llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D33464
llvm-svn: 307532
2017-07-10 18:57:55 +08:00
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
|
|
|
; RUN: -passes='lto<O3>' -S %s -passes-ep-peephole='no-op-function' 2>&1 \
|
|
|
|
; RUN: | FileCheck %s --check-prefix=CHECK-O --check-prefix=CHECK-O2 \
|
|
|
|
; RUN: --check-prefix=CHECK-EP-Peephole
|
2017-01-24 08:57:39 +08:00
|
|
|
|
|
|
|
; CHECK-O: Starting llvm::Module pass manager run.
|
2017-01-24 13:30:41 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: PassManager<{{.*}}Module
|
2017-01-24 08:57:39 +08:00
|
|
|
; CHECK-O-NEXT: Starting llvm::Module pass manager run.
|
|
|
|
; CHECK-O-NEXT: Running pass: GlobalDCEPass
|
|
|
|
; CHECK-O-NEXT: Running pass: ForceFunctionAttrsPass
|
|
|
|
; CHECK-O-NEXT: Running pass: InferFunctionAttrsPass
|
|
|
|
; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis
|
|
|
|
; CHECK-O2-NEXT: PGOIndirectCallPromotion
|
2017-07-28 00:54:15 +08:00
|
|
|
; CHECK-O2-NEXT: Running analysis: InnerAnalysisManagerProxy<FunctionAnalysisManager
|
|
|
|
; CHECK-O2-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis
|
2017-01-24 08:57:39 +08:00
|
|
|
; CHECK-O2-NEXT: Running pass: IPSCCPPass
|
2017-01-24 09:45:53 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: ModuleToPostOrderCGSCCPassAdaptor<{{.*}}PostOrderFunctionAttrsPass>
|
2017-07-28 00:54:15 +08:00
|
|
|
; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy<CGSCCAnalysisManager
|
|
|
|
; CHECK-O1-NEXT: Running analysis: InnerAnalysisManagerProxy<FunctionAnalysisManager
|
2017-01-24 08:57:39 +08:00
|
|
|
; CHECK-O-NEXT: Running analysis: LazyCallGraphAnalysis
|
|
|
|
; CHECK-O-NEXT: Running analysis: FunctionAnalysisManagerCGSCCProxy
|
2017-01-24 09:45:53 +08:00
|
|
|
; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy<{{.*}}LazyCallGraph{{.*}}>
|
2017-01-24 08:57:39 +08:00
|
|
|
; CHECK-O-NEXT: Running analysis: AAManager
|
|
|
|
; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis
|
|
|
|
; CHECK-O-NEXT: Running pass: ReversePostOrderFunctionAttrsPass
|
|
|
|
; CHECK-O-NEXT: Running analysis: CallGraphAnalysis
|
|
|
|
; CHECK-O-NEXT: Running pass: GlobalSplitPass
|
|
|
|
; CHECK-O-NEXT: Running pass: WholeProgramDevirtPass
|
|
|
|
; CHECK-O2-NEXT: Running pass: GlobalOptPass
|
2017-01-24 09:45:53 +08:00
|
|
|
; CHECK-O2-NEXT: Running pass: ModuleToFunctionPassAdaptor<{{.*}}PromotePass>
|
2017-01-24 08:57:39 +08:00
|
|
|
; CHECK-O2-NEXT: Running analysis: DominatorTreeAnalysis
|
|
|
|
; CHECK-O2-NEXT: Running analysis: AssumptionAnalysis
|
|
|
|
; CHECK-O2-NEXT: Running pass: ConstantMergePass
|
|
|
|
; CHECK-O2-NEXT: Running pass: DeadArgumentEliminationPass
|
[PM] Enable registration of out-of-tree passes with PassBuilder
Summary:
This patch adds a callback registration API to the PassBuilder,
enabling registering out-of-tree passes with it.
Through the Callback API, callers may register callbacks with the
various stages at which passes are added into pass managers, including
parsing of a pass pipeline as well as at extension points within the
default -O pipelines.
Registering utilities like `require<>` and `invalidate<>` needs to be
handled manually by the caller, but a helper is provided.
Additionally, adding passes at pipeline extension points is exposed
through the opt tool. This patch adds a `-passes-ep-X` commandline
option for every extension point X, which opt parses into pipelines
inserted into that extension point.
Reviewers: chandlerc
Reviewed By: chandlerc
Subscribers: lksbhm, grosser, davide, mehdi_amini, llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D33464
llvm-svn: 307532
2017-07-10 18:57:55 +08:00
|
|
|
; CHECK-O2-NEXT: Running pass: ModuleToFunctionPassAdaptor<{{.*}}PassManager{{.*}}>
|
|
|
|
; CHECK-O2-NEXT: Starting llvm::Function pass manager run.
|
|
|
|
; CHECK-O2-NEXT: Running pass: InstCombinePass
|
|
|
|
; CHECK-EP-Peephole-NEXT: Running pass: NoOpFunctionPass
|
|
|
|
; CHECK-O2-NEXT: Finished llvm::Function pass manager run.
|
2017-01-24 09:45:53 +08:00
|
|
|
; CHECK-O2-NEXT: Running pass: ModuleToPostOrderCGSCCPassAdaptor<{{.*}}InlinerPass>
|
2017-01-24 08:57:39 +08:00
|
|
|
; CHECK-O2-NEXT: Running pass: GlobalOptPass
|
|
|
|
; CHECK-O2-NEXT: Running pass: GlobalDCEPass
|
2017-01-24 09:45:53 +08:00
|
|
|
; CHECK-O2-NEXT: Running pass: ModuleToFunctionPassAdaptor<{{.*}}PassManager{{.*}}>
|
2017-01-24 08:57:39 +08:00
|
|
|
; CHECK-O2-NEXT: Starting llvm::Function pass manager run.
|
|
|
|
; CHECK-O2-NEXT: Running pass: InstCombinePass
|
[PM] Enable registration of out-of-tree passes with PassBuilder
Summary:
This patch adds a callback registration API to the PassBuilder,
enabling registering out-of-tree passes with it.
Through the Callback API, callers may register callbacks with the
various stages at which passes are added into pass managers, including
parsing of a pass pipeline as well as at extension points within the
default -O pipelines.
Registering utilities like `require<>` and `invalidate<>` needs to be
handled manually by the caller, but a helper is provided.
Additionally, adding passes at pipeline extension points is exposed
through the opt tool. This patch adds a `-passes-ep-X` commandline
option for every extension point X, which opt parses into pipelines
inserted into that extension point.
Reviewers: chandlerc
Reviewed By: chandlerc
Subscribers: lksbhm, grosser, davide, mehdi_amini, llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D33464
llvm-svn: 307532
2017-07-10 18:57:55 +08:00
|
|
|
; CHECK-EP-Peephole-NEXT: Running pass: NoOpFunctionPass
|
2017-01-24 08:57:39 +08:00
|
|
|
; CHECK-O2-NEXT: Running pass: JumpThreadingPass
|
|
|
|
; CHECK-O2-NEXT: Running analysis: LazyValueAnalysis
|
|
|
|
; CHECK-O2-NEXT: Running pass: SROA on foo
|
|
|
|
; CHECK-O2-NEXT: Finished llvm::Function pass manager run.
|
2017-01-24 09:45:53 +08:00
|
|
|
; CHECK-O2-NEXT: Running pass: ModuleToPostOrderCGSCCPassAdaptor<{{.*}}PostOrderFunctionAttrsPass>
|
|
|
|
; CHECK-O2-NEXT: Running pass: ModuleToFunctionPassAdaptor<{{.*}}PassManager{{.*}}>
|
2017-01-24 08:57:39 +08:00
|
|
|
; CHECK-O2-NEXT: Running analysis: MemoryDependenceAnalysis
|
|
|
|
; CHECK-O2-NEXT: Running analysis: TargetIRAnalysis
|
|
|
|
; CHECK-O2-NEXT: Running analysis: DemandedBitsAnalysis
|
|
|
|
; CHECK-O2-NEXT: Running pass: CrossDSOCFIPass
|
2017-01-24 09:45:53 +08:00
|
|
|
; CHECK-O2-NEXT: Running pass: ModuleToFunctionPassAdaptor<{{.*}}SimplifyCFGPass>
|
2017-01-24 08:57:39 +08:00
|
|
|
; CHECK-O2-NEXT: Running pass: EliminateAvailableExternallyPass
|
|
|
|
; CHECK-O2-NEXT: Running pass: GlobalDCEPass
|
|
|
|
; 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.
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|