Lines Matching refs:interval
66 static bool ShouldProcess(bool processing_core_registers, LiveInterval* interval) {
67 bool is_core_register = (interval->GetType() != Primitive::kPrimDouble)
68 && (interval->GetType() != Primitive::kPrimFloat);
93 LiveInterval* interval = physical_register_intervals_.Get(reg);
94 if (interval == nullptr) {
95 interval = LiveInterval::MakeFixedInterval(allocator_, reg, type);
96 physical_register_intervals_.Put(reg, interval);
97 inactive_.Add(interval);
99 DCHECK(interval->GetRegister() == reg);
100 interval->AddRange(start, end);
113 // Iterate post-order, to ensure the list is sorted, and the last added interval
130 // given register, we create an interval that covers these locations. The register
132 // interval.
138 // Shift the interval's start by one to account for the blocked register.
152 // Add the interval to the correct list.
162 // of this new interval might be after intervals already in the list.
179 explicit AllRangesIterator(LiveInterval* interval)
180 : current_interval_(interval),
181 current_range_(interval->GetFirstRange()) {}
238 // Allocate a bit vector per register. A live interval that has a register
294 void RegisterAllocator::DumpInterval(std::ostream& stream, LiveInterval* interval) const {
295 interval->Dump(stream);
297 if (interval->HasRegister()) {
299 codegen_->DumpCoreRegister(stream, interval->GetRegister());
301 codegen_->DumpFloatingPointRegister(stream, interval->GetRegister());
312 // (1) Remove interval with the lowest start position from unhandled.
321 LiveInterval* interval = active_.Get(i);
322 if (interval->IsDeadAt(position)) {
323 active_.Delete(interval);
325 handled_.Add(interval);
326 } else if (!interval->Covers(position)) {
327 active_.Delete(interval);
329 inactive_.Add(interval);
336 LiveInterval* interval = inactive_.Get(i);
337 if (interval->IsDeadAt(position)) {
338 inactive_.Delete(interval);
340 handled_.Add(interval);
341 } else if (interval->Covers(position)) {
342 inactive_.Delete(interval);
344 active_.Add(interval);
356 // (6) If the interval had a register allocated, add it to the list of active
374 // For each inactive interval, set its register to be free until
387 // For each active interval, set its register to not free.
389 LiveInterval* interval = active_.Get(i);
390 DCHECK(interval->HasRegister());
391 free_until[interval->GetRegister()] = 0;
428 interval
444 // For each active interval, find the next use of its register after the
459 // For each inactive interval, find the next use of its register after the
492 // register, we split this interval just before its first register use.
498 // Use this register and spill the active and inactives interval that
537 void RegisterAllocator::AddToUnhandled(LiveInterval* interval) {
541 if (current->StartsAfter(interval)) {
546 unhandled_.InsertAt(insert_at, interval);
549 LiveInterval* RegisterAllocator::Split(LiveInterval* interval, size_t position) {
550 DCHECK(position >= interval->GetStart());
551 DCHECK(!interval->IsDeadAt(position));
552 if (position == interval->GetStart()) {
553 // Spill slot will be allocated when handling `interval` again.
554 interval->ClearRegister();
555 return interval;
557 LiveInterval* new_interval = interval->SplitAt(position);
566 void RegisterAllocator::AllocateSpillSlotFor(LiveInterval* interval) {
567 LiveInterval* parent = interval->GetParent();
570 // of this interval already has a spill slot, there is nothing to do.
587 LiveInterval* last_sibling = interval;
648 static Location ConvertToLocation(LiveInterval* interval) {
649 if (interval->HasRegister()) {
650 return Location::RegisterLocation(ManagedRegister(interval->GetRegister()));
652 HInstruction* defined_by = interval->GetParent()->GetDefinedBy();
656 DCHECK(interval->GetParent()->HasSpillSlot());
657 if (NeedTwoSpillSlot(interval->GetType())) {
658 return Location::DoubleStackSlot(interval->GetParent()->GetSpillSlot());
660 return Location::StackSlot(interval->GetParent()->GetSpillSlot());
668 // because the input moves work on the assumption that the interval moves
802 void RegisterAllocator::ConnectSiblings(LiveInterval* interval) {
803 LiveInterval* current = interval;
806 InsertMoveAfter(interval->GetDefinedBy(),
807 Location::RegisterLocation(ManagedRegister(interval->GetRegister())),
808 NeedTwoSpillSlot(interval->GetType())
809 ? Location::DoubleStackSlot(interval->GetParent()->GetSpillSlot())
810 : Location::StackSlot(interval->GetParent()->GetSpillSlot()));
819 // Walk over all uses covered by this interval, and update the location
834 // If the next interval starts just after this one, and has a register,
848 void RegisterAllocator::ConnectSplitSiblings(LiveInterval* interval,
851 if (interval->GetNextSibling() == nullptr) {
862 LiveInterval* current = interval;
879 // Interval was not split.
898 // Returns the location of `interval`, or siblings of `interval`, at `position`.
899 static Location FindLocationAt(LiveInterval* interval, size_t position) {
900 LiveInterval* current = interval;
957 LiveInterval* interval = current->GetLiveInterval();
959 ConnectSplitSiblings(interval, block->GetPredecessors().Get(i), block);