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

Unified Diff: src/compiler/pipeline.cc

Issue 1193833002: [turbofan] Proper dead code elimination as regular reducer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
Index: src/compiler/pipeline.cc
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc
index 70d4be6033e303e971640c1dce270e6ca99c7113..71cc0d8c2bbe2bf5621ed2ace76cb698d82778ed 100644
--- a/src/compiler/pipeline.cc
+++ b/src/compiler/pipeline.cc
@@ -16,7 +16,7 @@
#include "src/compiler/code-generator.h"
#include "src/compiler/common-operator-reducer.h"
#include "src/compiler/control-flow-optimizer.h"
-#include "src/compiler/control-reducer.h"
+#include "src/compiler/dead-code-elimination.h"
#include "src/compiler/frame-elider.h"
#include "src/compiler/graph-replay.h"
#include "src/compiler/graph-trimmer.h"
@@ -407,7 +407,7 @@ class SourcePositionWrapper final : public Reducer {
class JSGraphReducer final : public GraphReducer {
public:
JSGraphReducer(JSGraph* jsgraph, Zone* zone)
- : GraphReducer(zone, jsgraph->graph(), jsgraph->DeadValue(),
+ : GraphReducer(zone, jsgraph->graph(), jsgraph->TheHoleConstant(),
jsgraph->DeadControl()) {}
~JSGraphReducer() final {}
};
@@ -640,7 +640,13 @@ struct ChangeLoweringPhase {
struct EarlyControlReductionPhase {
static const char* phase_name() { return "early control reduction"; }
void Run(PipelineData* data, Zone* temp_zone) {
- ControlReducer::ReduceGraph(temp_zone, data->jsgraph(), 0);
+ GraphReducer graph_reducer(temp_zone, data->graph());
+ DeadCodeElimination dce(&graph_reducer, data->graph(), data->common());
+ CommonOperatorReducer common(&graph_reducer, data->graph(), data->common(),
+ data->machine());
+ graph_reducer.AddReducer(&dce);
+ graph_reducer.AddReducer(&common);
+ graph_reducer.ReduceGraph();
}
};
@@ -648,7 +654,13 @@ struct EarlyControlReductionPhase {
struct LateControlReductionPhase {
static const char* phase_name() { return "late control reduction"; }
void Run(PipelineData* data, Zone* temp_zone) {
- ControlReducer::ReduceGraph(temp_zone, data->jsgraph(), 0);
+ GraphReducer graph_reducer(temp_zone, data->graph());
+ DeadCodeElimination dce(&graph_reducer, data->graph(), data->common());
+ CommonOperatorReducer common(&graph_reducer, data->graph(), data->common(),
+ data->machine());
+ graph_reducer.AddReducer(&dce);
+ graph_reducer.AddReducer(&common);
+ graph_reducer.ReduceGraph();
}
};

Powered by Google App Engine
This is Rietveld 408576698