diff options
| author | Cameron Zwarich <zwarich@apple.com> | 2013-02-10 23:29:54 +0000 |
|---|---|---|
| committer | Cameron Zwarich <zwarich@apple.com> | 2013-02-10 23:29:54 +0000 |
| commit | f5844a75154e73a2302767eeecf3b3401e157bb3 (patch) | |
| tree | ae9395fdac0d1da6af975c027fae1e6b18d19d3e /include/llvm/CodeGen | |
| parent | 36f54480f83d47404aceea5d41f8f6b95da2d00b (diff) | |
Fix the unused but nearly correct method SlotIndexes::insertMBBInMaps() and add
support for updating SlotIndexes to MachineBasicBlock::SplitCriticalEdge(). This
calls renumberIndexes() every time; it should be improved to only renumber
locally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174851 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
| -rw-r--r-- | include/llvm/CodeGen/SlotIndexes.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/include/llvm/CodeGen/SlotIndexes.h b/include/llvm/CodeGen/SlotIndexes.h index b46d153867..690bee66c0 100644 --- a/include/llvm/CodeGen/SlotIndexes.h +++ b/include/llvm/CodeGen/SlotIndexes.h @@ -602,21 +602,21 @@ namespace llvm { void insertMBBInMaps(MachineBasicBlock *mbb) { MachineFunction::iterator nextMBB = llvm::next(MachineFunction::iterator(mbb)); - IndexListEntry *startEntry = createEntry(0, 0); - IndexListEntry *stopEntry = createEntry(0, 0); - IndexListEntry *nextEntry = 0; - if (nextMBB == mbb->getParent()->end()) { - nextEntry = indexList.end(); - } else { + IndexListEntry *nextEntry = 0; + if (nextMBB == mbb->getParent()->end()) + nextEntry = &indexList.back(); + else nextEntry = getMBBStartIdx(nextMBB).listEntry(); - } - indexList.insert(nextEntry, startEntry); - indexList.insert(nextEntry, stopEntry); + IndexListEntry *startEntry = createEntry(0, 0); + IndexListEntry *stopEntry = createEntry(0, 0); + + indexList.insertAfter(nextEntry, startEntry); + indexList.insertAfter(startEntry, stopEntry); SlotIndex startIdx(startEntry, SlotIndex::Slot_Block); - SlotIndex endIdx(nextEntry, SlotIndex::Slot_Block); + SlotIndex endIdx(stopEntry, SlotIndex::Slot_Block); assert(unsigned(mbb->getNumber()) == MBBRanges.size() && "Blocks must be added in order"); @@ -624,6 +624,8 @@ namespace llvm { idx2MBBMap.push_back(IdxMBBPair(startIdx, mbb)); + // FIXME: Renumber locally instead of renumbering the whole function every + // time a new block is inserted. renumberIndexes(); std::sort(idx2MBBMap.begin(), idx2MBBMap.end(), Idx2MBBCompare()); } |
