| Index: src/compiler/pipeline.cc
|
| diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc
|
| index 9683a83d68dc7b5c6c6132ce98b30d934476f05f..bbf5cbc825dafe26b6b4df9e586491427fb53bf0 100644
|
| --- a/src/compiler/pipeline.cc
|
| +++ b/src/compiler/pipeline.cc
|
| @@ -1032,12 +1032,36 @@ 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 DeadCodeEliminationPhase {
|
| + 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 trimmer(temp_zone, data->graph());
|
| + NodeVector roots(temp_zone);
|
| + data->jsgraph()->GetCachedNodes(&roots);
|
| + trimmer.TrimGraph(roots.begin(), roots.end());
|
| +
|
| + StoreStoreElimination::Run(data->jsgraph(), temp_zone);
|
| }
|
| };
|
|
|
| @@ -1518,6 +1542,9 @@ bool PipelineImpl::OptimizeGraph(Linkage* linkage) {
|
| Run<EffectControlLinearizationPhase>();
|
| RunPrintAndVerify("Effect and control linearized", true);
|
|
|
| + Run<DeadCodeEliminationPhase>();
|
| + RunPrintAndVerify("Common operator reducer", true);
|
| +
|
| if (FLAG_turbo_store_elimination) {
|
| Run<StoreStoreEliminationPhase>();
|
| RunPrintAndVerify("Store-store elimination", true);
|
|
|