OLD | NEW |
1 //===- subzero/src/IceCfgNode.cpp - Basic block (node) implementation -----===// | 1 //===- subzero/src/IceCfgNode.cpp - Basic block (node) implementation -----===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file implements the CfgNode class, including the complexities | 10 // This file implements the CfgNode class, including the complexities |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 // incoming liveness changed from before, false if it stayed the same. | 228 // incoming liveness changed from before, false if it stayed the same. |
229 // (If it changes, the node's predecessors need to be processed | 229 // (If it changes, the node's predecessors need to be processed |
230 // again.) | 230 // again.) |
231 bool CfgNode::liveness(Liveness *Liveness) { | 231 bool CfgNode::liveness(Liveness *Liveness) { |
232 SizeT NumVars = Liveness->getNumVarsInNode(this); | 232 SizeT NumVars = Liveness->getNumVarsInNode(this); |
233 llvm::BitVector Live(NumVars); | 233 llvm::BitVector Live(NumVars); |
234 // Mark the beginning and ending of each variable's live range | 234 // Mark the beginning and ending of each variable's live range |
235 // with the sentinel instruction number 0. | 235 // with the sentinel instruction number 0. |
236 std::vector<InstNumberT> &LiveBegin = Liveness->getLiveBegin(this); | 236 std::vector<InstNumberT> &LiveBegin = Liveness->getLiveBegin(this); |
237 std::vector<InstNumberT> &LiveEnd = Liveness->getLiveEnd(this); | 237 std::vector<InstNumberT> &LiveEnd = Liveness->getLiveEnd(this); |
238 LiveBegin.assign(NumVars, Inst::NumberSentinel); | 238 InstNumberT Sentinel = Inst::NumberSentinel; |
239 LiveEnd.assign(NumVars, Inst::NumberSentinel); | 239 LiveBegin.assign(NumVars, Sentinel); |
| 240 LiveEnd.assign(NumVars, Sentinel); |
240 // Initialize Live to be the union of all successors' LiveIn. | 241 // Initialize Live to be the union of all successors' LiveIn. |
241 for (NodeList::const_iterator I = OutEdges.begin(), E = OutEdges.end(); | 242 for (NodeList::const_iterator I = OutEdges.begin(), E = OutEdges.end(); |
242 I != E; ++I) { | 243 I != E; ++I) { |
243 CfgNode *Succ = *I; | 244 CfgNode *Succ = *I; |
244 Live |= Liveness->getLiveIn(Succ); | 245 Live |= Liveness->getLiveIn(Succ); |
245 // Mark corresponding argument of phis in successor as live. | 246 // Mark corresponding argument of phis in successor as live. |
246 for (PhiList::const_iterator I1 = Succ->Phis.begin(), E1 = Succ->Phis.end(); | 247 for (PhiList::const_iterator I1 = Succ->Phis.begin(), E1 = Succ->Phis.end(); |
247 I1 != E1; ++I1) { | 248 I1 != E1; ++I1) { |
248 (*I1)->livenessPhiOperand(Live, this, Liveness); | 249 (*I1)->livenessPhiOperand(Live, this, Liveness); |
249 } | 250 } |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 I != E; ++I) { | 484 I != E; ++I) { |
484 if (I != OutEdges.begin()) | 485 if (I != OutEdges.begin()) |
485 Str << ", "; | 486 Str << ", "; |
486 Str << "%" << (*I)->getName(); | 487 Str << "%" << (*I)->getName(); |
487 } | 488 } |
488 Str << "\n"; | 489 Str << "\n"; |
489 } | 490 } |
490 } | 491 } |
491 | 492 |
492 } // end of namespace Ice | 493 } // end of namespace Ice |
OLD | NEW |