Skip to content

Commit

Permalink
Renumber SlotIndexes locally when a new block is inserted.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174937 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Cameron Zwarich committed Feb 12, 2013
1 parent dd58fa4 commit 1fc8893
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions include/llvm/CodeGen/SlotIndexes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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());
}

Expand Down

0 comments on commit 1fc8893

Please sign in to comment.