Lines Matching refs:PhysReg
263 unsigned PhysReg; member
276 PhysReg = Reg; in reset()
357 unsigned canReassign(LiveInterval &VirtReg, unsigned PhysReg);
362 bool mayRecolorAllInterferences(unsigned PhysReg, LiveInterval &VirtReg,
384 unsigned PhysReg, unsigned &CostPerUseLimit,
411 unsigned PhysReg; member
412 HintInfo(BlockFrequency Freq, unsigned Reg, unsigned PhysReg) in HintInfo()
413 : Freq(Freq), Reg(Reg), PhysReg(PhysReg) {} in HintInfo()
419 bool isUnusedCalleeSavedReg(unsigned PhysReg) const;
622 unsigned PhysReg; in tryAssign() local
623 while ((PhysReg = Order.next())) in tryAssign()
624 if (!Matrix->checkInterference(VirtReg, PhysReg)) in tryAssign()
626 if (!PhysReg || Order.isHint()) in tryAssign()
627 return PhysReg; in tryAssign()
645 unsigned Cost = TRI->getCostPerUse(PhysReg); in tryAssign()
649 return PhysReg; in tryAssign()
651 DEBUG(dbgs() << PrintReg(PhysReg, TRI) << " is available at cost " << Cost in tryAssign()
654 return CheapReg ? CheapReg : PhysReg; in tryAssign()
664 unsigned PhysReg; in canReassign() local
665 while ((PhysReg = Order.next())) { in canReassign()
666 if (PhysReg == PrevReg) in canReassign()
669 MCRegUnitIterator Units(PhysReg, TRI); in canReassign()
680 if (PhysReg) in canReassign()
682 << PrintReg(PrevReg, TRI) << " to " << PrintReg(PhysReg, TRI) in canReassign()
684 return PhysReg; in canReassign()
725 bool RAGreedy::canEvictInterference(LiveInterval &VirtReg, unsigned PhysReg, in canEvictInterference() argument
728 if (Matrix->checkInterference(VirtReg, PhysReg) > LiveRegMatrix::IK_VirtReg) in canEvictInterference()
745 for (MCRegUnitIterator Units(PhysReg, TRI); Units.isValid(); ++Units) { in canEvictInterference()
795 (!EnableLocalReassign || !canReassign(*Intf, PhysReg))) { in canEvictInterference()
807 void RAGreedy::evictInterference(LiveInterval &VirtReg, unsigned PhysReg, in evictInterference() argument
816 DEBUG(dbgs() << "evicting " << PrintReg(PhysReg, TRI) in evictInterference()
821 for (MCRegUnitIterator Units(PhysReg, TRI); Units.isValid(); ++Units) { in evictInterference()
846 bool RAGreedy::isUnusedCalleeSavedReg(unsigned PhysReg) const { in isUnusedCalleeSavedReg()
847 unsigned CSR = RegClassInfo.getLastCalleeSavedAlias(PhysReg); in isUnusedCalleeSavedReg()
851 return !Matrix->isPhysRegUsed(PhysReg); in isUnusedCalleeSavedReg()
894 while (unsigned PhysReg = Order.next(OrderLimit)) { in tryEvict() local
895 if (TRI->getCostPerUse(PhysReg) >= CostPerUseLimit) in tryEvict()
899 if (CostPerUseLimit == 1 && isUnusedCalleeSavedReg(PhysReg)) { in tryEvict()
900 DEBUG(dbgs() << PrintReg(PhysReg, TRI) << " would clobber CSR " in tryEvict()
901 << PrintReg(RegClassInfo.getLastCalleeSavedAlias(PhysReg), TRI) in tryEvict()
906 if (!canEvictInterference(VirtReg, PhysReg, false, BestCost)) in tryEvict()
910 BestPhys = PhysReg; in tryEvict()
1080 if (Cand.PhysReg) in growRegion()
1390 while (unsigned PhysReg = Order.next()) { in calculateRegionSplitCost() local
1391 if (IgnoreCSR && isUnusedCalleeSavedReg(PhysReg)) in calculateRegionSplitCost()
1400 if (i == BestCand || !GlobalCand[i].PhysReg) in calculateRegionSplitCost()
1417 Cand.reset(IntfCache, PhysReg); in calculateRegionSplitCost()
1422 DEBUG(dbgs() << PrintReg(PhysReg, TRI) << "\tno positive bundles\n"); in calculateRegionSplitCost()
1425 DEBUG(dbgs() << PrintReg(PhysReg, TRI) << "\tstatic = "; in calculateRegionSplitCost()
1433 << PrintReg(GlobalCand[BestCand].PhysReg, TRI) << '\n'; in calculateRegionSplitCost()
1482 DEBUG(dbgs() << "Split for " << PrintReg(Cand.PhysReg, TRI) << " in " in doRegionSplit()
1491 assert(!Cand.PhysReg && "Compact region has no physreg"); in doRegionSplit()
1647 void RAGreedy::calcGapWeights(unsigned PhysReg, in calcGapWeights() argument
1663 for (MCRegUnitIterator Units(PhysReg, TRI); Units.isValid(); ++Units) { in calcGapWeights()
1698 for (MCRegUnitIterator Units(PhysReg, TRI); Units.isValid(); ++Units) { in calcGapWeights()
1810 while (unsigned PhysReg = Order.next()) { in tryLocalSplit() local
1813 calcGapWeights(PhysReg, GapWeight); in tryLocalSplit()
1816 if (Matrix->checkRegMaskInterference(VirtReg, PhysReg)) in tryLocalSplit()
1835 DEBUG(dbgs() << PrintReg(PhysReg, TRI) << ' ' in tryLocalSplit()
1962 unsigned PhysReg = tryLocalSplit(VirtReg, Order, NewVRegs); in trySplit() local
1963 if (PhysReg || !NewVRegs.empty()) in trySplit()
1964 return PhysReg; in trySplit()
1979 if (unsigned PhysReg = tryAssign(VirtReg, Order, NewVRegs)) in trySplit() local
1980 return PhysReg; in trySplit()
1987 unsigned PhysReg = tryRegionSplit(VirtReg, Order, NewVRegs); in trySplit() local
1988 if (PhysReg || !NewVRegs.empty()) in trySplit()
1989 return PhysReg; in trySplit()
2009 RAGreedy::mayRecolorAllInterferences(unsigned PhysReg, LiveInterval &VirtReg, in mayRecolorAllInterferences() argument
2014 for (MCRegUnitIterator Units(PhysReg, TRI); Units.isValid(); ++Units) { in mayRecolorAllInterferences()
2108 while (unsigned PhysReg = Order.next()) { in tryLastChanceRecoloring() local
2110 << PrintReg(PhysReg, TRI) << '\n'); in tryLastChanceRecoloring()
2115 if (Matrix->checkInterference(VirtReg, PhysReg) > in tryLastChanceRecoloring()
2124 if (!mayRecolorAllInterferences(PhysReg, VirtReg, RecoloringCandidates, in tryLastChanceRecoloring()
2151 Matrix->assign(VirtReg, PhysReg); in tryLastChanceRecoloring()
2162 return PhysReg; in tryLastChanceRecoloring()
2166 << PrintReg(PhysReg, TRI) << '\n'); in tryLastChanceRecoloring()
2202 unsigned PhysReg; in tryRecoloringCandidates() local
2203 PhysReg = selectOrSplitImpl(*LI, NewVRegs, FixedRegisters, Depth + 1); in tryRecoloringCandidates()
2204 if (PhysReg == ~0u || !PhysReg) in tryRecoloringCandidates()
2207 << " succeeded with: " << PrintReg(PhysReg, TRI) << '\n'); in tryRecoloringCandidates()
2208 Matrix->assign(*LI, PhysReg); in tryRecoloringCandidates()
2250 unsigned PhysReg, in tryAssignCSRFirstTime() argument
2258 return PhysReg; in tryAssignCSRFirstTime()
2275 return PhysReg; in tryAssignCSRFirstTime()
2281 return PhysReg; in tryAssignCSRFirstTime()
2342 unsigned PhysReg) { in getBrokenHintFreq() argument
2345 if (Info.PhysReg != PhysReg) in getBrokenHintFreq()
2367 unsigned PhysReg = VRM->getPhys(Reg); in tryHintRecoloring() local
2374 << PrintReg(PhysReg, TRI) << ")\n"); in tryHintRecoloring()
2391 if (CurrPhys != PhysReg && (!MRI->getRegClass(Reg)->contains(PhysReg) || in tryHintRecoloring()
2392 Matrix->checkInterference(LI, PhysReg))) in tryHintRecoloring()
2403 if (CurrPhys != PhysReg) { in tryHintRecoloring()
2406 BlockFrequency NewCopiesCost = getBrokenHintFreq(Info, PhysReg); in tryHintRecoloring()
2419 Matrix->assign(LI, PhysReg); in tryHintRecoloring()
2485 if (unsigned PhysReg = tryAssign(VirtReg, Order, NewVRegs)) { in selectOrSplitImpl() local
2489 if (CSRCost.getFrequency() && isUnusedCalleeSavedReg(PhysReg) && in selectOrSplitImpl()
2491 unsigned CSRReg = tryAssignCSRFirstTime(VirtReg, Order, PhysReg, in selectOrSplitImpl()
2498 return PhysReg; in selectOrSplitImpl()
2509 if (unsigned PhysReg = in selectOrSplitImpl() local
2517 if (Hint && Hint != PhysReg) in selectOrSplitImpl()
2519 return PhysReg; in selectOrSplitImpl()
2541 unsigned PhysReg = trySplit(VirtReg, Order, NewVRegs); in selectOrSplitImpl() local
2542 if (PhysReg || !NewVRegs.empty()) in selectOrSplitImpl()
2543 return PhysReg; in selectOrSplitImpl()