forked from OSchip/llvm-project
Renumber slot indexes uniformly instead of spacing according to the number of defs.
There are probably much larger speedups to be had by renumbering locally instead of looping over the whole function. For now, the greedy register allocator is 25% faster. llvm-svn: 126926
This commit is contained in:
parent
4ec757d588
commit
bfdbc11554
|
@ -129,26 +129,12 @@ void SlotIndexes::renumberIndexes() {
|
||||||
// had been present.
|
// had been present.
|
||||||
DEBUG(dbgs() << "\n*** Renumbering SlotIndexes ***\n");
|
DEBUG(dbgs() << "\n*** Renumbering SlotIndexes ***\n");
|
||||||
|
|
||||||
functionSize = 0;
|
|
||||||
unsigned index = 0;
|
unsigned index = 0;
|
||||||
|
|
||||||
for (IndexListEntry *curEntry = front(); curEntry != getTail();
|
for (IndexListEntry *curEntry = front(); curEntry != getTail();
|
||||||
curEntry = curEntry->getNext()) {
|
curEntry = curEntry->getNext()) {
|
||||||
|
|
||||||
curEntry->setIndex(index);
|
curEntry->setIndex(index);
|
||||||
|
index += 4*SlotIndex::NUM;
|
||||||
if (curEntry->getInstr() == 0) {
|
|
||||||
// MBB start entry. Just step index by 1.
|
|
||||||
index += SlotIndex::NUM;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
++functionSize;
|
|
||||||
unsigned Slots = curEntry->getInstr()->getDesc().getNumDefs();
|
|
||||||
if (Slots == 0)
|
|
||||||
Slots = 1;
|
|
||||||
|
|
||||||
index += (Slots + 1) * SlotIndex::NUM;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue