Commit c70de45c authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[TurboProp] Add MidTierMachineLoweringPhase to avoid Late/MemoryOptimizationPhases

Adds a MidTierMachineLoweringPhase which does select and memory lowering to machine
nodes. This allows TurboProp to avoid the LateOptimizationPhase and
MemoryOptimizationPhase phases while still lowering all simplified nodes to
machine nodes before instruction selection.

BUG=v8:9684

Change-Id: I60533db93152ff044a2fa8c1c31adedeb3747856
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1815130Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63981}
parent dbfcdcff
......@@ -1783,6 +1783,24 @@ struct MachineOperatorOptimizationPhase {
}
};
struct MidTierMachineLoweringPhase {
static const char* phase_name() { return "V8.TFMidTierMachineLoweringPhase"; }
void Run(PipelineData* data, Zone* temp_zone) {
GraphReducer graph_reducer(temp_zone, data->graph(),
&data->info()->tick_counter(),
data->jsgraph()->Dead());
SelectLowering select_lowering(data->jsgraph()->graph(),
data->jsgraph()->common());
MemoryLowering memory_lowering(data->jsgraph(), temp_zone,
data->info()->GetPoisoningMitigationLevel());
AddReducer(data, &graph_reducer, &memory_lowering);
AddReducer(data, &graph_reducer, &select_lowering);
graph_reducer.ReduceGraph();
}
};
struct CsaEarlyOptimizationPhase {
static const char* phase_name() { return "V8.CSAEarlyOptimization"; }
......@@ -2455,15 +2473,8 @@ bool PipelineImpl::OptimizeGraphForMidTier(Linkage* linkage) {
Run<EffectControlLinearizationPhase>();
RunPrintAndVerify(EffectControlLinearizationPhase::phase_name(), true);
// TODO(9684): Remove LateOptimizationPhase and move SelectLowering into the
// preceeding or subsequent phase.
Run<LateOptimizationPhase>();
RunPrintAndVerify(LateOptimizationPhase::phase_name(), true);
// TODO(9684): Consider directly lowering memory operations without memory
// optimizations.
Run<MemoryOptimizationPhase>();
RunPrintAndVerify(MemoryOptimizationPhase::phase_name(), true);
Run<MidTierMachineLoweringPhase>();
RunPrintAndVerify(MidTierMachineLoweringPhase::phase_name(), true);
data->source_positions()->RemoveDecorator();
if (data->info()->trace_turbo_json_enabled()) {
......
......@@ -1121,6 +1121,7 @@
'compiler/concurrent-inlining-2': [SKIP],
'compiler/diamond-followedby-branch': [SKIP],
'compiler/load-elimination-const-field': [SKIP],
'compiler/constant-fold-add-static': [SKIP],
}], # variant == turboprop
##############################################################################
......
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