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

Unified Diff: src/compiler/pipeline.cc

Issue 1188433010: [turbofan] Move graph trimming functionality to dedicated GraphTrimmer. (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
« no previous file with comments | « src/compiler/osr.cc ('k') | test/cctest/compiler/test-control-reducer.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 1dee5ae0c7f7fc80d2a4874b03ce4e0b1d2be2f2..7b74592cdca6d48188aface5e091dd48a2b963d3 100644
--- a/src/compiler/pipeline.cc
+++ b/src/compiler/pipeline.cc
@@ -19,6 +19,7 @@
#include "src/compiler/control-reducer.h"
#include "src/compiler/frame-elider.h"
#include "src/compiler/graph-replay.h"
+#include "src/compiler/graph-trimmer.h"
#include "src/compiler/graph-visualizer.h"
#include "src/compiler/greedy-allocator.h"
#include "src/compiler/instruction.h"
@@ -653,6 +654,28 @@ struct LateControlReductionPhase {
};
+struct EarlyGraphTrimmingPhase {
+ static const char* phase_name() { return "early graph trimming"; }
+ void Run(PipelineData* data, Zone* temp_zone) {
+ GraphTrimmer trimmer(temp_zone, data->graph());
+ NodeVector roots(temp_zone);
+ data->jsgraph()->GetCachedNodes(&roots);
+ trimmer.TrimGraph(roots.begin(), roots.end());
+ }
+};
+
+
+struct LateGraphTrimmingPhase {
+ static const char* phase_name() { return "late graph trimming"; }
+ void Run(PipelineData* data, Zone* temp_zone) {
+ GraphTrimmer trimmer(temp_zone, data->graph());
+ NodeVector roots(temp_zone);
+ data->jsgraph()->GetCachedNodes(&roots);
+ trimmer.TrimGraph(roots.begin(), roots.end());
+ }
+};
+
+
struct StressLoopPeelingPhase {
static const char* phase_name() { return "stress loop peeling"; }
@@ -1024,6 +1047,9 @@ Handle<Code> Pipeline::GenerateCode() {
Run<InliningPhase>();
RunPrintAndVerify("Inlined", true);
+ Run<EarlyGraphTrimmingPhase>();
+ RunPrintAndVerify("Early trimmed", true);
+
if (FLAG_print_turbo_replay) {
// Print a replay of the initial graph.
GraphReplayPrinter::PrintReplay(data.graph());
@@ -1090,6 +1116,10 @@ Handle<Code> Pipeline::GenerateCode() {
// TODO(jarin, rossberg): Remove UNTYPED once machine typing works.
RunPrintAndVerify("Lowered generic", true);
+ Run<LateGraphTrimmingPhase>();
+ // TODO(jarin, rossberg): Remove UNTYPED once machine typing works.
+ RunPrintAndVerify("Late trimmed", true);
+
BeginPhaseKind("block building");
data.source_positions()->RemoveDecorator();
« no previous file with comments | « src/compiler/osr.cc ('k') | test/cctest/compiler/test-control-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698