Home | History | Annotate | Download | only in optimizing

Lines Matching refs:current

77   // Always reserve for the current method and the graph's max out registers.
116 HInstruction* instruction = inst_it.Current();
123 HInstruction* instruction = inst_it.Current();
171 ProcessInstruction(back_it.Current());
174 ProcessInstruction(inst_it.Current());
196 // can be after the current interval during linear scan.
216 // can be after the current interval during linear scan.
300 LiveInterval* current = instruction->GetLiveInterval();
301 if (current == nullptr) return;
307 DCHECK(unhandled.empty() || current->StartsBeforeOrAt(unhandled.back()));
309 if (codegen_->NeedsTwoRegisters(current->GetType())) {
310 current->AddHighInterval();
321 if (safepoint_position == current->GetStart()) {
327 } else if (current->IsDeadAt(safepoint_position)) {
329 } else if (!current->Covers(safepoint_position)) {
333 current->AddSafepoint(safepoint);
335 current->ResetSearchCache();
348 current->SetFrom(position + 1);
349 current->SetRegister(first.reg());
351 current->SetFrom(position + 1);
352 current->SetRegister(first.low());
353 LiveInterval* high = current->GetHighInterval();
359 current->SetFrom(position + 1);
360 current->SetRegister(output.reg());
363 current->SetFrom(position + 1);
364 current->SetRegister(output.low());
365 LiveInterval* high = current->GetHighInterval();
371 current->SetSpillSlot(output.GetStackIndex());
381 if (current->HasSpillSlot() || instruction->IsConstant()) {
383 current->FirstRegisterUse();
385 LiveInterval* split = SplitBetween(current, current->GetStart(), first_register_use - 1);
396 AddSorted(&unhandled, current);
503 LiveInterval* current = unhandled_->back();
507 DCHECK(!current->IsFixed() && !current->HasSpillSlot());
509 DCHECK(unhandled_->empty() || unhandled_->back()->GetStart() >= current->GetStart());
511 DCHECK(!current->IsLowInterval() || unhandled_->back()->IsHighInterval());
513 DCHECK(current->IsLowInterval() ||
517 size_t position = current->GetStart();
562 if (current->IsHighInterval() && !current->GetLowInterval()->HasRegister()) {
563 DCHECK(!current->HasRegister());
570 bool success = TryAllocateFreeReg(current);
574 success = AllocateBlockedReg(current);
581 ? Location::RegisterLocation(current->GetRegister())
582 : Location::FpuRegisterLocation(current->GetRegister()));
583 active_.push_back(current);
584 if (current->HasHighInterval() && !current->GetHighInterval()->HasRegister()) {
585 current->GetHighInterval()->SetRegister(GetHighForLowRegister(current->GetRegister()));
595 // Since `position` is not the current scan position, we need to use CoversSlow.
617 bool RegisterAllocatorLinearScan::TryAllocateFreeReg(LiveInterval* current) {
634 HInstruction* defined_by = current->GetDefinedBy();
635 if (defined_by != nullptr && !current->IsSplit()) {
646 if (interval->HasRegister() && interval->SameRegisterKind(*current)) {
661 // the next intersection with `current`.
665 if (!current->IsSplit() && !inactive->IsFixed()) {
666 // Neither current nor inactive are fixed.
670 DCHECK_EQ(inactive->FirstIntersectionWith(current), kNoLifetime);
679 size_t next_intersection = inactive->FirstIntersectionWith(current);
687 if (current->HasRegister()) {
689 reg = current->GetRegister();
691 DCHECK(current->IsHighInterval());
696 DCHECK(!current->IsHighInterval());
697 int hint = current->FindFirstRegisterHint(free_until, liveness_);
701 && !(current->IsLowInterval() && IsBlocked(GetHighForLowRegister(hint)))) {
704 } else if (current->IsLowInterval()) {
705 reg = FindAvailableRegisterPair(free_until, current->GetStart());
707 reg = FindAvailableRegister(free_until, current);
717 if (current->IsLowInterval()) {
719 int high_reg = current->GetHighInterval()->GetRegister();
728 current->SetRegister(reg);
729 if (!current->IsDeadAt(free_until[reg])) {
731 // covered by `current`, split `current` before the position where
733 LiveInterval* split = SplitBetween(current, current->GetStart(), free_until[reg]);
763 // If one of the current register is known to be unavailable, just unconditionally
777 int RegisterAllocatorLinearScan::FindAvailableRegister(size_t* next_use, LiveInterval* current) const {
781 bool prefers_caller_save = !current->HasWillCallSafepoint();
870 // that holds it. If the first use of `current` is after that register
871 // we spill `current` instead.
872 bool RegisterAllocatorLinearScan::AllocateBlockedReg(LiveInterval* current) {
873 size_t first_register_use = current->FirstRegisterUse();
874 if (current->HasRegister()) {
875 DCHECK(current->IsHighInterval());
882 DCHECK(first_register_use != kNoLifetime || (current->GetNextSibling() != nullptr));
884 AllocateSpillSlotFor(current);
895 // start of current.
899 next_use[active->GetRegister()] = current->GetStart();
901 size_t use = active->FirstRegisterUseAfter(current->GetStart());
909 // start of current.
913 if (!current->IsSplit() && !inactive->IsFixed()) {
914 // Neither current nor inactive are fixed.
918 DCHECK_EQ(inactive->FirstIntersectionWith(current), kNoLifetime);
922 size_t next_intersection = inactive->FirstIntersectionWith(current);
928 size_t use = inactive->FirstUseAfter(current->GetStart());
938 if (current->HasRegister()) {
939 DCHECK(current->IsHighInterval());
940 reg = current->GetRegister();
943 } else if (current->IsLowInterval()) {
949 DCHECK(!current->IsHighInterval());
950 reg = FindAvailableRegister(next_use, current);
956 DCHECK(!current->IsHighInterval());
957 bool is_allocation_at_use_site = (current->GetStart() >= (first_register_use - 1));
959 if (!current->IsLowInterval()) {
960 DumpInterval(std::cerr, current);
965 << current->GetParent()->GetDefinedBy()->DebugName() << " "
966 << current->GetParent()->GetDefinedBy()->GetId()
971 // If we're allocating a register for `current` because the instruction at
976 bool success = TrySplitNonPairOrUnalignedPairIntervalAt(current->GetStart(),
982 DCHECK_EQ(existing->GetLowInterval(), current);
983 unhandled_->push_back(current);
987 AllocateSpillSlotFor(current);
988 LiveInterval* split = SplitBetween(current, current->GetStart(), first_register_use - 1);
989 DCHECK(current != split);
996 current->SetRegister(reg);
1002 LiveInterval* split = Split(active, current->GetStart());
1017 if (!current->IsSplit() && !inactive->IsFixed()) {
1018 // Neither current nor inactive are fixed.
1022 DCHECK_EQ(inactive->FirstIntersectionWith(current), kNoLifetime);
1024 size_t next_intersection = inactive->FirstIntersectionWith(current);
1027 LiveInterval* split = Split(current, next_intersection);
1028 DCHECK_NE(split, current);
1031 // Split at the start of `current`, which will lead to splitting
1033 LiveInterval* split = Split(inactive, current->GetStart());
1034 // If it's inactive, it must start before the current interval.
1060 LiveInterval* current = (*array)[i - 1u];
1062 if (current->StartsAfter(interval) && !current->IsHighInterval()) {