llvm.org GIT mirror llvm / e6a8ace
[SCCP] Mark CFG as preserved. SCCP does not change the CFG, so we can mark it as preserved. Reviewers: dberlin, efriedma, davide Reviewed By: davide Differential Revision: https://reviews.llvm.org/D47149 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335820 91177308-0d34-0410-b5e6-96231b3b80d8 Florian Hahn 1 year, 2 months ago
5 changed file(s) with 38 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
17761776
17771777 auto PA = PreservedAnalyses();
17781778 PA.preserve();
1779 PA.preserveSet();
17791780 return PA;
17801781 }
17811782
17981799 void getAnalysisUsage(AnalysisUsage &AU) const override {
17991800 AU.addRequired();
18001801 AU.addPreserved();
1802 AU.setPreservesCFG();
18011803 }
18021804
18031805 // runOnFunction - Run the Sparse Conditional Constant Propagation
131131 ; CHECK-NEXT: Memory Dependence Analysis
132132 ; CHECK-NEXT: MemCpy Optimization
133133 ; CHECK-NEXT: Sparse Conditional Constant Propagation
134 ; CHECK-NEXT: Dominator Tree Construction
135134 ; CHECK-NEXT: Demanded bits analysis
136135 ; CHECK-NEXT: Bit-Tracking Dead Code Elimination
137 ; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
138136 ; CHECK-NEXT: Function Alias Analysis Results
139137 ; CHECK-NEXT: Natural Loop Information
140138 ; CHECK-NEXT: Lazy Branch Probability Analysis
135135 ; CHECK-NEXT: Memory Dependence Analysis
136136 ; CHECK-NEXT: MemCpy Optimization
137137 ; CHECK-NEXT: Sparse Conditional Constant Propagation
138 ; CHECK-NEXT: Dominator Tree Construction
139138 ; CHECK-NEXT: Demanded bits analysis
140139 ; CHECK-NEXT: Bit-Tracking Dead Code Elimination
141 ; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
142140 ; CHECK-NEXT: Function Alias Analysis Results
143141 ; CHECK-NEXT: Natural Loop Information
144142 ; CHECK-NEXT: Lazy Branch Probability Analysis
117117 ; CHECK-NEXT: Memory Dependence Analysis
118118 ; CHECK-NEXT: MemCpy Optimization
119119 ; CHECK-NEXT: Sparse Conditional Constant Propagation
120 ; CHECK-NEXT: Dominator Tree Construction
121120 ; CHECK-NEXT: Demanded bits analysis
122121 ; CHECK-NEXT: Bit-Tracking Dead Code Elimination
123 ; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
124122 ; CHECK-NEXT: Function Alias Analysis Results
125123 ; CHECK-NEXT: Natural Loop Information
126124 ; CHECK-NEXT: Lazy Branch Probability Analysis
0 ; RUN: opt < %s -debug-pass=Structure -globals-aa -loop-vectorize -sccp -loop-vectorize -globals-aa 2>&1 -S | FileCheck %s
1 ; RUN: opt < %s -debug-pass-manager -passes='loop-vectorize,sccp,loop-vectorize' 2>&1 -S | FileCheck --check-prefix=NEW-PM %s
2
3 ; Check CFG-only analysis are preserved by SCCP by running it between 2
4 ; loop-vectorize runs.
5
6 ; CHECK: Globals Alias Analysis
7 ; CHECK: Dominator Tree Construction
8 ; CHECK: Natural Loop Information
9 ; CHECK: Basic Alias Analysis (stateless AA impl)
10 ; CHECK: Sparse Conditional Constant Propagation
11 ; CHECK-NOT: Dominator Tree Construction
12 ; CHECK-NOT: Natural Loop Information
13 ; CHECK-NOT: Basic Alias Analysis (stateless AA impl)
14 ; CHECK-NOT: Globals Alias Analysis
15 ; CHECK: Loop Vectorization
16
17 ; NEW-PM-DAG: Running analysis: LoopAnalysis on test
18 ; NEW-PM-DAG: Running analysis: DominatorTreeAnalysis on test
19 ; NEW-PM-DAG: Running analysis: AssumptionAnalysis on test
20 ; NEW-PM-DAG: Running analysis: TargetLibraryAnalysis on test
21 ; NEW-PM-DAG: Running analysis: TargetIRAnalysis on test
22 ; NEW-PM: Running pass: SCCPPass on test
23 ; NEW-PM-NOT: Running analysis: LoopAnalysis on test
24 ; NEW-PM-NOT: Running analysis: DominatorTreeAnalysis on test
25 ; NEW-PM-NOT: Running analysis: AssumptionAnalysis on test
26 ; NEW-PM-NOT: Running analysis: TargetLibraryAnalysis on test
27 ; NEW-PM-NOT: Running analysis: TargetIRAnalysis on test
28 ; NEW-PM: Finished llvm::Function pass manager run.
29
30
31 define i32 @test() {
32 entry:
33 %res = add i32 1, 10
34 ret i32 %res
35 }