Commit 08d5f432 authored by Stephan Herhut's avatar Stephan Herhut Committed by Commit Bot

[regalloc] Support spilling modes in range overview

This adds special prining for the different spill kinds.

Change-Id: Ib03da8e46b98c62b83c686ee90ae24c9052ddb39
Reviewed-on: https://chromium-review.googlesource.com/c/1477743
Commit-Queue: Stephan Herhut <herhut@chromium.org>
Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59771}
parent 69e7ded5
...@@ -1271,6 +1271,21 @@ void LinearScanAllocator::PrintRangeRow(std::ostream& os, ...@@ -1271,6 +1271,21 @@ void LinearScanAllocator::PrintRangeRow(std::ostream& os,
os << std::setw(3) << toplevel->vreg() os << std::setw(3) << toplevel->vreg()
<< (toplevel->IsSplinter() ? "s:" : ": "); << (toplevel->IsSplinter() ? "s:" : ": ");
const char* kind_string;
switch (toplevel->spill_type()) {
case TopLevelLiveRange::SpillType::kSpillRange:
kind_string = "ss";
break;
case TopLevelLiveRange::SpillType::kDeferredSpillRange:
kind_string = "sd";
break;
case TopLevelLiveRange::SpillType::kSpillOperand:
kind_string = "so";
break;
default:
kind_string = "s?";
}
for (const LiveRange* range = toplevel; range != nullptr; for (const LiveRange* range = toplevel; range != nullptr;
range = range->next()) { range = range->next()) {
for (UseInterval* interval = range->first_interval(); interval != nullptr; for (UseInterval* interval = range->first_interval(); interval != nullptr;
...@@ -1287,7 +1302,7 @@ void LinearScanAllocator::PrintRangeRow(std::ostream& os, ...@@ -1287,7 +1302,7 @@ void LinearScanAllocator::PrintRangeRow(std::ostream& os,
int max_prefix_length = std::min(length + 1, kMaxPrefixLength); int max_prefix_length = std::min(length + 1, kMaxPrefixLength);
int prefix; int prefix;
if (range->spilled()) { if (range->spilled()) {
prefix = snprintf(buffer, max_prefix_length, "|ss"); prefix = snprintf(buffer, max_prefix_length, "|%s", kind_string);
} else { } else {
const char* reg_name; const char* reg_name;
if (range->assigned_register() == kUnassignedRegister) { if (range->assigned_register() == kUnassignedRegister) {
...@@ -1311,7 +1326,7 @@ void LinearScanAllocator::PrintRangeRow(std::ostream& os, ...@@ -1311,7 +1326,7 @@ void LinearScanAllocator::PrintRangeRow(std::ostream& os,
void LinearScanAllocator::PrintRangeOverview(std::ostream& os) { void LinearScanAllocator::PrintRangeOverview(std::ostream& os) {
PrintBlockRow(os, code()->instruction_blocks()); PrintBlockRow(os, code()->instruction_blocks());
for (auto toplevel : data()->fixed_live_ranges()) { for (auto const toplevel : data()->fixed_live_ranges()) {
if (toplevel == nullptr) continue; if (toplevel == nullptr) continue;
PrintRangeRow(os, toplevel); PrintRangeRow(os, toplevel);
} }
......
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