| Index: src/compiler/greedy-allocator.cc
|
| diff --git a/src/compiler/greedy-allocator.cc b/src/compiler/greedy-allocator.cc
|
| index 5742801d69dd26675e88f9d8c0d8fad2906884d9..7a30ba563136ae66a2e0770db6413abce85f58e2 100644
|
| --- a/src/compiler/greedy-allocator.cc
|
| +++ b/src/compiler/greedy-allocator.cc
|
| @@ -50,19 +50,6 @@ LiveRange* Split(LiveRange* range, RegisterAllocationData* data,
|
| }
|
|
|
|
|
| -// TODO(mtrofin): explain why splitting in gap START is always OK.
|
| -LifetimePosition GetSplitPositionForInstruction(const LiveRange* range,
|
| - int instruction_index) {
|
| - LifetimePosition ret = LifetimePosition::Invalid();
|
| -
|
| - ret = LifetimePosition::GapFromInstructionIndex(instruction_index);
|
| - if (range->Start() >= ret || ret >= range->End()) {
|
| - return LifetimePosition::Invalid();
|
| - }
|
| - return ret;
|
| -}
|
| -
|
| -
|
| } // namespace
|
|
|
|
|
| @@ -374,43 +361,6 @@ void GreedyAllocator::EvictAndRescheduleConflicts(unsigned reg_id,
|
| }
|
|
|
|
|
| -void GreedyAllocator::SplitAndSpillRangesDefinedByMemoryOperand() {
|
| - size_t initial_range_count = data()->live_ranges().size();
|
| - for (size_t i = 0; i < initial_range_count; ++i) {
|
| - TopLevelLiveRange* range = data()->live_ranges()[i];
|
| - if (!CanProcessRange(range)) continue;
|
| - if (!range->HasSpillOperand()) continue;
|
| -
|
| - LifetimePosition start = range->Start();
|
| - TRACE("Live range %d:%d is defined by a spill operand.\n",
|
| - range->TopLevel()->vreg(), range->relative_id());
|
| - auto next_pos = start;
|
| - if (next_pos.IsGapPosition()) {
|
| - next_pos = next_pos.NextStart();
|
| - }
|
| - auto pos = range->NextUsePositionRegisterIsBeneficial(next_pos);
|
| - // If the range already has a spill operand and it doesn't need a
|
| - // register immediately, split it and spill the first part of the range.
|
| - if (pos == nullptr) {
|
| - Spill(range);
|
| - } else if (pos->pos() > range->Start().NextStart()) {
|
| - // Do not spill live range eagerly if use position that can benefit from
|
| - // the register is too close to the start of live range.
|
| - auto split_pos = GetSplitPositionForInstruction(
|
| - range, pos->pos().ToInstructionIndex());
|
| - // There is no place to split, so we can't split and spill.
|
| - if (!split_pos.IsValid()) continue;
|
| -
|
| - split_pos =
|
| - FindOptimalSplitPos(range->Start().NextFullStart(), split_pos);
|
| -
|
| - Split(range, data(), split_pos);
|
| - Spill(range);
|
| - }
|
| - }
|
| -}
|
| -
|
| -
|
| void GreedyAllocator::AllocateRegisters() {
|
| CHECK(scheduler().empty());
|
| CHECK(allocations_.empty());
|
|
|