diff options
author | Lang Hames <lhames@gmail.com> | 2009-12-22 00:11:50 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2009-12-22 00:11:50 +0000 |
commit | 74ab5eeffbd70f2387338e3ee8195be9f73e6dd8 (patch) | |
tree | 69244a4a36283b0db2934bf3526a92ff6a44b9ae /lib/CodeGen/SlotIndexes.cpp | |
parent | 87710f04e551655c0c98fb7c0bfd9ec58224a804 (diff) | |
download | llvm-74ab5eeffbd70f2387338e3ee8195be9f73e6dd8.tar.gz llvm-74ab5eeffbd70f2387338e3ee8195be9f73e6dd8.tar.bz2 llvm-74ab5eeffbd70f2387338e3ee8195be9f73e6dd8.tar.xz |
Changed slot index ranges for MachineBasicBlocks to be exclusive of endpoint.
This fixes an in-place update bug where code inserted at the end of basic blocks may not be covered by existing intervals which were live across the entire block. It is also consistent with the way ranges are specified for live intervals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91859 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SlotIndexes.cpp')
-rw-r--r-- | lib/CodeGen/SlotIndexes.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/CodeGen/SlotIndexes.cpp b/lib/CodeGen/SlotIndexes.cpp index f85384bc5c..782af124a6 100644 --- a/lib/CodeGen/SlotIndexes.cpp +++ b/lib/CodeGen/SlotIndexes.cpp @@ -92,13 +92,14 @@ bool SlotIndexes::runOnMachineFunction(MachineFunction &fn) { functionSize = 0; unsigned index = 0; + push_back(createEntry(0, index)); + // Iterate over the the function. for (MachineFunction::iterator mbbItr = mf->begin(), mbbEnd = mf->end(); mbbItr != mbbEnd; ++mbbItr) { MachineBasicBlock *mbb = &*mbbItr; // Insert an index for the MBB start. - push_back(createEntry(0, index)); SlotIndex blockStartIndex(back(), SlotIndex::LOAD); index += SlotIndex::NUM; @@ -137,16 +138,16 @@ bool SlotIndexes::runOnMachineFunction(MachineFunction &fn) { index += SlotIndex::NUM; } - SlotIndex blockEndIndex(back(), SlotIndex::STORE); + // One blank instruction at the end. + push_back(createEntry(0, index)); + + SlotIndex blockEndIndex(back(), SlotIndex::LOAD); mbb2IdxMap.insert( std::make_pair(mbb, std::make_pair(blockStartIndex, blockEndIndex))); idx2MBBMap.push_back(IdxMBBPair(blockStartIndex, mbb)); } - // One blank instruction at the end. - push_back(createEntry(0, index)); - // Sort the Idx2MBBMap std::sort(idx2MBBMap.begin(), idx2MBBMap.end(), Idx2MBBCompare()); |