diff options
| author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-11-11 00:19:20 +0000 |
|---|---|---|
| committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-11-11 00:19:20 +0000 |
| commit | c400670bf1f7fce0ef09aa649c6d7863cf39fea6 (patch) | |
| tree | 5f19b39cbcc88a6408dce205ba2b0cc6fd9c9b58 /llvm | |
| parent | fd0ad36c28065c4e069e4fa6f7c9e6e55bc4051b (diff) | |
| download | bcm5719-llvm-c400670bf1f7fce0ef09aa649c6d7863cf39fea6.tar.gz bcm5719-llvm-c400670bf1f7fce0ef09aa649c6d7863cf39fea6.zip | |
Insert two blank SlotIndexes between basic blocks instead of just one.
This is the first small step towards using closed intervals for liveness instead
of the half-open intervals we're using now.
We want to be able to distinguish between a SlotIndex that represents a variable
being live-out of a basic block, and an index representing a variable live-in to
its successor.
That requires two separate indexes between blocks. One for live-outs and one for
live-ins.
With this change, getMBBEndIdx(MBB).getPrevSlot() becomes stable so it stays
greater than any instructions inserted at the end of MBB.
llvm-svn: 118747
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/CodeGen/SlotIndexes.h | 2 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SlotIndexes.cpp | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/llvm/include/llvm/CodeGen/SlotIndexes.h b/llvm/include/llvm/CodeGen/SlotIndexes.h index d207923099f..c8f26544f0d 100644 --- a/llvm/include/llvm/CodeGen/SlotIndexes.h +++ b/llvm/include/llvm/CodeGen/SlotIndexes.h @@ -738,6 +738,7 @@ namespace llvm { 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()) { @@ -747,6 +748,7 @@ namespace llvm { } insert(nextEntry, startEntry); + insert(nextEntry, stopEntry); SlotIndex startIdx(startEntry, SlotIndex::LOAD); SlotIndex endIdx(nextEntry, SlotIndex::LOAD); diff --git a/llvm/lib/CodeGen/SlotIndexes.cpp b/llvm/lib/CodeGen/SlotIndexes.cpp index adab9ff3a5a..277cce3db88 100644 --- a/llvm/lib/CodeGen/SlotIndexes.cpp +++ b/llvm/lib/CodeGen/SlotIndexes.cpp @@ -127,8 +127,12 @@ bool SlotIndexes::runOnMachineFunction(MachineFunction &fn) { index += (Slots + 1) * SlotIndex::NUM; } - // One blank instruction at the end. - push_back(createEntry(0, index)); + // We insert two blank instructions between basic blocks. + // One to represent live-out registers and one to represent live-ins. + push_back(createEntry(0, index)); + index += SlotIndex::NUM; + + push_back(createEntry(0, index)); SlotIndex blockEndIndex(back(), SlotIndex::LOAD); mbb2IdxMap.insert( |

