Create a new LiveRangeEdit class to keep track of the new registers created when
splitting or spillling, and to help with rematerialization.
Use LiveRangeEdit in InlineSpiller and SplitKit. This will eventually make it
possible to share remat code between InlineSpiller and SplitKit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116543 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/SplitKit.h b/lib/CodeGen/SplitKit.h
index dff3765..005ceda 100644
--- a/lib/CodeGen/SplitKit.h
+++ b/lib/CodeGen/SplitKit.h
@@ -20,6 +20,7 @@
class LiveInterval;
class LiveIntervals;
+class LiveRangeEdit;
class MachineInstr;
class MachineLoop;
class MachineLoopInfo;
@@ -238,6 +239,9 @@
MachineRegisterInfo &mri_;
const TargetInstrInfo &tii_;
+ /// edit_ - The current parent register and new intervals created.
+ LiveRangeEdit &edit_;
+
/// curli_ - The immutable interval we are currently splitting.
const LiveInterval *const curli_;
@@ -249,17 +253,6 @@
/// Currently open LiveInterval.
LiveIntervalMap openli_;
- /// createInterval - Create a new virtual register and LiveInterval with same
- /// register class and spill slot as curli.
- LiveInterval *createInterval();
-
- /// All the new intervals created for this split are added to intervals_.
- SmallVectorImpl<LiveInterval*> &intervals_;
-
- /// The index into intervals_ of the first interval we added. There may be
- /// others from before we got it.
- unsigned firstInterval;
-
/// intervalsLiveAt - Return true if any member of intervals_ is live at Idx.
bool intervalsLiveAt(SlotIndex Idx) const;
@@ -281,8 +274,7 @@
public:
/// Create a new SplitEditor for editing the LiveInterval analyzed by SA.
/// Newly created intervals will be appended to newIntervals.
- SplitEditor(SplitAnalysis &SA, LiveIntervals&, VirtRegMap&,
- SmallVectorImpl<LiveInterval*> &newIntervals);
+ SplitEditor(SplitAnalysis &SA, LiveIntervals&, VirtRegMap&, LiveRangeEdit&);
/// getAnalysis - Get the corresponding analysis.
SplitAnalysis &getAnalysis() { return sa_; }