Mercurial > hg > CbC > CbC_llvm
comparison lib/CodeGen/LiveRangeCalc.h @ 77:54457678186b LLVM3.6
LLVM 3.6
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 08 Sep 2014 22:06:00 +0900 |
parents | 95c75e76d11b |
children | 60c9769439b8 |
comparison
equal
deleted
inserted
replaced
34:e874dbf0ad9d | 77:54457678186b |
---|---|
17 // propagate values down the dominator tree, and even insert PHI-defs where | 17 // propagate values down the dominator tree, and even insert PHI-defs where |
18 // needed. SplitKit uses this faster interface when possible. | 18 // needed. SplitKit uses this faster interface when possible. |
19 // | 19 // |
20 //===----------------------------------------------------------------------===// | 20 //===----------------------------------------------------------------------===// |
21 | 21 |
22 #ifndef LLVM_CODEGEN_LIVERANGECALC_H | 22 #ifndef LLVM_LIB_CODEGEN_LIVERANGECALC_H |
23 #define LLVM_CODEGEN_LIVERANGECALC_H | 23 #define LLVM_LIB_CODEGEN_LIVERANGECALC_H |
24 | 24 |
25 #include "llvm/ADT/BitVector.h" | 25 #include "llvm/ADT/BitVector.h" |
26 #include "llvm/ADT/IndexedMap.h" | 26 #include "llvm/ADT/IndexedMap.h" |
27 #include "llvm/CodeGen/LiveInterval.h" | 27 #include "llvm/CodeGen/LiveInterval.h" |
28 | 28 |
90 | 90 |
91 // Live-in value filled in by updateSSA once it is known. | 91 // Live-in value filled in by updateSSA once it is known. |
92 VNInfo *Value; | 92 VNInfo *Value; |
93 | 93 |
94 LiveInBlock(LiveRange &LR, MachineDomTreeNode *node, SlotIndex kill) | 94 LiveInBlock(LiveRange &LR, MachineDomTreeNode *node, SlotIndex kill) |
95 : LR(LR), DomNode(node), Kill(kill), Value(0) {} | 95 : LR(LR), DomNode(node), Kill(kill), Value(nullptr) {} |
96 }; | 96 }; |
97 | 97 |
98 /// LiveIn - Work list of blocks where the live-in value has yet to be | 98 /// LiveIn - Work list of blocks where the live-in value has yet to be |
99 /// determined. This list is typically computed by findReachingDefs() and | 99 /// determined. This list is typically computed by findReachingDefs() and |
100 /// used as a work list by updateSSA(). The low-level interface may also be | 100 /// used as a work list by updateSSA(). The low-level interface may also be |
123 | 123 |
124 /// Add liveness as specified in the LiveIn vector. | 124 /// Add liveness as specified in the LiveIn vector. |
125 void updateLiveIns(); | 125 void updateLiveIns(); |
126 | 126 |
127 public: | 127 public: |
128 LiveRangeCalc() : MF(0), MRI(0), Indexes(0), DomTree(0), Alloc(0) {} | 128 LiveRangeCalc() : MF(nullptr), MRI(nullptr), Indexes(nullptr), |
129 DomTree(nullptr), Alloc(nullptr) {} | |
129 | 130 |
130 //===--------------------------------------------------------------------===// | 131 //===--------------------------------------------------------------------===// |
131 // High-level interface. | 132 // High-level interface. |
132 //===--------------------------------------------------------------------===// | 133 //===--------------------------------------------------------------------===// |
133 // | 134 // |
201 /// | 202 /// |
202 /// VNI may be null only if MBB is a live-through block also passed to | 203 /// VNI may be null only if MBB is a live-through block also passed to |
203 /// addLiveInBlock(). | 204 /// addLiveInBlock(). |
204 void setLiveOutValue(MachineBasicBlock *MBB, VNInfo *VNI) { | 205 void setLiveOutValue(MachineBasicBlock *MBB, VNInfo *VNI) { |
205 Seen.set(MBB->getNumber()); | 206 Seen.set(MBB->getNumber()); |
206 LiveOut[MBB] = LiveOutPair(VNI, (MachineDomTreeNode *)0); | 207 LiveOut[MBB] = LiveOutPair(VNI, nullptr); |
207 } | 208 } |
208 | 209 |
209 /// addLiveInBlock - Add a block with an unknown live-in value. This | 210 /// addLiveInBlock - Add a block with an unknown live-in value. This |
210 /// function can only be called once per basic block. Once the live-in value | 211 /// function can only be called once per basic block. Once the live-in value |
211 /// has been determined, calculateValues() will add liveness to LI. | 212 /// has been determined, calculateValues() will add liveness to LI. |