mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-11 21:57:55 +00:00
Check hint registers for interference only once before evictions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196536 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
32cbcf2295
commit
226e3eab9b
@ -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
Block a user