summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SplitKit.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-02-09 22:50:26 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-02-09 22:50:26 +0000
commitf0ac26c51173a9a1d6e5b5794107dccc4c5b5792 (patch)
treeeaece7499e5a684d91c552eacb98eb1b2c6adff9 /lib/CodeGen/SplitKit.h
parent025feadb973272d5c5097bb72cb2f6fef44474d3 (diff)
downloadllvm-f0ac26c51173a9a1d6e5b5794107dccc4c5b5792.tar.gz
llvm-f0ac26c51173a9a1d6e5b5794107dccc4c5b5792.tar.bz2
llvm-f0ac26c51173a9a1d6e5b5794107dccc4c5b5792.tar.xz
Move calcLiveBlockInfo() and the BlockInfo struct into SplitAnalysis.
No functional changes intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125231 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SplitKit.h')
-rw-r--r--lib/CodeGen/SplitKit.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/CodeGen/SplitKit.h b/lib/CodeGen/SplitKit.h
index 4614796e70..92945147ae 100644
--- a/lib/CodeGen/SplitKit.h
+++ b/lib/CodeGen/SplitKit.h
@@ -63,6 +63,38 @@ public:
typedef DenseMap<const MachineLoop*, unsigned> LoopCountMap;
LoopCountMap UsingLoops;
+ /// Additional information about basic blocks where the current variable is
+ /// live. Such a block will look like one of these templates:
+ ///
+ /// 1. | o---x | Internal to block. Variable is only live in this block.
+ /// 2. |---x | Live-in, kill.
+ /// 3. | o---| Def, live-out.
+ /// 4. |---x o---| Live-in, kill, def, live-out.
+ /// 5. |---o---o---| Live-through with uses or defs.
+ /// 6. |-----------| Live-through without uses. Transparent.
+ ///
+ struct BlockInfo {
+ MachineBasicBlock *MBB;
+ SlotIndex FirstUse; ///< First instr using current reg.
+ SlotIndex LastUse; ///< Last instr using current reg.
+ SlotIndex Kill; ///< Interval end point inside block.
+ SlotIndex Def; ///< Interval start point inside block.
+ /// Last possible point for splitting live ranges.
+ SlotIndex LastSplitPoint;
+ bool Uses; ///< Current reg has uses or defs in block.
+ bool LiveThrough; ///< Live in whole block (Templ 5. or 6. above).
+ bool LiveIn; ///< Current reg is live in.
+ bool LiveOut; ///< Current reg is live out.
+
+ // Per-interference pattern scratch data.
+ bool OverlapEntry; ///< Interference overlaps entering interval.
+ bool OverlapExit; ///< Interference overlaps exiting interval.
+ };
+
+ /// Basic blocks where var is live. This array is parallel to
+ /// SpillConstraints.
+ SmallVector<BlockInfo, 8> LiveBlocks;
+
private:
// Current live interval.
const LiveInterval *CurLI;
@@ -70,6 +102,9 @@ private:
// Sumarize statistics by counting instructions using CurLI.
void analyzeUses();
+ /// calcLiveBlockInfo - Compute per-block information about CurLI.
+ void calcLiveBlockInfo();
+
/// canAnalyzeBranch - Return true if MBB ends in a branch that can be
/// analyzed.
bool canAnalyzeBranch(const MachineBasicBlock *MBB);