diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-04-12 18:11:31 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-04-12 18:11:31 +0000 |
commit | 0840f50b7652558f33fea38948592cf15857574a (patch) | |
tree | bfbaf82a8193c42a6fbbc9f5fe6bf10bd8cdcb83 /llvm/lib/CodeGen/SplitKit.cpp | |
parent | 68e84581c5155b238b455bea62314d92650e3787 (diff) | |
download | llvm-0840f50b7652558f33fea38948592cf15857574a.zip llvm-0840f50b7652558f33fea38948592cf15857574a.tar.gz llvm-0840f50b7652558f33fea38948592cf15857574a.tar.bz2 |
Add SplitKit API to query and select the current interval being worked on.
This makes it possible to target multiple registers in one pass.
llvm-svn: 129374
Diffstat (limited to 'llvm/lib/CodeGen/SplitKit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SplitKit.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SplitKit.cpp b/llvm/lib/CodeGen/SplitKit.cpp index 6195ab0..f85d5d3 100644 --- a/llvm/lib/CodeGen/SplitKit.cpp +++ b/llvm/lib/CodeGen/SplitKit.cpp @@ -557,7 +557,7 @@ VNInfo *SplitEditor::defFromParent(unsigned RegIdx, } /// Create a new virtual register and live interval. -void SplitEditor::openIntv() { +unsigned SplitEditor::openIntv() { assert(!OpenIdx && "Previous LI not closed before openIntv"); // Create the complement as index 0. @@ -567,6 +567,13 @@ void SplitEditor::openIntv() { // Create the open interval. OpenIdx = Edit->size(); Edit->create(LIS, VRM); + return OpenIdx; +} + +void SplitEditor::selectIntv(unsigned Idx) { + assert(Idx != 0 && "Cannot select the complement interval"); + assert(Idx < Edit->size() && "Can only select previously opened interval"); + OpenIdx = Idx; } SlotIndex SplitEditor::enterIntvBefore(SlotIndex Idx) { |