| OLD | NEW |
| 1 //===- subzero/src/IceCfg.cpp - Control flow graph implementation ---------===// | 1 //===- subzero/src/IceCfg.cpp - Control flow graph 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 /// \file | 10 /// \file |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 // The following code does an in-place update of liveness and live ranges as | 266 // The following code does an in-place update of liveness and live ranges as |
| 267 // a result of adding the new phi edge split nodes. | 267 // a result of adding the new phi edge split nodes. |
| 268 getLiveness()->initPhiEdgeSplits(Nodes.begin() + NumNodes, | 268 getLiveness()->initPhiEdgeSplits(Nodes.begin() + NumNodes, |
| 269 Variables.begin() + NumVars); | 269 Variables.begin() + NumVars); |
| 270 TimerMarker TTT(TimerStack::TT_liveness, this); | 270 TimerMarker TTT(TimerStack::TT_liveness, this); |
| 271 // Iterate over the newly added nodes to add their liveness info. | 271 // Iterate over the newly added nodes to add their liveness info. |
| 272 for (auto I = Nodes.begin() + NumNodes, E = Nodes.end(); I != E; ++I) { | 272 for (auto I = Nodes.begin() + NumNodes, E = Nodes.end(); I != E; ++I) { |
| 273 InstNumberT FirstInstNum = getNextInstNumber(); | 273 InstNumberT FirstInstNum = getNextInstNumber(); |
| 274 (*I)->renumberInstructions(); | 274 (*I)->renumberInstructions(); |
| 275 InstNumberT LastInstNum = getNextInstNumber() - 1; | 275 InstNumberT LastInstNum = getNextInstNumber() - 1; |
| 276 // TODO(stichnot): May be able to speed up liveness and live range | |
| 277 // calculation by having it consider only pre-colored or infinite-weight | |
| 278 // variables. Could also simplify LinearScan::initForInfOnly() that way. | |
| 279 (*I)->liveness(getLiveness()); | 276 (*I)->liveness(getLiveness()); |
| 280 (*I)->livenessAddIntervals(getLiveness(), FirstInstNum, LastInstNum); | 277 (*I)->livenessAddIntervals(getLiveness(), FirstInstNum, LastInstNum); |
| 281 } | 278 } |
| 282 } else { | 279 } else { |
| 283 // The following code does a brute-force recalculation of live ranges as a | 280 // The following code does a brute-force recalculation of live ranges as a |
| 284 // result of adding the new phi edge split nodes. The liveness calculation | 281 // result of adding the new phi edge split nodes. The liveness calculation |
| 285 // is particularly expensive because the new nodes are not yet in a proper | 282 // is particularly expensive because the new nodes are not yet in a proper |
| 286 // topological order and so convergence is slower. | 283 // topological order and so convergence is slower. |
| 287 // | 284 // |
| 288 // This code is kept here for reference and can be temporarily enabled in | 285 // This code is kept here for reference and can be temporarily enabled in |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 } | 757 } |
| 761 } | 758 } |
| 762 // Print each basic block | 759 // Print each basic block |
| 763 for (CfgNode *Node : Nodes) | 760 for (CfgNode *Node : Nodes) |
| 764 Node->dump(this); | 761 Node->dump(this); |
| 765 if (isVerbose(IceV_Instructions)) | 762 if (isVerbose(IceV_Instructions)) |
| 766 Str << "}\n"; | 763 Str << "}\n"; |
| 767 } | 764 } |
| 768 | 765 |
| 769 } // end of namespace Ice | 766 } // end of namespace Ice |
| OLD | NEW |