[turbofan] Introduce fix up phase after memory optimization

On arm processors, we need to have some kind of subexpression
elimination running after memory optimizer, so that we reuse index
calculation for loads and stores. This CL introduces a small cleanup
phase after memory optimizer.

Bug: chromium:947225
Change-Id: Ifda7b348d968d58f31947a4ba139863059f4112d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1547664
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60602}
This commit is contained in:
Jaroslav Sevcik 2019-04-03 07:19:22 +02:00 committed by Commit Bot
parent 7fccbfe9c3
commit c13ae846e1

View File

@ -1547,6 +1547,21 @@ struct LateOptimizationPhase {
}
};
struct MachineOperatorOptimizationPhase {
static const char* phase_name() { return "V8.TFMachineOperatorOptimization"; }
void Run(PipelineData* data, Zone* temp_zone) {
GraphReducer graph_reducer(temp_zone, data->graph(),
data->jsgraph()->Dead());
ValueNumberingReducer value_numbering(temp_zone, data->graph()->zone());
MachineOperatorReducer machine_reducer(&graph_reducer, data->jsgraph());
AddReducer(data, &graph_reducer, &machine_reducer);
AddReducer(data, &graph_reducer, &value_numbering);
graph_reducer.ReduceGraph();
}
};
struct CsaOptimizationPhase {
static const char* phase_name() { return "V8.CSAOptimization"; }
@ -2114,6 +2129,12 @@ bool PipelineImpl::OptimizeGraph(Linkage* linkage) {
Run<MemoryOptimizationPhase>();
RunPrintAndVerify(MemoryOptimizationPhase::phase_name(), true);
// Run value numbering and machine operator reducer to optimize load/store
// address computation (in particular, reuse the address computation whenever
// possible).
Run<MachineOperatorOptimizationPhase>();
RunPrintAndVerify(MachineOperatorOptimizationPhase::phase_name(), true);
data->source_positions()->RemoveDecorator();
if (data->info()->trace_turbo_json_enabled()) {
data->node_origins()->RemoveDecorator();