summaryrefslogtreecommitdiff
path: root/lib/CodeGen/LiveRangeCalc.h
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2013-10-10 21:28:57 +0000
committerMatthias Braun <matze@braunis.de>2013-10-10 21:28:57 +0000
commite25dde550baec1f79caf2fc06edd74e7ae6ffa33 (patch)
tree9c324f3382e66b6c1950faa4cd181700ec01f3c9 /lib/CodeGen/LiveRangeCalc.h
parenta4aed9ae392b30147745bd27e5fea7b0cebc1702 (diff)
downloadllvm-e25dde550baec1f79caf2fc06edd74e7ae6ffa33.tar.gz
llvm-e25dde550baec1f79caf2fc06edd74e7ae6ffa33.tar.bz2
llvm-e25dde550baec1f79caf2fc06edd74e7ae6ffa33.tar.xz
Work on LiveRange instead of LiveInterval where possible
Also change some pointer arguments to references at some places where 0-pointers are not allowed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192396 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveRangeCalc.h')
-rw-r--r--lib/CodeGen/LiveRangeCalc.h32
1 files changed, 15 insertions, 17 deletions
diff --git a/lib/CodeGen/LiveRangeCalc.h b/lib/CodeGen/LiveRangeCalc.h
index 69c7f765e6..36d3a08964 100644
--- a/lib/CodeGen/LiveRangeCalc.h
+++ b/lib/CodeGen/LiveRangeCalc.h
@@ -75,9 +75,9 @@ class LiveRangeCalc {
/// LiveInBlock - Information about a basic block where a live range is known
/// to be live-in, but the value has not yet been determined.
struct LiveInBlock {
- // LI - The live range that is live-in to this block. The algorithms can
+ // The live range set that is live-in to this block. The algorithms can
// handle multiple non-overlapping live ranges simultaneously.
- LiveInterval *LI;
+ LiveRange &LR;
// DomNode - Dominator tree node for the block.
// Cleared when the final value has been determined and LI has been updated.
@@ -91,8 +91,8 @@ class LiveRangeCalc {
// Live-in value filled in by updateSSA once it is known.
VNInfo *Value;
- LiveInBlock(LiveInterval *li, MachineDomTreeNode *node, SlotIndex kill)
- : LI(li), DomNode(node), Kill(kill), Value(0) {}
+ LiveInBlock(LiveRange &LR, MachineDomTreeNode *node, SlotIndex kill)
+ : LR(LR), DomNode(node), Kill(kill), Value(0) {}
};
/// LiveIn - Work list of blocks where the live-in value has yet to be
@@ -111,10 +111,8 @@ class LiveRangeCalc {
/// are added to the LiveIn array, and the function returns false.
///
/// PhysReg, when set, is used to verify live-in lists on basic blocks.
- bool findReachingDefs(LiveInterval *LI,
- MachineBasicBlock *KillMBB,
- SlotIndex Kill,
- unsigned PhysReg);
+ bool findReachingDefs(LiveRange &LR, MachineBasicBlock &KillMBB,
+ SlotIndex Kill, unsigned PhysReg);
/// updateSSA - Compute the values that will be live in to all requested
/// blocks in LiveIn. Create PHI-def values as required to preserve SSA form.
@@ -161,27 +159,27 @@ public:
/// single existing value, Alloc may be null.
///
/// PhysReg, when set, is used to verify live-in lists on basic blocks.
- void extend(LiveInterval *LI, SlotIndex Kill, unsigned PhysReg = 0);
+ void extend(LiveRange &LR, SlotIndex Kill, unsigned PhysReg = 0);
/// createDeadDefs - Create a dead def in LI for every def operand of Reg.
/// Each instruction defining Reg gets a new VNInfo with a corresponding
/// minimal live range.
- void createDeadDefs(LiveInterval *LI, unsigned Reg);
+ void createDeadDefs(LiveRange &LR, unsigned Reg);
/// createDeadDefs - Create a dead def in LI for every def of LI->reg.
- void createDeadDefs(LiveInterval *LI) {
- createDeadDefs(LI, LI->reg);
+ void createDeadDefs(LiveInterval &LI) {
+ createDeadDefs(LI, LI.reg);
}
/// extendToUses - Extend the live range of LI to reach all uses of Reg.
///
/// All uses must be jointly dominated by existing liveness. PHI-defs are
/// inserted as needed to preserve SSA form.
- void extendToUses(LiveInterval *LI, unsigned Reg);
+ void extendToUses(LiveRange &LR, unsigned Reg);
/// extendToUses - Extend the live range of LI to reach all uses of LI->reg.
- void extendToUses(LiveInterval *LI) {
- extendToUses(LI, LI->reg);
+ void extendToUses(LiveInterval &LI) {
+ extendToUses(LI, LI.reg);
}
//===--------------------------------------------------------------------===//
@@ -217,10 +215,10 @@ public:
/// @param Kill Index in block where LI is killed. If the value is
/// live-through, set Kill = SLotIndex() and also call
/// setLiveOutValue(MBB, 0).
- void addLiveInBlock(LiveInterval *LI,
+ void addLiveInBlock(LiveRange &LR,
MachineDomTreeNode *DomNode,
SlotIndex Kill = SlotIndex()) {
- LiveIn.push_back(LiveInBlock(LI, DomNode, Kill));
+ LiveIn.push_back(LiveInBlock(LR, DomNode, Kill));
}
/// calculateValues - Calculate the value that will be live-in to each block