Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/compiler/loop-peeling.cc

Issue 1193833002: [turbofan] Proper dead code elimination as regular reducer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Renamed DeadControl to Dead. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/common-operator.h" 5 #include "src/compiler/common-operator.h"
6 #include "src/compiler/graph.h" 6 #include "src/compiler/graph.h"
7 #include "src/compiler/loop-peeling.h" 7 #include "src/compiler/loop-peeling.h"
8 #include "src/compiler/node.h" 8 #include "src/compiler/node.h"
9 #include "src/compiler/node-marker.h" 9 #include "src/compiler/node-marker.h"
10 #include "src/compiler/node-properties.h" 10 #include "src/compiler/node-properties.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 if (exits.size() != 1) return nullptr; // not peelable currently. 205 if (exits.size() != 1) return nullptr; // not peelable currently.
206 206
207 //============================================================================ 207 //============================================================================
208 // Construct the peeled iteration. 208 // Construct the peeled iteration.
209 //============================================================================ 209 //============================================================================
210 PeeledIterationImpl* iter = new (tmp_zone) PeeledIterationImpl(tmp_zone); 210 PeeledIterationImpl* iter = new (tmp_zone) PeeledIterationImpl(tmp_zone);
211 size_t estimated_peeled_size = 211 size_t estimated_peeled_size =
212 5 + (loop->TotalSize() + exits.size() + rets.size()) * 2; 212 5 + (loop->TotalSize() + exits.size() + rets.size()) * 2;
213 Peeling peeling(graph, tmp_zone, estimated_peeled_size, &iter->node_pairs_); 213 Peeling peeling(graph, tmp_zone, estimated_peeled_size, &iter->node_pairs_);
214 214
215 Node* dead = graph->NewNode(common->DeadControl()); 215 Node* dead = graph->NewNode(common->Dead());
216 216
217 // Map the loop header nodes to their entry values. 217 // Map the loop header nodes to their entry values.
218 for (Node* node : loop_tree->HeaderNodes(loop)) { 218 for (Node* node : loop_tree->HeaderNodes(loop)) {
219 peeling.Insert(node, node->InputAt(kAssumedLoopEntryIndex)); 219 peeling.Insert(node, node->InputAt(kAssumedLoopEntryIndex));
220 } 220 }
221 221
222 // Copy all the nodes of loop body for the peeled iteration. 222 // Copy all the nodes of loop body for the peeled iteration.
223 peeling.CopyNodes(graph, tmp_zone, dead, loop_tree->BodyNodes(loop)); 223 peeling.CopyNodes(graph, tmp_zone, dead, loop_tree->BodyNodes(loop));
224 224
225 //============================================================================ 225 //============================================================================
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 } 324 }
325 } 325 }
326 } 326 }
327 327
328 return iter; 328 return iter;
329 } 329 }
330 330
331 } // namespace compiler 331 } // namespace compiler
332 } // namespace internal 332 } // namespace internal
333 } // namespace v8 333 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698