Try harder to get the hint by preferring to evict hint interference.

llvm-svn: 126463
This commit is contained in:
Jakob Stoklund Olesen 2011-02-25 01:04:22 +00:00
parent fbdcea4b2e
commit 9d328484ce
2 changed files with 5 additions and 0 deletions

View File

@ -47,6 +47,8 @@ public:
/// rewind - Start over from the beginning.
void rewind() { Pos = 0; }
/// isHint - Return true if PhysReg is a preferred register.
bool isHint(unsigned PhysReg) const { return PhysReg == Hint; }
};
} // end namespace llvm

View File

@ -379,6 +379,9 @@ unsigned RAGreedy::tryEvict(LiveInterval &VirtReg,
// Best so far.
BestPhys = PhysReg;
BestWeight = Weight;
// Stop if the hint can be used.
if (Order.isHint(PhysReg))
break;
}
if (!BestPhys)