llvm.org GIT mirror llvm / 7ca84ad
[GVNHoist] Re-enable GVNHoist by default My initial motivation for this came from https://reviews.llvm.org/D48122, where it was pointed out that my change didn't fit well in SimplifyCFG and therefore using GVNHoist was a better way to go. GVNHoist has been disabled for a while as there was a list of bugs related to it. I have fixed the following bugs: https://bugs.llvm.org/show_bug.cgi?id=37808 -> https://reviews.llvm.org/D48372 (rL337149) https://bugs.llvm.org/show_bug.cgi?id=36787 -> https://reviews.llvm.org/D49555 (rL337674) https://bugs.llvm.org/show_bug.cgi?id=37445 -> https://reviews.llvm.org/D49425 (rL337680) The next two bugs no longer occur, and it's unclear which commit fixed them: https://bugs.llvm.org/show_bug.cgi?id=36635 https://bugs.llvm.org/show_bug.cgi?id=37791 I investigated this one and proved to be unrelated to GVNHoist, but a genuine bug in NewGvn: https://bugs.llvm.org/show_bug.cgi?id=37660 To convince myself GVNHoist is in a good state I made a successful bootstrap build of LLVM. Merging this change now in order to make it to the LLVM 7.0.0 branch. Differential Revision: https://reviews.llvm.org/D49858 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338240 91177308-0d34-0410-b5e6-96231b3b80d8 Alexandros Lamprineas 1 year, 1 month ago
7 changed file(s) with 25 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
173173 cl::desc("Enable the EarlyCSE w/ MemorySSA pass for the new PM (default = on)"));
174174
175175 static cl::opt EnableGVNHoist(
176 "enable-npm-gvn-hoist", cl::init(false), cl::Hidden,
177 cl::desc("Enable the GVN hoisting pass for the new PM (default = off)"));
176 "enable-npm-gvn-hoist", cl::init(true), cl::Hidden,
177 cl::desc("Enable the GVN hoisting pass for the new PM (default = on)"));
178178
179179 static cl::opt EnableGVNSink(
180180 "enable-npm-gvn-sink", cl::init(false), cl::Hidden,
134134 cl::desc("Enable the EarlyCSE w/ MemorySSA pass (default = on)"));
135135
136136 static cl::opt EnableGVNHoist(
137 "enable-gvn-hoist", cl::init(false), cl::Hidden,
138 cl::desc("Enable the GVN hoisting pass (default = off)"));
137 "enable-gvn-hoist", cl::init(true), cl::Hidden,
138 cl::desc("Enable the GVN hoisting pass (default = on)"));
139139
140140 static cl::opt
141141 DisableLibCallsShrinkWrap("disable-libcalls-shrinkwrap", cl::init(false),
120120 ; CHECK-O-NEXT: Running pass: SROA
121121 ; CHECK-O-NEXT: Running pass: EarlyCSEPass
122122 ; CHECK-O-NEXT: Running analysis: MemorySSAAnalysis
123 ; CHECK-O-NEXT: Running pass: GVNHoistPass on foo
124 ; CHECK-O-NEXT: Running analysis: PostDominatorTreeAnalysis on foo
125 ; CHECK-O-NEXT: Running analysis: MemoryDependenceAnalysis on foo
123126 ; CHECK-O-NEXT: Running pass: SpeculativeExecutionPass
124127 ; CHECK-O-NEXT: Running pass: JumpThreadingPass
125128 ; CHECK-O-NEXT: Running analysis: LazyValueAnalysis
168171 ; CHECK-O-NEXT: Finished Loop pass manager run.
169172 ; CHECK-Os-NEXT: Running pass: MergedLoadStoreMotionPass
170173 ; CHECK-Os-NEXT: Running pass: GVN
171 ; CHECK-Os-NEXT: Running analysis: MemoryDependenceAnalysis
172174 ; CHECK-Oz-NEXT: Running pass: MergedLoadStoreMotionPass
173175 ; CHECK-Oz-NEXT: Running pass: GVN
174 ; CHECK-Oz-NEXT: Running analysis: MemoryDependenceAnalysis
175176 ; CHECK-O2-NEXT: Running pass: MergedLoadStoreMotionPass
176177 ; CHECK-O2-NEXT: Running pass: GVN
177 ; CHECK-O2-NEXT: Running analysis: MemoryDependenceAnalysis
178178 ; CHECK-O3-NEXT: Running pass: MergedLoadStoreMotionPass
179179 ; CHECK-O3-NEXT: Running pass: GVN
180 ; CHECK-O3-NEXT: Running analysis: MemoryDependenceAnalysis
181180 ; CHECK-O-NEXT: Running pass: MemCpyOptPass
182 ; CHECK-O1-NEXT: Running analysis: MemoryDependenceAnalysis
183181 ; CHECK-O-NEXT: Running pass: SCCPPass
184182 ; CHECK-O-NEXT: Running pass: BDCEPass
185183 ; CHECK-O-NEXT: Running analysis: DemandedBitsAnalysis
195193 ; CHECK-O-NEXT: Finished llvm::Function pass manager run.
196194 ; CHECK-EP-SCALAR-LATE-NEXT: Running pass: NoOpFunctionPass
197195 ; CHECK-O-NEXT: Running pass: ADCEPass
198 ; CHECK-O-NEXT: Running analysis: PostDominatorTreeAnalysis
199196 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
200197 ; CHECK-O-NEXT: Running pass: InstCombinePass
201198 ; CHECK-EP-PEEPHOLE-NEXT: Running pass: NoOpFunctionPass
105105 ; CHECK-O-NEXT: Running pass: SROA
106106 ; CHECK-O-NEXT: Running pass: EarlyCSEPass
107107 ; CHECK-O-NEXT: Running analysis: MemorySSAAnalysis
108 ; CHECK-O-NEXT: Running pass: GVNHoistPass on foo
109 ; CHECK-O-NEXT: Running analysis: PostDominatorTreeAnalysis on foo
110 ; CHECK-O-NEXT: Running analysis: MemoryDependenceAnalysis on foo
108111 ; CHECK-O-NEXT: Running pass: SpeculativeExecutionPass
109112 ; CHECK-O-NEXT: Running pass: JumpThreadingPass
110113 ; CHECK-O-NEXT: Running analysis: LazyValueAnalysis
150153 ; CHECK-O-NEXT: Finished Loop pass manager run.
151154 ; CHECK-Os-NEXT: Running pass: MergedLoadStoreMotionPass
152155 ; CHECK-Os-NEXT: Running pass: GVN
153 ; CHECK-Os-NEXT: Running analysis: MemoryDependenceAnalysis
154156 ; CHECK-Oz-NEXT: Running pass: MergedLoadStoreMotionPass
155157 ; CHECK-Oz-NEXT: Running pass: GVN
156 ; CHECK-Oz-NEXT: Running analysis: MemoryDependenceAnalysis
157158 ; CHECK-O2-NEXT: Running pass: MergedLoadStoreMotionPass
158159 ; CHECK-O2-NEXT: Running pass: GVN
159 ; CHECK-O2-NEXT: Running analysis: MemoryDependenceAnalysis
160160 ; CHECK-O3-NEXT: Running pass: MergedLoadStoreMotionPass
161161 ; CHECK-O3-NEXT: Running pass: GVN
162 ; CHECK-O3-NEXT: Running analysis: MemoryDependenceAnalysis
163162 ; CHECK-O-NEXT: Running pass: MemCpyOptPass
164 ; CHECK-O1-NEXT: Running analysis: MemoryDependenceAnalysis
165163 ; CHECK-O-NEXT: Running pass: SCCPPass
166164 ; CHECK-O-NEXT: Running pass: BDCEPass
167165 ; CHECK-O-NEXT: Running analysis: DemandedBitsAnalysis
175173 ; CHECK-O-NEXT: Running pass: LCSSAPass
176174 ; CHECK-O-NEXT: Finished llvm::Function pass manager run
177175 ; CHECK-O-NEXT: Running pass: ADCEPass
178 ; CHECK-O-NEXT: Running analysis: PostDominatorTreeAnalysis
179176 ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
180177 ; CHECK-O-NEXT: Running pass: InstCombinePass
181178 ; CHECK-O-NEXT: Finished llvm::Function pass manager run.
5757 ; CHECK-NEXT: Function Alias Analysis Results
5858 ; CHECK-NEXT: Memory SSA
5959 ; CHECK-NEXT: Early CSE w/ MemorySSA
60 ; CHECK-NEXT: Post-Dominator Tree Construction
61 ; CHECK-NEXT: Function Alias Analysis Results
62 ; CHECK-NEXT: Memory Dependence Analysis
63 ; CHECK-NEXT: Early GVN Hoisting of Expressions
6064 ; CHECK-NEXT: Speculatively execute instructions if target has divergent branches
65 ; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
6166 ; CHECK-NEXT: Function Alias Analysis Results
6267 ; CHECK-NEXT: Lazy Value Information Analysis
6368 ; CHECK-NEXT: Jump Threading
6060 ; CHECK-NEXT: Function Alias Analysis Results
6161 ; CHECK-NEXT: Memory SSA
6262 ; CHECK-NEXT: Early CSE w/ MemorySSA
63 ; CHECK-NEXT: Post-Dominator Tree Construction
64 ; CHECK-NEXT: Function Alias Analysis Results
65 ; CHECK-NEXT: Memory Dependence Analysis
66 ; CHECK-NEXT: Early GVN Hoist
6367 ; CHECK-NEXT: Speculatively execute instructions if target has divergent branches
68 ; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
6469 ; CHECK-NEXT: Function Alias Analysis Results
6570 ; CHECK-NEXT: Lazy Value Information Analysis
6671 ; CHECK-NEXT: Jump Threading
5757 ; CHECK-NEXT: Function Alias Analysis Results
5858 ; CHECK-NEXT: Memory SSA
5959 ; CHECK-NEXT: Early CSE w/ MemorySSA
60 ; CHECK-NEXT: Post-Dominator Tree Construction
61 ; CHECK-NEXT: Function Alias Analysis Results
62 ; CHECK-NEXT: Memory Dependence Analysis
63 ; CHECK-NEXT: Early GVN Hoisting of Expressions
6064 ; CHECK-NEXT: Speculatively execute instructions if target has divergent branches
65 ; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
6166 ; CHECK-NEXT: Function Alias Analysis Results
6267 ; CHECK-NEXT: Lazy Value Information Analysis
6368 ; CHECK-NEXT: Jump Threading