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

Unified Diff: src/compiler/graph-reducer.cc

Issue 1206533002: [turbofan] Run DeadCodeElimination together with the advanced reducers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test262 test failure 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/graph-reducer.h ('k') | src/compiler/js-intrinsic-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/graph-reducer.cc
diff --git a/src/compiler/graph-reducer.cc b/src/compiler/graph-reducer.cc
index 33d400b61e1a736505b3a67111ff7f1187e05ef5..80b40a7d9ac516f56aef21b6081d2f789ac329e2 100644
--- a/src/compiler/graph-reducer.cc
+++ b/src/compiler/graph-reducer.cc
@@ -22,11 +22,9 @@ enum class GraphReducer::State : uint8_t {
};
-GraphReducer::GraphReducer(Zone* zone, Graph* graph, Node* dead_value,
- Node* dead_control)
+GraphReducer::GraphReducer(Zone* zone, Graph* graph, Node* dead)
: graph_(graph),
- dead_value_(dead_value),
- dead_control_(dead_control),
+ dead_(dead),
state_(graph, 4),
reducers_(zone),
revisit_(zone),
@@ -205,17 +203,15 @@ void GraphReducer::ReplaceWithValue(Node* node, Node* value, Node* effect,
// Requires distinguishing between value, effect and control edges.
for (Edge edge : node->use_edges()) {
- Node* user = edge.from();
+ Node* const user = edge.from();
+ DCHECK(!user->IsDead());
if (NodeProperties::IsControlEdge(edge)) {
if (user->opcode() == IrOpcode::kIfSuccess) {
Replace(user, control);
} else if (user->opcode() == IrOpcode::kIfException) {
- for (Edge e : user->use_edges()) {
- if (NodeProperties::IsValueEdge(e)) e.UpdateTo(dead_value_);
- if (NodeProperties::IsEffectEdge(e)) e.UpdateTo(graph()->start());
- if (NodeProperties::IsControlEdge(e)) e.UpdateTo(dead_control_);
- }
- edge.UpdateTo(user);
+ DCHECK_NOT_NULL(dead_);
+ edge.UpdateTo(dead_);
+ Revisit(user);
} else {
UNREACHABLE();
}
« no previous file with comments | « src/compiler/graph-reducer.h ('k') | src/compiler/js-intrinsic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698