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

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: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/osr.cc ('k') | src/compiler/simplified-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/pipeline.cc
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc
index 70d4be6033e303e971640c1dce270e6ca99c7113..3e46d6f5194bd6abc0356231c627d67d0d97691e 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,8 +407,8 @@ class SourcePositionWrapper final : public Reducer {
class JSGraphReducer final : public GraphReducer {
public:
JSGraphReducer(JSGraph* jsgraph, Zone* zone)
- : GraphReducer(zone, jsgraph->graph(), jsgraph->DeadValue(),
- jsgraph->DeadControl()) {}
+ : GraphReducer(zone, jsgraph->graph(), jsgraph->TheHoleConstant(),
+ jsgraph->Dead()) {}
~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();
}
};
« no previous file with comments | « src/compiler/osr.cc ('k') | src/compiler/simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698