From 1803b37bad85cca19a15c0040979719240f48626 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Fri, 24 Sep 2010 23:58:56 +0000 Subject: [PATCH] Terminator gaps were unused. Might as well delete them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114776 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/LiveIntervalAnalysis.h | 4 ---- include/llvm/CodeGen/SlotIndexes.h | 17 ----------------- lib/CodeGen/SlotIndexes.cpp | 17 +---------------- 3 files changed, 1 insertion(+), 37 deletions(-) diff --git a/include/llvm/CodeGen/LiveIntervalAnalysis.h b/include/llvm/CodeGen/LiveIntervalAnalysis.h index 2918c3c2abe..2075fe1d57c 100644 --- a/include/llvm/CodeGen/LiveIntervalAnalysis.h +++ b/include/llvm/CodeGen/LiveIntervalAnalysis.h @@ -227,10 +227,6 @@ namespace llvm { return indexes_->getMBBFromIndex(index); } - SlotIndex getMBBTerminatorGap(const MachineBasicBlock *mbb) { - return indexes_->getTerminatorGap(mbb); - } - SlotIndex InsertMachineInstrInMaps(MachineInstr *MI) { return indexes_->insertMachineInstrInMaps(MI); } diff --git a/include/llvm/CodeGen/SlotIndexes.h b/include/llvm/CodeGen/SlotIndexes.h index 88044c7242c..e069f896aee 100644 --- a/include/llvm/CodeGen/SlotIndexes.h +++ b/include/llvm/CodeGen/SlotIndexes.h @@ -405,9 +405,6 @@ namespace llvm { /// and MBB id. std::vector idx2MBBMap; - typedef DenseMap TerminatorGapsMap; - TerminatorGapsMap terminatorGaps; - // IndexListEntry allocator. BumpPtrAllocator ileAllocator; @@ -579,14 +576,6 @@ namespace llvm { return itr->second.second; } - /// Returns the terminator gap for the given index. - SlotIndex getTerminatorGap(const MachineBasicBlock *mbb) { - TerminatorGapsMap::iterator itr = terminatorGaps.find(mbb); - assert(itr != terminatorGaps.end() && - "All MBBs should have terminator gaps in their indexes."); - return itr->second; - } - /// Returns the basic block which the given index falls in. MachineBasicBlock* getMBBFromIndex(SlotIndex index) const { std::vector::const_iterator I = @@ -789,7 +778,6 @@ namespace llvm { MachineFunction::iterator nextMBB = llvm::next(MachineFunction::iterator(mbb)); IndexListEntry *startEntry = createEntry(0, 0); - IndexListEntry *terminatorEntry = createEntry(0, 0); IndexListEntry *nextEntry = 0; if (nextMBB == mbb->getParent()->end()) { @@ -799,15 +787,10 @@ namespace llvm { } insert(nextEntry, startEntry); - insert(nextEntry, terminatorEntry); SlotIndex startIdx(startEntry, SlotIndex::LOAD); - SlotIndex terminatorIdx(terminatorEntry, SlotIndex::PHI_BIT); SlotIndex endIdx(nextEntry, SlotIndex::LOAD); - terminatorGaps.insert( - std::make_pair(mbb, terminatorIdx)); - mbb2IdxMap.insert( std::make_pair(mbb, std::make_pair(startIdx, endIdx))); diff --git a/lib/CodeGen/SlotIndexes.cpp b/lib/CodeGen/SlotIndexes.cpp index 1bc148f160b..4d362d55a4c 100644 --- a/lib/CodeGen/SlotIndexes.cpp +++ b/lib/CodeGen/SlotIndexes.cpp @@ -61,7 +61,6 @@ void SlotIndexes::releaseMemory() { mi2iMap.clear(); mbb2IdxMap.clear(); idx2MBBMap.clear(); - terminatorGaps.clear(); clearList(); } @@ -112,13 +111,6 @@ bool SlotIndexes::runOnMachineFunction(MachineFunction &fn) { if (mi->isDebugValue()) continue; - if (miItr == mbb->getFirstTerminator()) { - push_back(createEntry(0, index)); - terminatorGaps.insert( - std::make_pair(mbb, SlotIndex(back(), SlotIndex::PHI_BIT))); - index += SlotIndex::NUM; - } - // Insert a store index for the instr. push_back(createEntry(mi, index)); @@ -135,13 +127,6 @@ bool SlotIndexes::runOnMachineFunction(MachineFunction &fn) { index += (Slots + 1) * SlotIndex::NUM; } - if (mbb->getFirstTerminator() == mbb->end()) { - push_back(createEntry(0, index)); - terminatorGaps.insert( - std::make_pair(mbb, SlotIndex(back(), SlotIndex::PHI_BIT))); - index += SlotIndex::NUM; - } - // One blank instruction at the end. push_back(createEntry(0, index)); @@ -179,7 +164,7 @@ void SlotIndexes::renumberIndexes() { curEntry->setIndex(index); if (curEntry->getInstr() == 0) { - // MBB start entry or terminator gap. Just step index by 1. + // MBB start entry. Just step index by 1. index += SlotIndex::NUM; } else {