2020-08-18 02:48:04 +02:00
|
|
|
; RUN: opt -enable-new-pm=0 -mtriple=x86_64-- -O3 -debug-pass=Structure < %s -o /dev/null 2>&1 | FileCheck --check-prefixes=CHECK,%llvmcheckext %s
|
2018-03-21 23:17:31 +01:00
|
|
|
|
|
|
|
; REQUIRES: asserts
|
|
|
|
|
|
|
|
; CHECK-LABEL: Pass Arguments:
|
|
|
|
; CHECK-NEXT: Target Transform Information
|
|
|
|
; CHECK-NEXT: Type-Based Alias Analysis
|
|
|
|
; CHECK-NEXT: Scoped NoAlias Alias Analysis
|
|
|
|
; CHECK-NEXT: Assumption Cache Tracker
|
|
|
|
; CHECK-NEXT: Target Library Information
|
|
|
|
; CHECK-NEXT: FunctionPass Manager
|
|
|
|
; CHECK-NEXT: Module Verifier
|
2019-06-08 17:37:47 +02:00
|
|
|
; CHECK-EXT: Good Bye World Pass
|
|
|
|
; CHECK-NOEXT-NOT: Good Bye World Pass
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Instrument function entry/exit with calls to e.g. mcount() (pre inlining)
|
|
|
|
; CHECK-NEXT: Simplify the CFG
|
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
|
|
|
; CHECK-NEXT: SROA
|
|
|
|
; CHECK-NEXT: Early CSE
|
|
|
|
; CHECK-NEXT: Lower 'expect' Intrinsics
|
|
|
|
; CHECK-NEXT: Pass Arguments:
|
|
|
|
; CHECK-NEXT: Target Library Information
|
|
|
|
; CHECK-NEXT: Target Transform Information
|
2018-03-21 23:57:33 +01:00
|
|
|
; Target Pass Configuration
|
|
|
|
; CHECK: Type-Based Alias Analysis
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Scoped NoAlias Alias Analysis
|
|
|
|
; CHECK-NEXT: Assumption Cache Tracker
|
|
|
|
; CHECK-NEXT: Profile summary info
|
|
|
|
; CHECK-NEXT: ModulePass Manager
|
|
|
|
; CHECK-NEXT: Force set function attributes
|
|
|
|
; CHECK-NEXT: Infer set function attributes
|
|
|
|
; CHECK-NEXT: FunctionPass Manager
|
2018-11-14 11:04:30 +01:00
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Call-site splitting
|
|
|
|
; CHECK-NEXT: Interprocedural Sparse Conditional Constant Propagation
|
2019-11-01 12:43:51 +01:00
|
|
|
; CHECK-NEXT: FunctionPass Manager
|
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Called Value Propagation
|
|
|
|
; CHECK-NEXT: Global Variable Optimizer
|
2019-11-01 12:43:51 +01:00
|
|
|
; CHECK-NEXT: FunctionPass Manager
|
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
|
|
|
; CHECK-NEXT: Natural Loop Information
|
2020-04-28 11:31:20 +02:00
|
|
|
; CHECK-NEXT: Post-Dominator Tree Construction
|
2019-11-01 12:43:51 +01:00
|
|
|
; CHECK-NEXT: Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Block Frequency Analysis
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: FunctionPass Manager
|
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
|
|
|
; CHECK-NEXT: Promote Memory to Register
|
|
|
|
; CHECK-NEXT: Dead Argument Elimination
|
|
|
|
; CHECK-NEXT: FunctionPass Manager
|
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
|
|
|
; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
|
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
|
|
|
; CHECK-NEXT: Natural Loop Information
|
|
|
|
; CHECK-NEXT: Lazy Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Lazy Block Frequency Analysis
|
|
|
|
; CHECK-NEXT: Optimization Remark Emitter
|
|
|
|
; CHECK-NEXT: Combine redundant instructions
|
|
|
|
; CHECK-NEXT: Simplify the CFG
|
|
|
|
; CHECK-NEXT: CallGraph Construction
|
|
|
|
; CHECK-NEXT: Globals Alias Analysis
|
|
|
|
; CHECK-NEXT: Call Graph SCC Pass Manager
|
|
|
|
; CHECK-NEXT: Remove unused exception handling info
|
|
|
|
; CHECK-NEXT: Function Integration/Inlining
|
2019-11-07 06:20:06 +01:00
|
|
|
; CHECK-NEXT: OpenMP specific optimizations
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Deduce function attributes
|
|
|
|
; CHECK-NEXT: Promote 'by reference' arguments to scalars
|
|
|
|
; CHECK-NEXT: FunctionPass Manager
|
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
|
|
|
; CHECK-NEXT: SROA
|
|
|
|
; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
|
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
|
|
|
; CHECK-NEXT: Memory SSA
|
|
|
|
; CHECK-NEXT: Early CSE w/ MemorySSA
|
|
|
|
; CHECK-NEXT: Speculatively execute instructions if target has divergent branches
|
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
|
|
|
; CHECK-NEXT: Lazy Value Information Analysis
|
|
|
|
; CHECK-NEXT: Jump Threading
|
|
|
|
; CHECK-NEXT: Value Propagation
|
|
|
|
; CHECK-NEXT: Simplify the CFG
|
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
|
|
|
; CHECK-NEXT: Combine pattern based expressions
|
|
|
|
; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
|
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
|
|
|
; CHECK-NEXT: Natural Loop Information
|
|
|
|
; CHECK-NEXT: Lazy Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Lazy Block Frequency Analysis
|
|
|
|
; CHECK-NEXT: Optimization Remark Emitter
|
|
|
|
; CHECK-NEXT: Combine redundant instructions
|
|
|
|
; CHECK-NEXT: Conditionally eliminate dead library calls
|
|
|
|
; CHECK-NEXT: Natural Loop Information
|
2020-04-28 11:31:20 +02:00
|
|
|
; CHECK-NEXT: Post-Dominator Tree Construction
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Block Frequency Analysis
|
|
|
|
; CHECK-NEXT: Lazy Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Lazy Block Frequency Analysis
|
|
|
|
; CHECK-NEXT: Optimization Remark Emitter
|
|
|
|
; CHECK-NEXT: PGOMemOPSize
|
|
|
|
; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
|
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
|
|
|
; CHECK-NEXT: Natural Loop Information
|
|
|
|
; CHECK-NEXT: Lazy Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Lazy Block Frequency Analysis
|
|
|
|
; CHECK-NEXT: Optimization Remark Emitter
|
|
|
|
; CHECK-NEXT: Tail Call Elimination
|
|
|
|
; CHECK-NEXT: Simplify the CFG
|
|
|
|
; CHECK-NEXT: Reassociate expressions
|
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
|
|
|
; CHECK-NEXT: Natural Loop Information
|
|
|
|
; CHECK-NEXT: Canonicalize natural loops
|
|
|
|
; CHECK-NEXT: LCSSA Verifier
|
|
|
|
; CHECK-NEXT: Loop-Closed SSA Form Pass
|
2020-02-13 19:49:44 +01:00
|
|
|
; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
|
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Scalar Evolution Analysis
|
|
|
|
; CHECK-NEXT: Loop Pass Manager
|
|
|
|
; CHECK-NEXT: Rotate Loops
|
2020-02-13 19:49:44 +01:00
|
|
|
; CHECK-NEXT: Memory SSA
|
2020-09-16 01:09:30 +02:00
|
|
|
; CHECK-NEXT: Lazy Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Lazy Block Frequency Analysis
|
2020-02-13 19:49:44 +01:00
|
|
|
; CHECK-NEXT: Loop Pass Manager
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Loop Invariant Code Motion
|
|
|
|
; CHECK-NEXT: Unswitch loops
|
|
|
|
; CHECK-NEXT: Simplify the CFG
|
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
|
|
|
; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
|
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
|
|
|
; CHECK-NEXT: Natural Loop Information
|
|
|
|
; CHECK-NEXT: Lazy Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Lazy Block Frequency Analysis
|
|
|
|
; CHECK-NEXT: Optimization Remark Emitter
|
|
|
|
; CHECK-NEXT: Combine redundant instructions
|
|
|
|
; CHECK-NEXT: Canonicalize natural loops
|
|
|
|
; CHECK-NEXT: LCSSA Verifier
|
|
|
|
; CHECK-NEXT: Loop-Closed SSA Form Pass
|
|
|
|
; CHECK-NEXT: Scalar Evolution Analysis
|
|
|
|
; CHECK-NEXT: Loop Pass Manager
|
|
|
|
; CHECK-NEXT: Induction Variable Simplification
|
|
|
|
; CHECK-NEXT: Recognize loop idioms
|
|
|
|
; CHECK-NEXT: Delete dead loops
|
|
|
|
; CHECK-NEXT: Unroll loops
|
2020-10-04 10:27:07 +02:00
|
|
|
; CHECK-NEXT: SROA
|
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: MergedLoadStoreMotion
|
2018-07-31 16:19:29 +02:00
|
|
|
; CHECK-NEXT: Phi Values Analysis
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
|
|
|
; CHECK-NEXT: Memory Dependence Analysis
|
|
|
|
; CHECK-NEXT: Lazy Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Lazy Block Frequency Analysis
|
|
|
|
; CHECK-NEXT: Optimization Remark Emitter
|
|
|
|
; CHECK-NEXT: Global Value Numbering
|
2020-09-03 13:01:51 +02:00
|
|
|
; CHECK-NEXT: Phi Values Analysis
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
|
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
|
|
|
; CHECK-NEXT: Memory Dependence Analysis
|
|
|
|
; CHECK-NEXT: MemCpy Optimization
|
|
|
|
; CHECK-NEXT: Sparse Conditional Constant Propagation
|
|
|
|
; CHECK-NEXT: Demanded bits analysis
|
|
|
|
; CHECK-NEXT: Bit-Tracking Dead Code Elimination
|
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
|
|
|
; CHECK-NEXT: Lazy Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Lazy Block Frequency Analysis
|
|
|
|
; CHECK-NEXT: Optimization Remark Emitter
|
|
|
|
; CHECK-NEXT: Combine redundant instructions
|
|
|
|
; CHECK-NEXT: Lazy Value Information Analysis
|
|
|
|
; CHECK-NEXT: Jump Threading
|
|
|
|
; CHECK-NEXT: Value Propagation
|
|
|
|
; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
|
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
2020-10-16 09:42:18 +02:00
|
|
|
; CHECK-NEXT: Post-Dominator Tree Construction
|
2020-09-26 18:56:15 +02:00
|
|
|
; CHECK-NEXT: Memory SSA
|
2020-10-16 09:42:18 +02:00
|
|
|
; CHECK-NEXT: Dead Store Elimination
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Natural Loop Information
|
|
|
|
; CHECK-NEXT: Canonicalize natural loops
|
|
|
|
; CHECK-NEXT: LCSSA Verifier
|
|
|
|
; CHECK-NEXT: Loop-Closed SSA Form Pass
|
2020-10-16 09:42:18 +02:00
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Scalar Evolution Analysis
|
2020-09-16 01:09:30 +02:00
|
|
|
; CHECK-NEXT: Lazy Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Lazy Block Frequency Analysis
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Loop Pass Manager
|
|
|
|
; CHECK-NEXT: Loop Invariant Code Motion
|
|
|
|
; CHECK-NEXT: Post-Dominator Tree Construction
|
|
|
|
; CHECK-NEXT: Aggressive Dead Code Elimination
|
|
|
|
; CHECK-NEXT: Simplify the CFG
|
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
|
|
|
; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
|
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
|
|
|
; CHECK-NEXT: Natural Loop Information
|
|
|
|
; CHECK-NEXT: Lazy Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Lazy Block Frequency Analysis
|
|
|
|
; CHECK-NEXT: Optimization Remark Emitter
|
|
|
|
; CHECK-NEXT: Combine redundant instructions
|
|
|
|
; CHECK-NEXT: A No-Op Barrier Pass
|
|
|
|
; CHECK-NEXT: Eliminate Available Externally Globals
|
|
|
|
; CHECK-NEXT: CallGraph Construction
|
|
|
|
; CHECK-NEXT: Deduce function attributes in RPO
|
|
|
|
; CHECK-NEXT: Global Variable Optimizer
|
2019-11-01 12:43:51 +01:00
|
|
|
; CHECK-NEXT: FunctionPass Manager
|
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
|
|
|
; CHECK-NEXT: Natural Loop Information
|
2020-04-28 11:31:20 +02:00
|
|
|
; CHECK-NEXT: Post-Dominator Tree Construction
|
2019-11-01 12:43:51 +01:00
|
|
|
; CHECK-NEXT: Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Block Frequency Analysis
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Dead Global Elimination
|
|
|
|
; CHECK-NEXT: CallGraph Construction
|
|
|
|
; CHECK-NEXT: Globals Alias Analysis
|
|
|
|
; CHECK-NEXT: FunctionPass Manager
|
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
2019-09-19 18:31:17 +02:00
|
|
|
; CHECK-NEXT: Float to int
|
2019-10-14 18:15:14 +02:00
|
|
|
; CHECK-NEXT: Lower constant intrinsics
|
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Natural Loop Information
|
|
|
|
; CHECK-NEXT: Canonicalize natural loops
|
|
|
|
; CHECK-NEXT: LCSSA Verifier
|
|
|
|
; CHECK-NEXT: Loop-Closed SSA Form Pass
|
2020-02-13 19:49:44 +01:00
|
|
|
; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
|
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Scalar Evolution Analysis
|
|
|
|
; CHECK-NEXT: Loop Pass Manager
|
|
|
|
; CHECK-NEXT: Rotate Loops
|
|
|
|
; CHECK-NEXT: Loop Access Analysis
|
|
|
|
; CHECK-NEXT: Lazy Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Lazy Block Frequency Analysis
|
|
|
|
; CHECK-NEXT: Optimization Remark Emitter
|
|
|
|
; CHECK-NEXT: Loop Distribution
|
2020-04-28 11:31:20 +02:00
|
|
|
; CHECK-NEXT: Post-Dominator Tree Construction
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Block Frequency Analysis
|
|
|
|
; CHECK-NEXT: Scalar Evolution Analysis
|
|
|
|
; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
|
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
|
|
|
; CHECK-NEXT: Loop Access Analysis
|
|
|
|
; CHECK-NEXT: Demanded bits analysis
|
|
|
|
; CHECK-NEXT: Lazy Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Lazy Block Frequency Analysis
|
|
|
|
; CHECK-NEXT: Optimization Remark Emitter
|
2019-12-13 20:43:26 +01:00
|
|
|
; CHECK-NEXT: Inject TLI Mappings
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Loop Vectorization
|
|
|
|
; CHECK-NEXT: Canonicalize natural loops
|
|
|
|
; CHECK-NEXT: Scalar Evolution Analysis
|
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
|
|
|
; CHECK-NEXT: Loop Access Analysis
|
2019-04-15 18:49:00 +02:00
|
|
|
; CHECK-NEXT: Lazy Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Lazy Block Frequency Analysis
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Loop Load Elimination
|
|
|
|
; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
|
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
|
|
|
; CHECK-NEXT: Lazy Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Lazy Block Frequency Analysis
|
|
|
|
; CHECK-NEXT: Optimization Remark Emitter
|
|
|
|
; CHECK-NEXT: Combine redundant instructions
|
|
|
|
; CHECK-NEXT: Simplify the CFG
|
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
|
|
|
; CHECK-NEXT: Natural Loop Information
|
|
|
|
; CHECK-NEXT: Scalar Evolution Analysis
|
|
|
|
; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
|
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
|
|
|
; CHECK-NEXT: Demanded bits analysis
|
|
|
|
; CHECK-NEXT: Lazy Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Lazy Block Frequency Analysis
|
|
|
|
; CHECK-NEXT: Optimization Remark Emitter
|
2020-03-10 14:03:43 +01:00
|
|
|
; CHECK-NEXT: Inject TLI Mappings
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: SLP Vectorizer
|
2020-05-22 18:13:18 +02:00
|
|
|
; CHECK-NEXT: Optimize scalar/vector ops
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Optimization Remark Emitter
|
|
|
|
; CHECK-NEXT: Combine redundant instructions
|
|
|
|
; CHECK-NEXT: Canonicalize natural loops
|
|
|
|
; CHECK-NEXT: LCSSA Verifier
|
|
|
|
; CHECK-NEXT: Loop-Closed SSA Form Pass
|
|
|
|
; CHECK-NEXT: Scalar Evolution Analysis
|
|
|
|
; CHECK-NEXT: Loop Pass Manager
|
|
|
|
; CHECK-NEXT: Unroll loops
|
|
|
|
; CHECK-NEXT: Lazy Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Lazy Block Frequency Analysis
|
|
|
|
; CHECK-NEXT: Optimization Remark Emitter
|
|
|
|
; CHECK-NEXT: Combine redundant instructions
|
2019-09-04 21:16:04 +02:00
|
|
|
; CHECK-NEXT: Memory SSA
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Canonicalize natural loops
|
|
|
|
; CHECK-NEXT: LCSSA Verifier
|
|
|
|
; CHECK-NEXT: Loop-Closed SSA Form Pass
|
|
|
|
; CHECK-NEXT: Scalar Evolution Analysis
|
[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-12 18:32:52 +01:00
|
|
|
; CHECK-NEXT: Lazy Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Lazy Block Frequency Analysis
|
2020-09-16 01:09:30 +02:00
|
|
|
; CHECK-NEXT: Loop Pass Manager
|
|
|
|
; CHECK-NEXT: Loop Invariant Code Motion
|
[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-12 18:32:52 +01:00
|
|
|
; CHECK-NEXT: Optimization Remark Emitter
|
|
|
|
; CHECK-NEXT: Warn about non-applied transformations
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Alignment from assumptions
|
|
|
|
; CHECK-NEXT: Strip Unused Function Prototypes
|
|
|
|
; CHECK-NEXT: Dead Global Elimination
|
|
|
|
; CHECK-NEXT: Merge Duplicate Global Constants
|
[LPM] Port CGProfilePass from NPM to LPM
Reviewers: hans, chandlerc!, asbirlea, nikic
Reviewed By: hans, nikic
Subscribers: steven_wu, dexonsmith, nikic, echristo, void, zhizhouy, cfe-commits, aeubanks, MaskRay, jvesely, nhaehnle, hiraditya, kerbowa, llvm-commits
Tags: #llvm, #clang
Differential Revision: https://reviews.llvm.org/D83013
2020-07-08 21:30:28 +02:00
|
|
|
; CHECK-NEXT: Call Graph Profile
|
|
|
|
; CHECK-NEXT: FunctionPass Manager
|
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
|
|
|
; CHECK-NEXT: Natural Loop Information
|
|
|
|
; CHECK-NEXT: Lazy Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Lazy Block Frequency Analysis
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: FunctionPass Manager
|
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
|
|
|
; CHECK-NEXT: Natural Loop Information
|
2020-04-28 11:31:20 +02:00
|
|
|
; CHECK-NEXT: Post-Dominator Tree Construction
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Block Frequency Analysis
|
|
|
|
; CHECK-NEXT: Canonicalize natural loops
|
|
|
|
; CHECK-NEXT: LCSSA Verifier
|
|
|
|
; CHECK-NEXT: Loop-Closed SSA Form Pass
|
|
|
|
; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
|
|
|
|
; CHECK-NEXT: Function Alias Analysis Results
|
|
|
|
; CHECK-NEXT: Scalar Evolution Analysis
|
|
|
|
; CHECK-NEXT: Block Frequency Analysis
|
|
|
|
; CHECK-NEXT: Loop Pass Manager
|
|
|
|
; CHECK-NEXT: Loop Sink
|
|
|
|
; CHECK-NEXT: Lazy Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Lazy Block Frequency Analysis
|
|
|
|
; CHECK-NEXT: Optimization Remark Emitter
|
|
|
|
; CHECK-NEXT: Remove redundant instructions
|
|
|
|
; CHECK-NEXT: Hoist/decompose integer division and remainder
|
|
|
|
; CHECK-NEXT: Simplify the CFG
|
|
|
|
; CHECK-NEXT: Module Verifier
|
|
|
|
; CHECK-NEXT: Bitcode Writer
|
|
|
|
; CHECK-NEXT: Pass Arguments:
|
2018-08-23 13:04:00 +02:00
|
|
|
; CHECK-NEXT: FunctionPass Manager
|
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
|
|
|
; CHECK-NEXT: Pass Arguments:
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Target Library Information
|
|
|
|
; CHECK-NEXT: FunctionPass Manager
|
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
|
|
|
; CHECK-NEXT: Natural Loop Information
|
2020-04-28 11:31:20 +02:00
|
|
|
; CHECK-NEXT: Post-Dominator Tree Construction
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Block Frequency Analysis
|
|
|
|
; CHECK-NEXT: Pass Arguments:
|
|
|
|
; CHECK-NEXT: Target Library Information
|
|
|
|
; CHECK-NEXT: FunctionPass Manager
|
|
|
|
; CHECK-NEXT: Dominator Tree Construction
|
|
|
|
; CHECK-NEXT: Natural Loop Information
|
2020-04-28 11:31:20 +02:00
|
|
|
; CHECK-NEXT: Post-Dominator Tree Construction
|
2018-03-21 23:17:31 +01:00
|
|
|
; CHECK-NEXT: Branch Probability Analysis
|
|
|
|
; CHECK-NEXT: Block Frequency Analysis
|
|
|
|
|
|
|
|
define void @f() {
|
|
|
|
ret void
|
|
|
|
}
|