Commit d2c3ae77 authored by bbudge's avatar bbudge Committed by Commit bot

[Turbofan] Make fixed live ranges all double when aliasing is simple.

Only ARM should have fixed live range arrays for float / simd128.

LOG=N
BUG=v8:4124

Review-Url: https://codereview.chromium.org/2471533002
Cr-Commit-Position: refs/heads/master@{#40696}
parent 3f3bacc3
...@@ -1360,18 +1360,23 @@ RegisterAllocationData::RegisterAllocationData( ...@@ -1360,18 +1360,23 @@ RegisterAllocationData::RegisterAllocationData(
allocation_zone()), allocation_zone()),
fixed_live_ranges_(this->config()->num_general_registers(), nullptr, fixed_live_ranges_(this->config()->num_general_registers(), nullptr,
allocation_zone()), allocation_zone()),
fixed_float_live_ranges_(this->config()->num_float_registers(), nullptr, fixed_float_live_ranges_(allocation_zone()),
allocation_zone()),
fixed_double_live_ranges_(this->config()->num_double_registers(), nullptr, fixed_double_live_ranges_(this->config()->num_double_registers(), nullptr,
allocation_zone()), allocation_zone()),
fixed_simd128_live_ranges_(this->config()->num_simd128_registers(), fixed_simd128_live_ranges_(allocation_zone()),
nullptr, allocation_zone()),
spill_ranges_(code->VirtualRegisterCount(), nullptr, allocation_zone()), spill_ranges_(code->VirtualRegisterCount(), nullptr, allocation_zone()),
delayed_references_(allocation_zone()), delayed_references_(allocation_zone()),
assigned_registers_(nullptr), assigned_registers_(nullptr),
assigned_double_registers_(nullptr), assigned_double_registers_(nullptr),
virtual_register_count_(code->VirtualRegisterCount()), virtual_register_count_(code->VirtualRegisterCount()),
preassigned_slot_ranges_(zone) { preassigned_slot_ranges_(zone) {
if (!kSimpleFPAliasing) {
fixed_float_live_ranges_.resize(this->config()->num_float_registers(),
nullptr);
fixed_simd128_live_ranges_.resize(this->config()->num_simd128_registers(),
nullptr);
}
assigned_registers_ = new (code_zone()) assigned_registers_ = new (code_zone())
BitVector(this->config()->num_general_registers(), code_zone()); BitVector(this->config()->num_general_registers(), code_zone());
assigned_double_registers_ = new (code_zone()) assigned_double_registers_ = new (code_zone())
...@@ -1915,24 +1920,22 @@ TopLevelLiveRange* LiveRangeBuilder::FixedLiveRangeFor(int index) { ...@@ -1915,24 +1920,22 @@ TopLevelLiveRange* LiveRangeBuilder::FixedLiveRangeFor(int index) {
TopLevelLiveRange* LiveRangeBuilder::FixedFPLiveRangeFor( TopLevelLiveRange* LiveRangeBuilder::FixedFPLiveRangeFor(
int index, MachineRepresentation rep) { int index, MachineRepresentation rep) {
int num_regs = -1; int num_regs = config()->num_double_registers();
ZoneVector<TopLevelLiveRange*>* live_ranges = nullptr; ZoneVector<TopLevelLiveRange*>* live_ranges =
switch (rep) { &data()->fixed_double_live_ranges();
case MachineRepresentation::kFloat32: if (!kSimpleFPAliasing) {
num_regs = config()->num_float_registers(); switch (rep) {
live_ranges = &data()->fixed_float_live_ranges(); case MachineRepresentation::kFloat32:
break; num_regs = config()->num_float_registers();
case MachineRepresentation::kFloat64: live_ranges = &data()->fixed_float_live_ranges();
num_regs = config()->num_double_registers(); break;
live_ranges = &data()->fixed_double_live_ranges(); case MachineRepresentation::kSimd128:
break; num_regs = config()->num_simd128_registers();
case MachineRepresentation::kSimd128: live_ranges = &data()->fixed_simd128_live_ranges();
num_regs = config()->num_simd128_registers(); break;
live_ranges = &data()->fixed_simd128_live_ranges(); default:
break; break;
default: }
UNREACHABLE();
break;
} }
DCHECK(index < num_regs); DCHECK(index < num_regs);
...@@ -2741,14 +2744,16 @@ void LinearScanAllocator::AllocateRegisters() { ...@@ -2741,14 +2744,16 @@ void LinearScanAllocator::AllocateRegisters() {
if (current != nullptr) AddToInactive(current); if (current != nullptr) AddToInactive(current);
} }
} else { } else {
for (TopLevelLiveRange* current : data()->fixed_float_live_ranges()) {
if (current != nullptr) AddToInactive(current);
}
for (TopLevelLiveRange* current : data()->fixed_double_live_ranges()) { for (TopLevelLiveRange* current : data()->fixed_double_live_ranges()) {
if (current != nullptr) AddToInactive(current); if (current != nullptr) AddToInactive(current);
} }
for (TopLevelLiveRange* current : data()->fixed_simd128_live_ranges()) { if (!kSimpleFPAliasing) {
if (current != nullptr) AddToInactive(current); for (TopLevelLiveRange* current : data()->fixed_float_live_ranges()) {
if (current != nullptr) AddToInactive(current);
}
for (TopLevelLiveRange* current : data()->fixed_simd128_live_ranges()) {
if (current != nullptr) AddToInactive(current);
}
} }
} }
......
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