llvm.org GIT mirror llvm / 7900476
Remove LIS::isAllocatable() and isReserved() helpers. All callers can simply use the corresponding MRI functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165985 91177308-0d34-0410-b5e6-96231b3b80d8 Jakob Stoklund Olesen 7 years ago
5 changed file(s) with 5 addition(s) and 25 deletion(s). Raw diff Collapse all Expand all
6464 /// Live interval pointers for all the virtual registers.
6565 IndexedMap VirtRegIntervals;
6666
67 /// AllocatableRegs - A bit vector of allocatable registers.
68 BitVector AllocatableRegs;
69
70 /// ReservedRegs - A bit vector of reserved registers.
71 BitVector ReservedRegs;
72
7367 /// RegMaskSlots - Sorted list of instructions with register mask operands.
7468 /// Always use the 'r' slot, RegMasks are normal clobbers, not early
7569 /// clobbers.
120114
121115 bool hasInterval(unsigned Reg) const {
122116 return VirtRegIntervals.inBounds(Reg) && VirtRegIntervals[Reg];
123 }
124
125 /// isAllocatable - is the physical register reg allocatable in the current
126 /// function?
127 bool isAllocatable(unsigned reg) const {
128 return AllocatableRegs.test(reg);
129 }
130
131 /// isReserved - is the physical register reg reserved in the current
132 /// function
133 bool isReserved(unsigned reg) const {
134 return ReservedRegs.test(reg);
135117 }
136118
137119 // Interval creation.
163163 continue;
164164 float hweight = Hint[hint] += weight;
165165 if (TargetRegisterInfo::isPhysicalRegister(hint)) {
166 if (hweight > bestPhys && LIS.isAllocatable(hint))
166 if (hweight > bestPhys && mri.isAllocatable(hint))
167167 bestPhys = hweight, hintPhys = hint;
168168 } else {
169169 if (hweight > bestVirt)
109109 DomTree = &getAnalysis();
110110 if (!LRCalc)
111111 LRCalc = new LiveRangeCalc();
112 AllocatableRegs = TRI->getAllocatableSet(fn);
113 ReservedRegs = TRI->getReservedRegs(fn);
114112
115113 // Allocate space for all virtual registers.
116114 VirtRegIntervals.resize(MRI->getNumVirtRegs());
541539 // Ignore uses of reserved registers. We only track defs of those.
542540 for (MCRegUnitRootIterator Roots(Unit, TRI); Roots.isValid(); ++Roots) {
543541 unsigned Root = *Roots;
544 if (!isReserved(Root) && !MRI->reg_empty(Root))
542 if (!MRI->isReserved(Root) && !MRI->reg_empty(Root))
545543 LRCalc->extendToUses(LI, Root);
546544 for (MCSuperRegIterator Supers(Root, TRI); Supers.isValid(); ++Supers) {
547545 unsigned Reg = *Supers;
548 if (!isReserved(Reg) && !MRI->reg_empty(Reg))
546 if (!MRI->isReserved(Reg) && !MRI->reg_empty(Reg))
549547 LRCalc->extendToUses(LI, Reg);
550548 }
551549 }
248248 unsigned Reg = MOI->getReg();
249249 if (!TargetRegisterInfo::isVirtualRegister(Reg)) {
250250 // Check if MI reads any unreserved physregs.
251 if (Reg && MOI->readsReg() && !LIS.isReserved(Reg))
251 if (Reg && MOI->readsReg() && !MRI.isReserved(Reg))
252252 ReadsPhysRegs = true;
253253 continue;
254254 }
354354 loopInfo->getLoopDepth(mbb));
355355
356356 if (cp.isPhys()) {
357 if (!lis->isAllocatable(dst)) {
357 if (!mf->getRegInfo().isAllocatable(dst)) {
358358 continue;
359359 }
360360