llvm.org GIT mirror llvm / 9aa6e0a
Merge MRI::isPhysRegOrOverlapUsed() into isPhysRegUsed(). All callers of these functions really want the isPhysRegOrOverlapUsed() functionality which also checks aliases. For historical reasons, targets without register aliases were calling isPhysRegUsed() instead. Change isPhysRegUsed() to also check aliases, and switch all isPhysRegOrOverlapUsed() callers to isPhysRegUsed(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166117 91177308-0d34-0410-b5e6-96231b3b80d8 Jakob Stoklund Olesen 7 years ago
4 changed file(s) with 10 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
356356 //===--------------------------------------------------------------------===//
357357
358358 /// isPhysRegUsed - Return true if the specified register is used in this
359 /// function. This only works after register allocation.
359 /// function. Also check for clobbered aliases and registers clobbered by
360 /// function calls with register mask operands.
361 ///
362 /// This only works after register allocation. It is primarily used by
363 /// PrologEpilogInserter to determine which callee-saved registers need
364 /// spilling.
360365 bool isPhysRegUsed(unsigned Reg) const {
361 return UsedPhysRegs.test(Reg) || UsedPhysRegMask.test(Reg);
362 }
363
364 /// isPhysRegOrOverlapUsed - Return true if Reg or any overlapping register
365 /// is used in this function.
366 bool isPhysRegOrOverlapUsed(unsigned Reg) const {
367366 if (UsedPhysRegMask.test(Reg))
368367 return true;
369368 for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI)
656656 bool anyregs = false;
657657 for (TargetRegisterClass::const_iterator I = RC->begin(), E = RC->end();
658658 I != E; ++I)
659 if (MF->getRegInfo().isPhysRegOrOverlapUsed(*I)) {
659 if (MF->getRegInfo().isPhysRegUsed(*I)) {
660660 anyregs = true;
661661 break;
662662 }
226226 std::vector CSI;
227227 for (unsigned i = 0; CSRegs[i]; ++i) {
228228 unsigned Reg = CSRegs[i];
229 if (Fn.getRegInfo().isPhysRegOrOverlapUsed(Reg)) {
229 if (Fn.getRegInfo().isPhysRegUsed(Reg)) {
230230 // If the reg is modified, save it!
231231 CSI.push_back(CalleeSavedInfo(Reg));
232232 }
11751175 MachineRegisterInfo &MRI = MF.getRegInfo();
11761176 unsigned NumSpills = 0;
11771177 for (; NumSpills < 8; ++NumSpills)
1178 if (!MRI.isPhysRegOrOverlapUsed(ARM::D8 + NumSpills))
1178 if (!MRI.isPhysRegUsed(ARM::D8 + NumSpills))
11791179 break;
11801180
11811181 // Don't do this for just one d-register. It's not worth it.
12481248 for (unsigned i = 0; CSRegs[i]; ++i) {
12491249 unsigned Reg = CSRegs[i];
12501250 bool Spilled = false;
1251 if (MF.getRegInfo().isPhysRegOrOverlapUsed(Reg)) {
1251 if (MF.getRegInfo().isPhysRegUsed(Reg)) {
12521252 Spilled = true;
12531253 CanEliminateFrame = false;
12541254 }