aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SplitKit.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-04-12 18:11:31 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-04-12 18:11:31 +0000
commite1b43c3b4000ee7201fcac8d1c8e75bb9fb547e3 (patch)
treeca7bf450637f420c8732e308cb06e4516c18e8c1 /lib/CodeGen/SplitKit.cpp
parentdfaf0e2c0ef01a6f6fd31f2e099ab63c5a7f7cc0 (diff)
Add SplitKit API to query and select the current interval being worked on.
This makes it possible to target multiple registers in one pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129374 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SplitKit.cpp')
-rw-r--r--lib/CodeGen/SplitKit.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/CodeGen/SplitKit.cpp b/lib/CodeGen/SplitKit.cpp
index 6195ab0f20..f85d5d358a 100644
--- a/lib/CodeGen/SplitKit.cpp
+++ b/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) {