Commit 87e53cb8 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[turbofan] Run checkpoint elimination early.

This runs the existing checkpoint elimination during the "inlining"
optimization phase. It will eliminate redundant checkpoint nodes and
hence reduce graph size earlier. After this change the reducer in
question runs during {InliningPhase} as well as {TypedLoweringPhase}.

R=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/2670763003
Cr-Commit-Position: refs/heads/master@{#42918}
parent ac187c03
...@@ -777,6 +777,7 @@ struct InliningPhase { ...@@ -777,6 +777,7 @@ struct InliningPhase {
JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); JSGraphReducer graph_reducer(data->jsgraph(), temp_zone);
DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
data->common()); data->common());
CheckpointElimination checkpoint_elimination(&graph_reducer);
CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), CommonOperatorReducer common_reducer(&graph_reducer, data->graph(),
data->common(), data->machine()); data->common(), data->machine());
JSCallReducer::Flags call_reducer_flags = JSCallReducer::kNoFlags; JSCallReducer::Flags call_reducer_flags = JSCallReducer::kNoFlags;
...@@ -818,6 +819,7 @@ struct InliningPhase { ...@@ -818,6 +819,7 @@ struct InliningPhase {
? JSIntrinsicLowering::kDeoptimizationEnabled ? JSIntrinsicLowering::kDeoptimizationEnabled
: JSIntrinsicLowering::kDeoptimizationDisabled); : JSIntrinsicLowering::kDeoptimizationDisabled);
AddReducer(data, &graph_reducer, &dead_code_elimination); AddReducer(data, &graph_reducer, &dead_code_elimination);
AddReducer(data, &graph_reducer, &checkpoint_elimination);
AddReducer(data, &graph_reducer, &common_reducer); AddReducer(data, &graph_reducer, &common_reducer);
if (data->info()->is_frame_specializing()) { if (data->info()->is_frame_specializing()) {
AddReducer(data, &graph_reducer, &frame_specialization); AddReducer(data, &graph_reducer, &frame_specialization);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment