2017-06-01 19:39:39 +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.
|
|
|
|
;
|
|
|
|
; Prelink pipelines:
|
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
2017-06-30 07:08:38 +08:00
|
|
|
; RUN: -passes='thinlto-pre-link<O1>,name-anon-globals' -S %s 2>&1 \
|
2020-10-30 12:54:45 +08:00
|
|
|
; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O1,CHECK-PRELINK-O,CHECK-PRELINK-O-NODIS
|
2017-06-01 19:39:39 +08:00
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
2017-06-30 07:08:38 +08:00
|
|
|
; RUN: -passes='thinlto-pre-link<O2>,name-anon-globals' -S %s 2>&1 \
|
2020-10-30 12:54:45 +08:00
|
|
|
; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O2,CHECK-O23SZ,CHECK-PRELINK-O,CHECK-PRELINK-O-NODIS
|
2017-06-01 19:39:39 +08:00
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
2018-01-23 09:25:20 +08:00
|
|
|
; RUN: -passes='thinlto-pre-link<O3>,name-anon-globals' -S -passes-ep-pipeline-start='no-op-module' %s 2>&1 \
|
2020-10-30 12:54:45 +08:00
|
|
|
; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O3,CHECK-O23SZ,CHECK-PRELINK-O,CHECK-PRELINK-O-NODIS,CHECK-EP-PIPELINE-START
|
2017-06-01 19:39:39 +08:00
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
2017-06-30 07:08:38 +08:00
|
|
|
; RUN: -passes='thinlto-pre-link<Os>,name-anon-globals' -S %s 2>&1 \
|
2020-10-30 12:54:45 +08:00
|
|
|
; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-Os,CHECK-O23SZ,CHECK-PRELINK-O,CHECK-PRELINK-O-NODIS
|
2017-06-01 19:39:39 +08:00
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
2017-06-30 07:08:38 +08:00
|
|
|
; RUN: -passes='thinlto-pre-link<Oz>,name-anon-globals' -S %s 2>&1 \
|
2020-10-30 12:54:45 +08:00
|
|
|
; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-Oz,CHECK-O23SZ,CHECK-PRELINK-O,CHECK-PRELINK-O-NODIS
|
2017-07-29 12:10:24 +08:00
|
|
|
; RUN: opt -disable-verify -debug-pass-manager -new-pm-debug-info-for-profiling \
|
|
|
|
; RUN: -passes='thinlto-pre-link<O2>,name-anon-globals' -S %s 2>&1 \
|
2020-10-30 12:54:45 +08:00
|
|
|
; RUN: | FileCheck %s --check-prefixes=CHECK-DIS,CHECK-O,CHECK-O2,CHECK-O23SZ,CHECK-PRELINK-O
|
2017-06-01 19:39:39 +08:00
|
|
|
;
|
|
|
|
; Postlink pipelines:
|
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
|
|
|
; RUN: -passes='thinlto<O1>' -S %s 2>&1 \
|
2020-10-30 12:54:45 +08:00
|
|
|
; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O1,CHECK-POSTLINK-O,%llvmcheckext
|
2017-06-01 19:39:39 +08:00
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
|
|
|
; RUN: -passes='thinlto<O2>' -S %s 2>&1 \
|
2019-06-08 23:37:47 +08:00
|
|
|
; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O2,CHECK-O23SZ,CHECK-POSTLINK-O,%llvmcheckext,CHECK-POSTLINK-O2
|
2018-01-23 09:25:20 +08:00
|
|
|
; RUN: opt -disable-verify -debug-pass-manager -passes-ep-pipeline-start='no-op-module' \
|
2017-06-01 19:39:39 +08:00
|
|
|
; RUN: -passes='thinlto<O3>' -S %s 2>&1 \
|
2019-06-08 23:37:47 +08:00
|
|
|
; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O3,CHECK-O23SZ,CHECK-POSTLINK-O,%llvmcheckext,CHECK-POSTLINK-O3
|
2017-06-01 19:39:39 +08:00
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
|
|
|
; RUN: -passes='thinlto<Os>' -S %s 2>&1 \
|
2019-06-08 23:37:47 +08:00
|
|
|
; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-Os,CHECK-O23SZ,CHECK-POSTLINK-O,%llvmcheckext,CHECK-POSTLINK-Os
|
2017-06-01 19:39:39 +08:00
|
|
|
; RUN: opt -disable-verify -debug-pass-manager \
|
|
|
|
; RUN: -passes='thinlto<Oz>' -S %s 2>&1 \
|
2020-10-30 12:54:45 +08:00
|
|
|
; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-Oz,CHECK-O23SZ,CHECK-POSTLINK-O,%llvmcheckext
|
2017-07-29 12:10:24 +08:00
|
|
|
; RUN: opt -disable-verify -debug-pass-manager -new-pm-debug-info-for-profiling \
|
|
|
|
; RUN: -passes='thinlto<O2>' -S %s 2>&1 \
|
2019-06-08 23:37:47 +08:00
|
|
|
; RUN: | FileCheck %s --check-prefixes=CHECK-O,CHECK-O2,CHECK-O23SZ,CHECK-POSTLINK-O,%llvmcheckext,CHECK-POSTLINK-O2
|
2020-10-30 12:54:45 +08:00
|
|
|
|
|
|
|
; Suppress FileCheck --allow-unused-prefixes=false diagnostics.
|
|
|
|
; CHECK-NOEXT: {{^}}
|
|
|
|
|
2020-07-29 08:08:24 +08:00
|
|
|
; CHECK-O: Starting llvm::Module pass manager run.
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: ForceFunctionAttrsPass
|
2018-01-23 09:25:20 +08:00
|
|
|
; CHECK-EP-PIPELINE-START-NEXT: Running pass: NoOpModulePass
|
2017-07-29 12:10:24 +08:00
|
|
|
; CHECK-DIS-NEXT: Running analysis: InnerAnalysisManagerProxy
|
2020-07-29 08:08:24 +08:00
|
|
|
; CHECK-DIS-NEXT: Running pass: AddDiscriminatorsPass
|
2017-08-10 13:10:32 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: PGOIndirectCallPromotion
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running analysis: ProfileSummaryAnalysis
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: InferFunctionAttrsPass
|
Change TargetLibraryInfo analysis passes to always require Function
Summary:
This is the first change to enable the TLI to be built per-function so
that -fno-builtin* handling can be migrated to use function attributes.
See discussion on D61634 for background. This is an enabler for fixing
handling of these options for LTO, for example.
This change should not affect behavior, as the provided function is not
yet used to build a specifically per-function TLI, but rather enables
that migration.
Most of the changes were very mechanical, e.g. passing a Function to the
legacy analysis pass's getTLI interface, or in Module level cases,
adding a callback. This is similar to the way the per-function TTI
analysis works.
There was one place where we were looking for builtins but not in the
context of a specific function. See FindCXAAtExit in
lib/Transforms/IPO/GlobalOpt.cpp. I'm somewhat concerned my workaround
could provide the wrong behavior in some corner cases. Suggestions
welcome.
Reviewers: chandlerc, hfinkel
Subscribers: arsenm, dschuff, jvesely, nhaehnle, mehdi_amini, javed.absar, sbc100, jgravelle-google, eraman, aheejin, steven_wu, george.burgess.iv, dexonsmith, jfb, asbirlea, gchatelet, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66428
llvm-svn: 371284
2019-09-07 11:09:36 +08:00
|
|
|
; CHECK-PRELINK-O-NODIS-NEXT: Running analysis: InnerAnalysisManagerProxy
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Running analysis: TargetLibraryAnalysis
|
|
|
|
; 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
|
Recommit r317351 : Add CallSiteSplitting pass
This recommit r317351 after fixing a buildbot failure.
Original commit message:
Summary:
This change add a pass which tries to split a call-site to pass
more constrained arguments if its argument is predicated in the control flow
so that we can expose better context to the later passes (e.g, inliner, jump
threading, or IPA-CP based function cloning, etc.).
As of now we support two cases :
1) If a call site is dominated by an OR condition and if any of its arguments
are predicated on this OR condition, try to split the condition with more
constrained arguments. For example, in the code below, we try to split the
call site since we can predicate the argument (ptr) based on the OR condition.
Split from :
if (!ptr || c)
callee(ptr);
to :
if (!ptr)
callee(null ptr) // set the known constant value
else if (c)
callee(nonnull ptr) // set non-null attribute in the argument
2) We can also split a call-site based on constant incoming values of a PHI
For example,
from :
BB0:
%c = icmp eq i32 %i1, %i2
br i1 %c, label %BB2, label %BB1
BB1:
br label %BB2
BB2:
%p = phi i32 [ 0, %BB0 ], [ 1, %BB1 ]
call void @bar(i32 %p)
to
BB0:
%c = icmp eq i32 %i1, %i2
br i1 %c, label %BB2-split0, label %BB1
BB1:
br label %BB2-split1
BB2-split0:
call void @bar(i32 0)
br label %BB2
BB2-split1:
call void @bar(i32 1)
br label %BB2
BB2:
%p = phi i32 [ 0, %BB2-split0 ], [ 1, %BB2-split1 ]
llvm-svn: 317362
2017-11-04 04:41:16 +08:00
|
|
|
; CHECK-O3-NEXT: Running pass: CallSiteSplittingPass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Finished llvm::Function pass manager run.
|
Restore "[WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP"
This restores commit 80d0a137a5aba6998fadb764f1e11cb901aae233, and the
follow on fix in 873c0d0786dcf22f4af39f65df824917f70f2170, with a new
fix for test failures after a 2-stage clang bootstrap, and a more robust
fix for the Chromium build failure that an earlier version partially
fixed. See also discussion on D75201.
Reviewers: evgeny777
Subscribers: mehdi_amini, Prazek, hiraditya, steven_wu, dexonsmith, arphaman, davidxl, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D73242
2020-03-18 02:08:35 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: LowerTypeTestsPass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: IPSCCPPass
|
2017-10-25 21:40:08 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: CalledValuePropagationPass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: GlobalOptPass
|
2020-07-29 08:08:24 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: PromotePass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: DeadArgumentEliminationPass
|
|
|
|
; CHECK-O-NEXT: Starting llvm::Function pass manager run.
|
|
|
|
; CHECK-O-NEXT: Running pass: InstCombinePass
|
2017-07-28 00:54:15 +08:00
|
|
|
; CHECK-PRELINK-O-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis
|
2017-12-14 18:36:31 +08:00
|
|
|
; CHECK-O-NEXT: Running analysis: AAManager
|
2019-04-16 00:49:00 +08:00
|
|
|
; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: SimplifyCFGPass
|
|
|
|
; CHECK-O-NEXT: Finished llvm::Function pass manager run.
|
2020-04-29 04:25:15 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: ModuleInlinerWrapperPass
|
|
|
|
; CHECK-O-NEXT: Running analysis: InlineAdvisorAnalysis
|
[PassBuilder] Moved ProfileSummaryAnalysis in buildInlinerPipeline.
Summary:
As commented in the code, ProfileSummaryAnalysis is required for inliner
pass to query, so this patch moved
RequireAnalysisPass<ProfileSummaryAnalysis> in the recently created
buildInlinerPipeline.
Reviewer: mtrofin, davidxl, tejohnson, dblaikie, jdoerfert, sstefan1
Reviewed By: mtrofin, davidxl, jdoerfert
Subscribers: hiraditya, steven_wu, dexonsmith, wuzish, llvm-commits,
jsji
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D79696
2020-05-12 23:56:14 +08:00
|
|
|
; CHECK-O-NEXT: Starting llvm::Module pass manager run.
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}GlobalsAA
|
|
|
|
; CHECK-O-NEXT: Running analysis: GlobalsAA
|
|
|
|
; CHECK-O-NEXT: Running analysis: CallGraphAnalysis
|
|
|
|
; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}ProfileSummaryAnalysis
|
2017-08-10 13:10:32 +08:00
|
|
|
; CHECK-PRELINK-O-NEXT: Running analysis: ProfileSummaryAnalysis
|
2020-09-02 06:55:05 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: AlwaysInlinerPass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
|
|
|
|
; CHECK-O-NEXT: Running analysis: LazyCallGraphAnalysis
|
2019-03-28 08:51:36 +08:00
|
|
|
; CHECK-O-NEXT: Running analysis: FunctionAnalysisManagerCGSCCProxy
|
2020-07-29 08:08:24 +08:00
|
|
|
; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
|
|
|
|
; CHECK-O-NEXT: Running pass: DevirtSCCRepeatedPass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Starting CGSCC pass manager run.
|
|
|
|
; CHECK-O-NEXT: Running pass: InlinerPass
|
2018-05-08 09:45:46 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: PostOrderFunctionAttrsPass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O3-NEXT: Running pass: ArgumentPromotionPass
|
2020-02-09 05:22:03 +08:00
|
|
|
; CHECK-O2-NEXT: Running pass: OpenMPOptPass on (foo)
|
|
|
|
; CHECK-O3-NEXT: Running pass: OpenMPOptPass on (foo)
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Starting llvm::Function pass manager run.
|
|
|
|
; CHECK-O-NEXT: Running pass: SROA
|
|
|
|
; CHECK-O-NEXT: Running pass: EarlyCSEPass
|
2017-06-28 06:25:02 +08:00
|
|
|
; CHECK-O-NEXT: Running analysis: MemorySSAAnalysis
|
2019-11-27 12:28:52 +08:00
|
|
|
; CHECK-O23SZ-NEXT: Running pass: SpeculativeExecutionPass
|
|
|
|
; CHECK-O23SZ-NEXT: Running pass: JumpThreadingPass
|
|
|
|
; CHECK-O23SZ-NEXT: Running analysis: LazyValueAnalysis
|
|
|
|
; CHECK-O23SZ-NEXT: Running pass: CorrelatedValuePropagationPass
|
2020-07-31 01:14:02 +08:00
|
|
|
; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: SimplifyCFGPass
|
2018-01-25 20:06:32 +08:00
|
|
|
; CHECK-O3-NEXT: Running pass: AggressiveInstCombinePass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: InstCombinePass
|
|
|
|
; CHECK-O1-NEXT: Running pass: LibCallsShrinkWrapPass
|
|
|
|
; CHECK-O2-NEXT: Running pass: LibCallsShrinkWrapPass
|
|
|
|
; CHECK-O3-NEXT: Running pass: LibCallsShrinkWrapPass
|
2019-11-27 12:28:52 +08:00
|
|
|
; CHECK-O23SZ-NEXT: Running pass: TailCallElimPass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: SimplifyCFGPass
|
|
|
|
; CHECK-O-NEXT: Running pass: ReassociatePass
|
|
|
|
; CHECK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}OptimizationRemarkEmitterAnalysis
|
2017-12-29 16:16:06 +08:00
|
|
|
; CHECK-O-NEXT: Starting llvm::Function pass manager run
|
|
|
|
; CHECK-O-NEXT: Running pass: LoopSimplifyPass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Running analysis: LoopAnalysis
|
2017-12-29 16:16:06 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: LCSSAPass
|
|
|
|
; CHECK-O-NEXT: Finished llvm::Function pass manager run
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Running analysis: ScalarEvolutionAnalysis
|
|
|
|
; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
|
|
|
|
; CHECK-O-NEXT: Starting Loop pass manager run.
|
2018-05-30 10:46:45 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: LoopInstSimplifyPass
|
|
|
|
; CHECK-O-NEXT: Running pass: LoopSimplifyCFGPass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: LoopRotatePass
|
|
|
|
; CHECK-O-NEXT: Running pass: LICM
|
|
|
|
; CHECK-O-NEXT: Running pass: SimpleLoopUnswitchPass
|
|
|
|
; CHECK-O-NEXT: Finished Loop pass manager run.
|
|
|
|
; CHECK-O-NEXT: Running pass: SimplifyCFGPass
|
|
|
|
; CHECK-O-NEXT: Running pass: InstCombinePass
|
2017-12-29 16:16:06 +08:00
|
|
|
; CHECK-O-NEXT: Starting llvm::Function pass manager run
|
|
|
|
; CHECK-O-NEXT: Running pass: LoopSimplifyPass
|
|
|
|
; CHECK-O-NEXT: Running pass: LCSSAPass
|
|
|
|
; CHECK-O-NEXT: Finished llvm::Function pass manager run
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Starting Loop pass manager run.
|
|
|
|
; CHECK-O-NEXT: Running pass: IndVarSimplifyPass
|
|
|
|
; CHECK-O-NEXT: Running pass: LoopIdiomRecognizePass
|
|
|
|
; CHECK-O-NEXT: Running pass: LoopDeletionPass
|
2017-08-03 04:35:29 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: LoopFullUnrollPass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Finished Loop pass manager run.
|
2019-11-02 05:59:08 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: SROA on foo
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-Os-NEXT: Running pass: MergedLoadStoreMotionPass
|
|
|
|
; CHECK-Os-NEXT: Running pass: GVN
|
2018-10-02 02:57:08 +08:00
|
|
|
; CHECK-Os-NEXT: Running analysis: MemoryDependenceAnalysis
|
|
|
|
; CHECK-Os-NEXT: Running analysis: PhiValuesAnalysis
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-Oz-NEXT: Running pass: MergedLoadStoreMotionPass
|
|
|
|
; CHECK-Oz-NEXT: Running pass: GVN
|
2018-10-02 02:57:08 +08:00
|
|
|
; CHECK-Oz-NEXT: Running analysis: MemoryDependenceAnalysis
|
|
|
|
; CHECK-Oz-NEXT: Running analysis: PhiValuesAnalysis
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O2-NEXT: Running pass: MergedLoadStoreMotionPass
|
|
|
|
; CHECK-O2-NEXT: Running pass: GVN
|
2018-10-02 02:57:08 +08:00
|
|
|
; CHECK-O2-NEXT: Running analysis: MemoryDependenceAnalysis
|
|
|
|
; CHECK-O2-NEXT: Running analysis: PhiValuesAnalysis
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O3-NEXT: Running pass: MergedLoadStoreMotionPass
|
|
|
|
; CHECK-O3-NEXT: Running pass: GVN
|
2018-10-02 02:57:08 +08:00
|
|
|
; CHECK-O3-NEXT: Running analysis: MemoryDependenceAnalysis
|
|
|
|
; CHECK-O3-NEXT: Running analysis: PhiValuesAnalysis
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: MemCpyOptPass
|
2018-10-02 02:57:08 +08:00
|
|
|
; CHECK-O1-NEXT: Running analysis: MemoryDependenceAnalysis
|
|
|
|
; CHECK-O1-NEXT: Running analysis: PhiValuesAnalysis
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: SCCPPass
|
|
|
|
; CHECK-O-NEXT: Running pass: BDCEPass
|
|
|
|
; CHECK-O-NEXT: Running analysis: DemandedBitsAnalysis
|
|
|
|
; CHECK-O-NEXT: Running pass: InstCombinePass
|
2019-11-27 12:28:52 +08:00
|
|
|
; CHECK-O23SZ-NEXT: Running pass: JumpThreadingPass
|
2020-07-31 01:14:02 +08:00
|
|
|
; CHECK-O23SZ-NEXT: Running analysis: LazyValueAnalysis
|
2019-11-27 12:28:52 +08:00
|
|
|
; CHECK-O23SZ-NEXT: Running pass: CorrelatedValuePropagationPass
|
2020-07-31 01:14:02 +08:00
|
|
|
; CHECK-O23SZ-NEXT: Invalidating analysis: LazyValueAnalysis
|
2020-10-21 17:21:50 +08:00
|
|
|
; CHECK-O-NEXT: Running pass: ADCEPass
|
|
|
|
; CHECK-O-NEXT: Running analysis: PostDominatorTreeAnalysis
|
2019-11-27 12:28:52 +08:00
|
|
|
; CHECK-O23SZ-NEXT: Running pass: DSEPass
|
|
|
|
; CHECK-O23SZ-NEXT: Starting llvm::Function pass manager run
|
|
|
|
; CHECK-O23SZ-NEXT: Running pass: LoopSimplifyPass
|
|
|
|
; CHECK-O23SZ-NEXT: Running pass: LCSSAPass
|
|
|
|
; CHECK-O23SZ-NEXT: Finished llvm::Function pass manager run
|
2020-07-29 08:08:24 +08:00
|
|
|
; CHECK-O23SZ-NEXT: Running pass: LICMPass on Loop at depth 1 containing: %loop
|
2017-06-01 19:39:39 +08:00
|
|
|
; 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: Finished llvm::Module pass manager run.
|
|
|
|
; CHECK-PRELINK-O-NEXT: Running pass: GlobalOptPass
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: GlobalOptPass
|
2017-10-06 02:36:01 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: GlobalDCEPass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: EliminateAvailableExternallyPass
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: ReversePostOrderFunctionAttrsPass
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}GlobalsAA
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Starting llvm::Function pass manager run.
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: Float2IntPass
|
2019-10-15 00:15:14 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: LowerConstantIntrinsicsPass
|
2019-06-08 23:37:47 +08:00
|
|
|
; CHECK-EXT: Running pass: {{.*}}::Bye
|
2017-12-29 16:16:06 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Starting llvm::Function pass manager run
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: LoopSimplifyPass
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: LCSSAPass
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Finished llvm::Function pass manager run
|
2020-07-29 08:08:24 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: LoopRotatePass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: LoopDistributePass
|
2020-04-07 02:16:48 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: InjectTLIMappings
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: LoopVectorizePass
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running analysis: BlockFrequencyAnalysis
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running analysis: BranchProbabilityAnalysis
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: LoopLoadEliminationPass
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running analysis: LoopAccessAnalysis
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: InstCombinePass
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: SimplifyCFGPass
|
2020-01-10 12:58:31 +08:00
|
|
|
; CHECK-POSTLINK-O2-NEXT: Running pass: SLPVectorizerPass
|
|
|
|
; CHECK-POSTLINK-O3-NEXT: Running pass: SLPVectorizerPass
|
|
|
|
; CHECK-POSTLINK-Os-NEXT: Running pass: SLPVectorizerPass
|
2020-05-23 00:13:18 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: VectorCombinePass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: InstCombinePass
|
2017-08-03 04:35:29 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: LoopUnrollPass
|
[Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes.
When multiple loop transformation are defined in a loop's metadata, their order of execution is defined by the order of their respective passes in the pass pipeline. For instance, e.g.
#pragma clang loop unroll_and_jam(enable)
#pragma clang loop distribute(enable)
is the same as
#pragma clang loop distribute(enable)
#pragma clang loop unroll_and_jam(enable)
and will try to loop-distribute before Unroll-And-Jam because the LoopDistribute pass is scheduled after UnrollAndJam pass. UnrollAndJamPass only supports one inner loop, i.e. it will necessarily fail after loop distribution. It is not possible to specify another execution order. Also,t the order of passes in the pipeline is subject to change between versions of LLVM, optimization options and which pass manager is used.
This patch adds 'followup' attributes to various loop transformation passes. These attributes define which attributes the resulting loop of a transformation should have. For instance,
!0 = !{!0, !1, !2}
!1 = !{!"llvm.loop.unroll_and_jam.enable"}
!2 = !{!"llvm.loop.unroll_and_jam.followup_inner", !3}
!3 = !{!"llvm.loop.distribute.enable"}
defines a loop ID (!0) to be unrolled-and-jammed (!1) and then the attribute !3 to be added to the jammed inner loop, which contains the instruction to distribute the inner loop.
Currently, in both pass managers, pass execution is in a fixed order and UnrollAndJamPass will not execute again after LoopDistribute. We hope to fix this in the future by allowing pass managers to run passes until a fixpoint is reached, use Polly to perform these transformations, or add a loop transformation pass which takes the order issue into account.
For mandatory/forced transformations (e.g. by having been declared by #pragma omp simd), the user must be notified when a transformation could not be performed. It is not possible that the responsible pass emits such a warning because the transformation might be 'hidden' in a followup attribute when it is executed, or it is not present in the pipeline at all. For this reason, this patche introduces a WarnMissedTransformations pass, to warn about orphaned transformations.
Since this changes the user-visible diagnostic message when a transformation is applied, two test cases in the clang repository need to be updated.
To ensure that no other transformation is executed before the intended one, the attribute `llvm.loop.disable_nonforced` can be added which should disable transformation heuristics before the intended transformation is applied. E.g. it would be surprising if a loop is distributed before a #pragma unroll_and_jam is applied.
With more supported code transformations (loop fusion, interchange, stripmining, offloading, etc.), transformations can be used as building blocks for more complex transformations (e.g. stripmining+stripmining+interchange -> tiling).
Reviewed By: hfinkel, dmgreen
Differential Revision: https://reviews.llvm.org/D49281
Differential Revision: https://reviews.llvm.org/D55288
llvm-svn: 348944
2018-12-13 01:32:52 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: WarnMissedTransformationsPass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: InstCombinePass
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: RequireAnalysisPass<{{.*}}OptimizationRemarkEmitterAnalysis
|
2017-12-29 16:16:06 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Starting llvm::Function pass manager run
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: LoopSimplifyPass
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: LCSSAPass
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Finished llvm::Function pass manager run
|
2020-07-29 08:08:24 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: LICMPass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: AlignmentFromAssumptionsPass
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: LoopSinkPass
|
2018-06-30 07:36:03 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: InstSimplifyPass
|
2017-09-09 21:38:18 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: DivRemPairsPass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: SimplifyCFGPass
|
Add a new pass to speculate around PHI nodes with constant (integer) operands when profitable.
The core idea is to (re-)introduce some redundancies where their cost is
hidden by the cost of materializing immediates for constant operands of
PHI nodes. When the cost of the redundancies is covered by this,
avoiding materializing the immediate has numerous benefits:
1) Less register pressure
2) Potential for further folding / combining
3) Potential for more efficient instructions due to immediate operand
As a motivating example, consider the remarkably different cost on x86
of a SHL instruction with an immediate operand versus a register
operand.
This pattern turns up surprisingly frequently, but is somewhat rarely
obvious as a significant performance problem.
The pass is entirely target independent, but it does rely on the target
cost model in TTI to decide when to speculate things around the PHI
node. I've included x86-focused tests, but any target that sets up its
immediate cost model should benefit from this pass.
There is probably more that can be done in this space, but the pass
as-is is enough to get some important performance on our internal
benchmarks, and should be generally performance neutral, but help with
more extensive benchmarking is always welcome.
One awkward part is that this pass has to be scheduled after
*everything* that can eliminate these kinds of redundancies. This
includes SimplifyCFG, GVN, etc. I'm open to suggestions about better
places to put this. We could in theory make it part of the codegen pass
pipeline, but there doesn't really seem to be a good reason for that --
it isn't "lowering" in any sense and only relies on pretty standard cost
model based TTI queries, so it seems to fit well with the "optimization"
pipeline model. Still, further thoughts on the pipeline position are
welcome.
I've also only implemented this in the new pass manager. If folks are
very interested, I can try to add it to the old PM as well, but I didn't
really see much point (my use case is already switched over to the new
PM).
I've tested this pretty heavily without issue. A wide range of
benchmarks internally show no change outside the noise, and I don't see
any significant changes in SPEC either. However, the size class
computation in tcmalloc is substantially improved by this, which turns
into a 2% to 4% win on the hottest path through tcmalloc for us, so
there are definitely important cases where this is going to make
a substantial difference.
Differential revision: https://reviews.llvm.org/D37467
llvm-svn: 319164
2017-11-28 19:32:31 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: SpeculateAroundPHIsPass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Finished llvm::Function pass manager run.
|
2018-07-16 08:28:24 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: CGProfilePass
|
2017-06-01 19:39:39 +08:00
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: GlobalDCEPass
|
|
|
|
; CHECK-POSTLINK-O-NEXT: Running pass: ConstantMergePass
|
2017-06-30 07:08:38 +08:00
|
|
|
; CHECK-PRELINK-O-NEXT: Running pass: NameAnonGlobalPass
|
2017-06-01 19:39:39 +08:00
|
|
|
; 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
|
|
|
|
}
|