1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

Down-scale slot index distance to save bits.

llvm-svn: 187438
This commit is contained in:
Andrew Trick 2013-07-30 19:59:19 +00:00
parent 05b1db7761
commit 412a9a4e32
2 changed files with 8 additions and 1 deletions

View File

@ -218,6 +218,13 @@ namespace llvm {
return other.getIndex() - getIndex();
}
/// Return the scaled distance from this index to the given one, where all
/// slots on the same instruction have zero distance.
int getInstrDistance(SlotIndex other) const {
return (other.listEntry()->getIndex() - listEntry()->getIndex())
/ Slot_Count;
}
/// isBlock - Returns true if this is a block boundary slot.
bool isBlock() const { return getSlot() == Slot_Block; }

View File

@ -419,7 +419,7 @@ void RAGreedy::enqueue(LiveInterval *LI) {
// Allocate original local ranges in linear instruction order. Since they
// are singly defined, this produces optimal coloring in the absence of
// global interference and other constraints.
Prio = LI->beginIndex().distance(Indexes->getLastIndex());
Prio = LI->beginIndex().getInstrDistance(Indexes->getLastIndex());
}
else {
// Allocate global and split ranges in long->short order. Long ranges that