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

Unified Diff: src/compiler/pipeline.cc

Issue 2159303002: [turbofan] Improve the store-store elimination. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@p1-base
Patch Set: Cut down on documentation and tracing. There is now only a single trace level. 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 | « no previous file | src/compiler/store-store-elimination.h » ('j') | src/compiler/store-store-elimination.cc » ('J')
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 9683a83d68dc7b5c6c6132ce98b30d934476f05f..13bb24d20e0ece90fb6c08cdae425f651782e0f2 100644
--- a/src/compiler/pipeline.cc
+++ b/src/compiler/pipeline.cc
@@ -1032,12 +1032,33 @@ struct EffectControlLinearizationPhase {
}
};
+// The store-store elimination greatly benefits from doing a common operator
+// reducer just before it, to eliminate conditional deopts with a constant
+// condition.
+
+struct CommonOperatorReducerPhase {
Jarin 2016/07/25 09:52:13 Rename to DeadCodeEliminationPhase (because that i
bgeron 2016/07/27 13:40:37 Done.
+ static const char* phase_name() { return "common operator reducer"; }
+
+ void Run(PipelineData* data, Zone* temp_zone) {
+ // Run the common operator reducer.
+ JSGraphReducer graph_reducer(data->jsgraph(), temp_zone);
+ DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
+ data->common());
+ CommonOperatorReducer common_reducer(&graph_reducer, data->graph(),
+ data->common(), data->machine());
+ AddReducer(data, &graph_reducer, &dead_code_elimination);
+ AddReducer(data, &graph_reducer, &common_reducer);
+ graph_reducer.ReduceGraph();
+ }
+};
+
struct StoreStoreEliminationPhase {
- static const char* phase_name() { return "Store-store elimination"; }
+ static const char* phase_name() { return "store-store elimination"; }
void Run(PipelineData* data, Zone* temp_zone) {
- StoreStoreElimination store_store_elimination(data->jsgraph(), temp_zone);
- store_store_elimination.Run();
+ GraphTrimmer(temp_zone, data->graph()).TrimGraph();
Jarin 2016/07/25 09:52:13 Could you call the trimming on the roots, too? (As
bgeron 2016/07/27 13:40:37 Done. Actually, I think the graph would be trimmed
+
+ StoreStoreElimination::Run(data->jsgraph(), temp_zone);
}
};
@@ -1518,6 +1539,9 @@ bool PipelineImpl::OptimizeGraph(Linkage* linkage) {
Run<EffectControlLinearizationPhase>();
RunPrintAndVerify("Effect and control linearized", true);
+ Run<CommonOperatorReducerPhase>();
+ RunPrintAndVerify("Common operator reducer", true);
+
if (FLAG_turbo_store_elimination) {
Run<StoreStoreEliminationPhase>();
RunPrintAndVerify("Store-store elimination", true);
« no previous file with comments | « no previous file | src/compiler/store-store-elimination.h » ('j') | src/compiler/store-store-elimination.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698