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

Unified Diff: src/compiler/pipeline.cc

Issue 2120253002: [turbofan] Initial version of the new LoadElimination. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@TurboFan_StackCheck_NoWrite
Patch Set: REBASE. Created 4 years, 5 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/load-elimination.cc ('k') | src/flag-definitions.h » ('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 ec57f4a52651dc90a86c71c625471665c1700d12..c4e5032b7b719bb13756d7c2101e49337223c122 100644
--- a/src/compiler/pipeline.cc
+++ b/src/compiler/pipeline.cc
@@ -872,8 +872,6 @@ struct TypedLoweringPhase {
JSGraphReducer graph_reducer(data->jsgraph(), temp_zone);
DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
data->common());
- LoadElimination load_elimination(&graph_reducer, data->graph(),
- data->jsgraph()->simplified());
JSBuiltinReducer builtin_reducer(&graph_reducer, data->jsgraph());
MaybeHandle<LiteralsArray> literals_array =
data->info()->is_native_context_specializing()
@@ -912,7 +910,6 @@ struct TypedLoweringPhase {
}
AddReducer(data, &graph_reducer, &typed_lowering);
AddReducer(data, &graph_reducer, &intrinsic_lowering);
- AddReducer(data, &graph_reducer, &load_elimination);
AddReducer(data, &graph_reducer, &value_numbering);
AddReducer(data, &graph_reducer, &simple_reducer);
AddReducer(data, &graph_reducer, &checkpoint_elimination);
@@ -1043,6 +1040,22 @@ struct StoreStoreEliminationPhase {
}
};
+struct LoadEliminationPhase {
+ static const char* phase_name() { return "load elimination"; }
+
+ void Run(PipelineData* data, Zone* temp_zone) {
+ // The memory optimizer requires the graphs to be trimmed, so trim now.
+ GraphTrimmer trimmer(temp_zone, data->graph());
+ NodeVector roots(temp_zone);
+ data->jsgraph()->GetCachedNodes(&roots);
+ trimmer.TrimGraph(roots.begin(), roots.end());
+
+ // Eliminate redundant loads.
+ LoadElimination load_elimination(data->graph(), temp_zone);
+ load_elimination.Run();
+ }
+};
+
struct MemoryOptimizationPhase {
static const char* phase_name() { return "memory optimization"; }
@@ -1446,6 +1459,11 @@ bool PipelineImpl::CreateGraph() {
Run<EscapeAnalysisPhase>();
RunPrintAndVerify("Escape Analysed");
}
+
+ if (FLAG_turbo_load_elimination) {
+ Run<LoadEliminationPhase>();
+ RunPrintAndVerify("Load eliminated");
+ }
}
// Select representations. This has to run w/o the Typer decorator, because
« no previous file with comments | « src/compiler/load-elimination.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698