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

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

Issue 2355373002: [turbofan] Pre-spill ranges that have a slot use. (Closed)
Patch Set: [turbofan] Don't pre-spill ranges that don't even have a slot use. Created 4 years, 3 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/register-allocator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/register-allocator.cc
diff --git a/src/compiler/register-allocator.cc b/src/compiler/register-allocator.cc
index e6869051b7d1069698c78c6fb7bdb29835078c52..efcdcb42e64eb79ef0546c0215c1974feb5bb6c8 100644
--- a/src/compiler/register-allocator.cc
+++ b/src/compiler/register-allocator.cc
@@ -2385,15 +2385,15 @@ LifetimePosition RegisterAllocator::GetSplitPositionForInstruction(
return ret;
}
-
-void RegisterAllocator::SplitAndSpillRangesDefinedByMemoryOperand(
- bool operands_only) {
+void RegisterAllocator::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;
-
+ if (range->HasNoSpillType() ||
+ (range->HasSpillRange() && !range->has_slot_use())) {
+ continue;
+ }
LifetimePosition start = range->Start();
TRACE("Live range %d:%d is defined by a spill operand.\n",
range->TopLevel()->vreg(), range->relative_id());
@@ -2571,8 +2571,7 @@ void LinearScanAllocator::AllocateRegisters() {
DCHECK(active_live_ranges().empty());
DCHECK(inactive_live_ranges().empty());
- SplitAndSpillRangesDefinedByMemoryOperand(code()->VirtualRegisterCount() <=
- num_allocatable_registers());
+ SplitAndSpillRangesDefinedByMemoryOperand();
for (TopLevelLiveRange* range : data()->live_ranges()) {
if (!CanProcessRange(range)) continue;
« no previous file with comments | « src/compiler/register-allocator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698