summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SplitKit.h
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-02-03 05:40:54 +0000
committerEric Christopher <echristo@apple.com>2011-02-03 05:40:54 +0000
commit463a2977b1d9e6679f859db9f32e9e783b075c10 (patch)
tree6b00daaaaf63bed540d7899161869ffcc7230c96 /lib/CodeGen/SplitKit.h
parent254f35ca4a9bd1a12f0ea263aa7434c62056bf8b (diff)
downloadllvm-463a2977b1d9e6679f859db9f32e9e783b075c10.tar.gz
llvm-463a2977b1d9e6679f859db9f32e9e783b075c10.tar.bz2
llvm-463a2977b1d9e6679f859db9f32e9e783b075c10.tar.xz
Temporarily revert 124765 in an attempt to find the cycle breaking bootstrap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124778 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SplitKit.h')
-rw-r--r--lib/CodeGen/SplitKit.h63
1 files changed, 27 insertions, 36 deletions
diff --git a/lib/CodeGen/SplitKit.h b/lib/CodeGen/SplitKit.h
index 5e9b96b629..bb4fca9084 100644
--- a/lib/CodeGen/SplitKit.h
+++ b/lib/CodeGen/SplitKit.h
@@ -13,13 +13,11 @@
//===----------------------------------------------------------------------===//
#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/IntervalMap.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/CodeGen/SlotIndexes.h"
namespace llvm {
-class ConnectedVNInfoEqClasses;
class LiveInterval;
class LiveIntervals;
class LiveRangeEdit;
@@ -265,10 +263,6 @@ public:
/// with defValue.
bool isComplexMapped(const VNInfo *ParentVNI) const;
- /// markComplexMapped - Mark ParentVNI as complex mapped regardless of the
- /// number of definitions.
- void markComplexMapped(const VNInfo *ParentVNI) { Values[ParentVNI] = 0; }
-
// addSimpleRange - Add a simple range from ParentLI to LI.
// ParentVNI must be live in the [Start;End) interval.
void addSimpleRange(SlotIndex Start, SlotIndex End, const VNInfo *ParentVNI);
@@ -296,49 +290,49 @@ class SplitEditor {
LiveIntervals &LIS;
VirtRegMap &VRM;
MachineRegisterInfo &MRI;
- MachineDominatorTree &MDT;
const TargetInstrInfo &TII;
const TargetRegisterInfo &TRI;
/// Edit - The current parent register and new intervals created.
LiveRangeEdit &Edit;
- /// Index into Edit of the currently open interval.
- /// The index 0 is used for the complement, so the first interval started by
- /// openIntv will be 1.
- unsigned OpenIdx;
-
- typedef IntervalMap<SlotIndex, unsigned> RegAssignMap;
-
- /// Allocator for the interval map. This will eventually be shared with
- /// SlotIndexes and LiveIntervals.
- RegAssignMap::Allocator Allocator;
-
- /// RegAssign - Map of the assigned register indexes.
- /// Edit.get(RegAssign.lookup(Idx)) is the register that should be live at
- /// Idx.
- RegAssignMap RegAssign;
+ /// DupLI - Created as a copy of CurLI, ranges are carved out as new
+ /// intervals get added through openIntv / closeIntv. This is used to avoid
+ /// editing CurLI.
+ LiveIntervalMap DupLI;
- /// LIMappers - One LiveIntervalMap or each interval in Edit.
- SmallVector<LiveIntervalMap, 4> LIMappers;
+ /// Currently open LiveInterval.
+ LiveIntervalMap OpenLI;
/// defFromParent - Define Reg from ParentVNI at UseIdx using either
/// rematerialization or a COPY from parent. Return the new value.
- VNInfo *defFromParent(unsigned RegIdx,
+ VNInfo *defFromParent(LiveIntervalMap &Reg,
VNInfo *ParentVNI,
SlotIndex UseIdx,
MachineBasicBlock &MBB,
MachineBasicBlock::iterator I);
- /// rewriteAssigned - Rewrite all uses of Edit.getReg() to assigned registers.
- void rewriteAssigned();
+ /// intervalsLiveAt - Return true if any member of intervals_ is live at Idx.
+ bool intervalsLiveAt(SlotIndex Idx) const;
- /// rewriteComponents - Rewrite all uses of Intv[0] according to the eq
- /// classes in ConEQ.
- /// This must be done when Intvs[0] is styill live at all uses, before calling
- /// ConEq.Distribute().
- void rewriteComponents(const SmallVectorImpl<LiveInterval*> &Intvs,
- const ConnectedVNInfoEqClasses &ConEq);
+ /// Values in CurLI whose live range has been truncated when entering an open
+ /// li.
+ SmallPtrSet<const VNInfo*, 8> truncatedValues;
+
+ /// addTruncSimpleRange - Add the given simple range to DupLI after
+ /// truncating any overlap with intervals_.
+ void addTruncSimpleRange(SlotIndex Start, SlotIndex End, VNInfo *VNI);
+
+ /// criticalPreds_ - Set of basic blocks where both dupli and OpenLI should be
+ /// live out because of a critical edge.
+ SplitAnalysis::BlockPtrSet criticalPreds_;
+
+ /// computeRemainder - Compute the dupli liveness as the complement of all the
+ /// new intervals.
+ void computeRemainder();
+
+ /// rewrite - Rewrite all uses of reg to use the new registers.
+ void rewrite(unsigned reg);
public:
/// Create a new SplitEditor for editing the LiveInterval analyzed by SA.
@@ -380,9 +374,6 @@ public:
/// remaining live range, and rewrite instructions to use the new registers.
void finish();
- /// dump - print the current interval maping to dbgs().
- void dump() const;
-
// ===--- High level methods ---===
/// splitAroundLoop - Split CurLI into a separate live interval inside