summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SlotIndexes.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-03-03 06:29:01 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-03-03 06:29:01 +0000
commit2c11eb333c37edd5b15c1d05394861fdfc0eab90 (patch)
tree4d9f44700f973495572e846157352d6482fe5c72 /lib/CodeGen/SlotIndexes.cpp
parentf37712f48642bcca04c77083c0579e7fe8d4d916 (diff)
downloadllvm-2c11eb333c37edd5b15c1d05394861fdfc0eab90.tar.gz
llvm-2c11eb333c37edd5b15c1d05394861fdfc0eab90.tar.bz2
llvm-2c11eb333c37edd5b15c1d05394861fdfc0eab90.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126926 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SlotIndexes.cpp')
-rw-r--r--lib/CodeGen/SlotIndexes.cpp16
1 files changed, 1 insertions, 15 deletions
diff --git a/lib/CodeGen/SlotIndexes.cpp b/lib/CodeGen/SlotIndexes.cpp
index f18854be85..73adb92101 100644
--- a/lib/CodeGen/SlotIndexes.cpp
+++ b/lib/CodeGen/SlotIndexes.cpp
@@ -129,26 +129,12 @@ void SlotIndexes::renumberIndexes() {
// had been present.
DEBUG(dbgs() << "\n*** Renumbering SlotIndexes ***\n");
- functionSize = 0;
unsigned index = 0;
for (IndexListEntry *curEntry = front(); curEntry != getTail();
curEntry = curEntry->getNext()) {
-
curEntry->setIndex(index);
-
- 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;
- }
+ index += 4*SlotIndex::NUM;
}
}