| Index: src/compiler/pipeline.cc
|
| diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc
|
| index 209ddfdf0da243c8c62cf6667cddb53e16a0054f..09ff9709aa0097a1104408f8cd17b2d1641121dc 100644
|
| --- a/src/compiler/pipeline.cc
|
| +++ b/src/compiler/pipeline.cc
|
| @@ -12,6 +12,7 @@
|
| #include "src/compiler/ast-graph-builder.h"
|
| #include "src/compiler/ast-loop-assignment-analyzer.h"
|
| #include "src/compiler/basic-block-instrumentor.h"
|
| +#include "src/compiler/branch-condition-elimination.h"
|
| #include "src/compiler/bytecode-graph-builder.h"
|
| #include "src/compiler/change-lowering.h"
|
| #include "src/compiler/code-generator.h"
|
| @@ -609,6 +610,22 @@ struct TypedLoweringPhase {
|
| };
|
|
|
|
|
| +struct BranchConditionEliminationPhase {
|
| + static const char* phase_name() { return "branch condition elimination"; }
|
| +
|
| + void Run(PipelineData* data, Zone* temp_zone) {
|
| + JSGraphReducer graph_reducer(data->jsgraph(), temp_zone);
|
| + BranchConditionElimination branch_condition_elimination(
|
| + &graph_reducer, data->jsgraph(), temp_zone);
|
| + DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
|
| + data->common());
|
| + AddReducer(data, &graph_reducer, &branch_condition_elimination);
|
| + AddReducer(data, &graph_reducer, &dead_code_elimination);
|
| + graph_reducer.ReduceGraph();
|
| + }
|
| +};
|
| +
|
| +
|
| struct SimplifiedLoweringPhase {
|
| static const char* phase_name() { return "simplified lowering"; }
|
|
|
| @@ -1117,6 +1134,9 @@ Handle<Code> Pipeline::GenerateCode() {
|
| Run<SimplifiedLoweringPhase>();
|
| RunPrintAndVerify("Lowered simplified");
|
|
|
| + Run<BranchConditionEliminationPhase>();
|
| + RunPrintAndVerify("Branch conditions eliminated");
|
| +
|
| // Optimize control flow.
|
| if (FLAG_turbo_cf_optimization) {
|
| Run<ControlFlowOptimizationPhase>();
|
|
|