[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/+/1815130
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63981}
This commit is contained in:
Ross McIlroy 2019-09-23 17:24:44 +01:00 committed by Commit Bot
parent dbfcdcff54
commit c70de45c6a
2 changed files with 21 additions and 9 deletions

View File

@ -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()) {

View File

@ -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
##############################################################################