summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SplitKit.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-09-16 00:01:36 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-09-16 00:01:36 +0000
commitf6a129a24b866635c3c51edf08749755f952b5f2 (patch)
treee97b0b62ab07b1486920dc1299459968246b36c7 /lib/CodeGen/SplitKit.h
parent7e7d01de9c85af70dd4058358f8eb36d82c3e49f (diff)
downloadllvm-f6a129a24b866635c3c51edf08749755f952b5f2.tar.gz
llvm-f6a129a24b866635c3c51edf08749755f952b5f2.tar.bz2
llvm-f6a129a24b866635c3c51edf08749755f952b5f2.tar.xz
Use the value mapping provided by LiveIntervalMap. This simplifies the code a
great deal because we don't have to worry about maintaining SSA form. Unconditionally copy back to dupli when the register is live out of the split range, even if the live-out value was defined outside the range. Skipping the back-copy only makes sense when the live range is going to spill outside the split range, and we don't know that it will. Besides, this was a hack to avoid SSA update issues. Clear up some confusion about the end point of a half-open LiveRange. Methinks LiveRanges need to be closed so both start and end are included in the range. The low bits of a SlotIndex are symbolic, so a half-open range doesn't really make sense. This would be a pervasive change, though. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114043 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SplitKit.h')
-rw-r--r--lib/CodeGen/SplitKit.h32
1 files changed, 12 insertions, 20 deletions
diff --git a/lib/CodeGen/SplitKit.h b/lib/CodeGen/SplitKit.h
index 6e534546f1..8487c23b26 100644
--- a/lib/CodeGen/SplitKit.h
+++ b/lib/CodeGen/SplitKit.h
@@ -162,8 +162,8 @@ class LiveIntervalMap {
ValueMap valueMap_;
// extendTo - Find the last li_ value defined in MBB at or before Idx. The
- // parentli_ is assumed to be live at Idx. Extend the live range to Idx.
- // Return the found VNInfo, or NULL.
+ // parentli is assumed to be live at Idx. Extend the live range to include
+ // Idx. Return the found VNInfo, or NULL.
VNInfo *extendTo(MachineBasicBlock *MBB, SlotIndex Idx);
// addSimpleRange - Add a simple range from parentli_ to li_.
@@ -200,6 +200,14 @@ public:
/// All needed values whose def is not inside [Start;End) must be defined
/// beforehand so mapValue will work.
void addRange(SlotIndex Start, SlotIndex End);
+
+ /// defByCopyFrom - Insert a copy from Reg to li, assuming that Reg carries
+ /// ParentVNI. Add a minimal live range for the new value and return it.
+ VNInfo *defByCopyFrom(unsigned Reg,
+ const VNInfo *ParentVNI,
+ MachineBasicBlock &MBB,
+ MachineBasicBlock::iterator I);
+
};
@@ -236,20 +244,6 @@ class SplitEditor {
/// register class and spill slot as curli.
LiveInterval *createInterval();
- /// getDupLI - Ensure dupli is created and return it.
- LiveInterval *getDupLI();
-
- /// valueMap_ - Map values in cupli to values in openli. These are direct 1-1
- /// mappings, and do not include values created by inserted copies.
- DenseMap<const VNInfo*, VNInfo*> valueMap_;
-
- /// mapValue - Return the openIntv value that corresponds to the given curli
- /// value.
- VNInfo *mapValue(const VNInfo *curliVNI);
-
- /// A dupli value is live through openIntv.
- bool liveThrough_;
-
/// All the new intervals created for this split are added to intervals_.
SmallVectorImpl<LiveInterval*> &intervals_;
@@ -259,7 +253,7 @@ class SplitEditor {
/// Insert a COPY instruction curli -> li. Allocate a new value from li
/// defined by the COPY
- VNInfo *insertCopy(LiveInterval &LI,
+ VNInfo *insertCopy(LiveIntervalMap &LI,
MachineBasicBlock &MBB,
MachineBasicBlock::iterator I);
@@ -280,9 +274,7 @@ public:
void enterIntvBefore(SlotIndex Idx);
/// enterIntvAtEnd - Enter openli at the end of MBB.
- /// PhiMBB is a successor inside openli where a PHI value is created.
- /// Currently, all entries must share the same PhiMBB.
- void enterIntvAtEnd(MachineBasicBlock &MBB, MachineBasicBlock &PhiMBB);
+ void enterIntvAtEnd(MachineBasicBlock &MBB);
/// useIntv - indicate that all instructions in MBB should use openli.
void useIntv(const MachineBasicBlock &MBB);