| OLD | NEW |
| 1 //===- subzero/src/IceLoopAnalyzer.cpp - Loop Analysis --------------------===// | 1 //===- subzero/src/IceLoopAnalyzer.cpp - Loop Analysis --------------------===// |
| 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 16 matching lines...) Expand all Loading... |
| 27 } | 27 } |
| 28 | 28 |
| 29 NodeList::const_iterator LoopAnalyzer::LoopNode::successorsEnd() const { | 29 NodeList::const_iterator LoopAnalyzer::LoopNode::successorsEnd() const { |
| 30 return BB->getOutEdges().end(); | 30 return BB->getOutEdges().end(); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void LoopAnalyzer::LoopNode::incrementLoopNestDepth() { | 33 void LoopAnalyzer::LoopNode::incrementLoopNestDepth() { |
| 34 BB->incrementLoopNestDepth(); | 34 BB->incrementLoopNestDepth(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 LoopAnalyzer::LoopAnalyzer(Cfg *Func) : Func(Func) { | 37 LoopAnalyzer::LoopAnalyzer(Cfg *Fn) : Func(Fn) { |
| 38 const NodeList &Nodes = Func->getNodes(); | 38 const NodeList &Nodes = Func->getNodes(); |
| 39 | 39 |
| 40 // Allocate memory ahead of time. This is why a vector is used instead of a | 40 // Allocate memory ahead of time. This is why a vector is used instead of a |
| 41 // stack which doesn't support reserving (or bulk erasure used below). | 41 // stack which doesn't support reserving (or bulk erasure used below). |
| 42 AllNodes.reserve(Nodes.size()); | 42 AllNodes.reserve(Nodes.size()); |
| 43 WorkStack.reserve(Nodes.size()); | 43 WorkStack.reserve(Nodes.size()); |
| 44 LoopStack.reserve(Nodes.size()); | 44 LoopStack.reserve(Nodes.size()); |
| 45 | 45 |
| 46 // Create the LoopNodes from the function's CFG | 46 // Create the LoopNodes from the function's CFG |
| 47 for (CfgNode *Node : Nodes) | 47 for (CfgNode *Node : Nodes) |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 ++NumDeletedNodes; | 133 ++NumDeletedNodes; |
| 134 LoopStack.erase(It.base() - 1, LoopStack.end()); | 134 LoopStack.erase(It.base() - 1, LoopStack.end()); |
| 135 break; | 135 break; |
| 136 } | 136 } |
| 137 } | 137 } |
| 138 | 138 |
| 139 return nullptr; | 139 return nullptr; |
| 140 } | 140 } |
| 141 | 141 |
| 142 } // end of namespace Ice | 142 } // end of namespace Ice |
| OLD | NEW |