Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Unified Diff: src/compiler/greedy-allocator.cc

Issue 1426583002: [turbofan] Centralize splitting for memory operands. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/greedy-allocator.h ('k') | src/compiler/register-allocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « src/compiler/greedy-allocator.h ('k') | src/compiler/register-allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698