diff options
| author | 2016-07-13 18:07:04 +0000 | |
|---|---|---|
| committer | 2016-07-13 18:07:04 +0000 | |
| commit | 633c22de95fe6f80c0dd3176e15de4de3ee4bc79 (patch) | |
| tree | 0f9983cabba29de867051ea990221603f0ff765a /compiler/optimizing | |
| parent | bcdc888a393d226a970f4611b649cd9a3de815b9 (diff) | |
| parent | f64a6ab5f69446303faadbf6a0ede00af435e25c (diff) | |
Merge "Improve search for available spill slots in RA"
Diffstat (limited to 'compiler/optimizing')
| -rw-r--r-- | compiler/optimizing/register_allocator.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/compiler/optimizing/register_allocator.cc b/compiler/optimizing/register_allocator.cc index 9d99668484..1b33408b7e 100644 --- a/compiler/optimizing/register_allocator.cc +++ b/compiler/optimizing/register_allocator.cc @@ -1346,9 +1346,15 @@ void RegisterAllocator::AllocateSpillSlotFor(LiveInterval* interval) { // Find an available spill slot. size_t slot = 0; for (size_t e = spill_slots->size(); slot < e; ++slot) { - if ((*spill_slots)[slot] <= parent->GetStart() - && (slot == (e - 1) || (*spill_slots)[slot + 1] <= parent->GetStart())) { - break; + if ((*spill_slots)[slot] <= parent->GetStart()) { + if (!parent->NeedsTwoSpillSlots()) { + // One spill slot is sufficient. + break; + } + if (slot == e - 1 || (*spill_slots)[slot + 1] <= parent->GetStart()) { + // Two spill slots are available. + break; + } } } |