[turbofan] Run memory optimizer last.

Run memory optimizer after all the other graph phases. This is
a step towards enabling allocation folding for arrays with
>16 elements because constant additions will be properly
constant-folded.

Bug: v8:8984
Change-Id: Ia3c78a3bd32264f4f83d3e20bd78abf240d9292b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1539496
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60465}
This commit is contained in:
Jaroslav Sevcik 2019-03-26 09:42:17 +01:00 committed by Commit Bot
parent 37c861a7d6
commit e6fbf933b8

View File

@ -2107,16 +2107,13 @@ bool PipelineImpl::OptimizeGraph(Linkage* linkage) {
RunPrintAndVerify(ControlFlowOptimizationPhase::phase_name(), true);
}
Run<LateOptimizationPhase>();
RunPrintAndVerify(LateOptimizationPhase::phase_name(), true);
// Optimize memory access and allocation operations.
Run<MemoryOptimizationPhase>();
// TODO(jarin, rossberg): Remove UNTYPED once machine typing works.
RunPrintAndVerify(MemoryOptimizationPhase::phase_name(), true);
// Lower changes that have been inserted before.
Run<LateOptimizationPhase>();
// TODO(jarin, rossberg): Remove UNTYPED once machine typing works.
RunPrintAndVerify(LateOptimizationPhase::phase_name(), true);
data->source_positions()->RemoveDecorator();
if (data->info()->trace_turbo_json_enabled()) {
data->node_origins()->RemoveDecorator();