[llvm] r174937 - Renumber SlotIndexes locally when a new block is inserted.
Cameron Zwarich
zwarich at apple.com
Mon Feb 11 19:49:22 PST 2013
Author: zwarich
Date: Mon Feb 11 21:49:22 2013
New Revision: 174937
URL: http://llvm.org/viewvc/llvm-project?rev=174937&view=rev
Log:
Renumber SlotIndexes locally when a new block is inserted.
Modified:
llvm/trunk/include/llvm/CodeGen/SlotIndexes.h
Modified: llvm/trunk/include/llvm/CodeGen/SlotIndexes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SlotIndexes.h?rev=174937&r1=174936&r2=174937&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SlotIndexes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SlotIndexes.h Mon Feb 11 21:49:22 2013
@@ -605,14 +605,15 @@ namespace llvm {
IndexListEntry *startEntry = 0;
IndexListEntry *endEntry = 0;
+ IndexList::iterator newItr;
if (nextMBB == mbb->getParent()->end()) {
startEntry = &indexList.back();
endEntry = createEntry(0, 0);
- indexList.insertAfter(startEntry, endEntry);
+ newItr = indexList.insertAfter(startEntry, endEntry);
} else {
startEntry = createEntry(0, 0);
endEntry = getMBBStartIdx(nextMBB).listEntry();
- indexList.insert(endEntry, startEntry);
+ newItr = indexList.insert(endEntry, startEntry);
}
SlotIndex startIdx(startEntry, SlotIndex::Slot_Block);
@@ -629,9 +630,7 @@ namespace llvm {
MBBRanges.push_back(std::make_pair(startIdx, endIdx));
idx2MBBMap.push_back(IdxMBBPair(startIdx, mbb));
- // FIXME: Renumber locally instead of renumbering the whole function every
- // time a new block is inserted.
- renumberIndexes();
+ renumberIndexes(newItr);
std::sort(idx2MBBMap.begin(), idx2MBBMap.end(), Idx2MBBCompare());
}
More information about the llvm-commits
mailing list