Commit f3bc98a6 authored by Stephan Herhut's avatar Stephan Herhut Committed by Commit Bot

[cleanup] visualize register allocation before and after splintering

This also adds support in the c1 visualizer output generator to resolve
splintered live ranges before they have been merged back in.

Bug: v8:8238
Change-Id: I61e5f6da2e8b77ca9b42fae9004c77163d11960f
Reviewed-on: https://chromium-review.googlesource.com/c/1270817Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Stephan Herhut <herhut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56595}
parent b79cbd56
...@@ -774,8 +774,11 @@ void GraphC1Visualizer::PrintLiveRange(const LiveRange* range, const char* type, ...@@ -774,8 +774,11 @@ void GraphC1Visualizer::PrintLiveRange(const LiveRange* range, const char* type,
} }
} }
// The toplevel range is always suffixed with :0. Use that as parent. // The toplevel range might be a splinter. Pre-resolve those here so that
os_ << " " << vreg << ":0"; // they have a proper parent.
const TopLevelLiveRange* parent = range->TopLevel();
if (parent->IsSplinter()) parent = parent->splintered_from();
os_ << " " << parent->vreg() << ":" << parent->relative_id();
// TODO(herhut) Find something useful to print for the hint field // TODO(herhut) Find something useful to print for the hint field
os_ << " unknown"; os_ << " unknown";
......
...@@ -2710,8 +2710,20 @@ void PipelineImpl::AllocateRegisters(const RegisterConfiguration* config, ...@@ -2710,8 +2710,20 @@ void PipelineImpl::AllocateRegisters(const RegisterConfiguration* config,
->RangesDefinedInDeferredStayInDeferred()); ->RangesDefinedInDeferredStayInDeferred());
} }
if (info()->trace_turbo_json_enabled() && !data->MayHaveUnverifiableGraph()) {
TurboCfgFile tcf(isolate());
tcf << AsC1VRegisterAllocationData("PreAllocation",
data->register_allocation_data());
}
if (FLAG_turbo_preprocess_ranges) { if (FLAG_turbo_preprocess_ranges) {
Run<SplinterLiveRangesPhase>(); Run<SplinterLiveRangesPhase>();
if (info()->trace_turbo_json_enabled() &&
!data->MayHaveUnverifiableGraph()) {
TurboCfgFile tcf(isolate());
tcf << AsC1VRegisterAllocationData("PostSplinter",
data->register_allocation_data());
}
} }
Run<AllocateGeneralRegistersPhase<LinearScanAllocator>>(); Run<AllocateGeneralRegistersPhase<LinearScanAllocator>>();
......
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