forked from OSchip/llvm-project
Check hint registers for interference only once before evictions
llvm-svn: 196536
This commit is contained in:
parent
6a8b8b5f0d
commit
73f3d33dbb
|
@ -45,10 +45,12 @@ public:
|
|||
/// Return the next physical register in the allocation order, or 0.
|
||||
/// It is safe to call next() again after it returned 0, it will keep
|
||||
/// returning 0 until rewind() is called.
|
||||
unsigned next() {
|
||||
unsigned next(unsigned Limit = 0) {
|
||||
if (Pos < 0)
|
||||
return Hints.end()[Pos++];
|
||||
while (Pos < int(Order.size())) {
|
||||
if (!Limit)
|
||||
Limit = Order.size();
|
||||
while (Pos < int(Limit)) {
|
||||
unsigned Reg = Order[Pos++];
|
||||
if (!isHint(Reg))
|
||||
return Reg;
|
||||
|
|
|
@ -723,7 +723,7 @@ unsigned RAGreedy::tryEvict(LiveInterval &VirtReg,
|
|||
}
|
||||
|
||||
Order.rewind();
|
||||
while (unsigned PhysReg = Order.nextWithDups(OrderLimit)) {
|
||||
while (unsigned PhysReg = Order.next(OrderLimit)) {
|
||||
if (TRI->getCostPerUse(PhysReg) >= CostPerUseLimit)
|
||||
continue;
|
||||
// The first use of a callee-saved register in a function has cost 1.
|
||||
|
|
Loading…
Reference in New Issue