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 | 4c052261de0a8d4084361bdce6241f0dac3e86fa (patch) | |
| tree | 6241191c9db2f47df536a4b4c5f4d3b4bb12a0ed /llvm/lib/CodeGen/SlotIndexes.cpp | |
| parent | 2bb0765bb4b56babcaa4bd353b7aa79e59211d6a (diff) | |
| download | bcm5719-llvm-4c052261de0a8d4084361bdce6241f0dac3e86fa.tar.gz bcm5719-llvm-4c052261de0a8d4084361bdce6241f0dac3e86fa.zip | |
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.
llvm-svn: 91859
Diffstat (limited to 'llvm/lib/CodeGen/SlotIndexes.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SlotIndexes.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SlotIndexes.cpp b/llvm/lib/CodeGen/SlotIndexes.cpp index f85384bc5c7..782af124a66 100644 --- a/llvm/lib/CodeGen/SlotIndexes.cpp +++ b/llvm/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()); |

