Commit c13ae846 authored by Jaroslav Sevcik's avatar Jaroslav Sevcik Committed by Commit Bot

[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/+/1547664Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60602}
parent 7fccbfe9
......@@ -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();
......
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