| OLD | NEW |
| 1 //===- subzero/src/IceLoopAnalyzer.h - Loop Analysis ------------*- C++ -*-===// | 1 //===- subzero/src/IceLoopAnalyzer.h - Loop Analysis ------------*- C++ -*-===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 CfgNode *BB; | 83 CfgNode *BB; |
| 84 NodeList::const_iterator Succ; | 84 NodeList::const_iterator Succ; |
| 85 IndexT Index; | 85 IndexT Index; |
| 86 IndexT LowLink; | 86 IndexT LowLink; |
| 87 bool OnStack; | 87 bool OnStack; |
| 88 bool Deleted = false; | 88 bool Deleted = false; |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 using LoopNodeList = std::vector<LoopNode, CfgLocalAllocator<LoopNode>>; | 91 using LoopNodeList = CfgVector<LoopNode>; |
| 92 using LoopNodePtrList = | 92 using LoopNodePtrList = CfgVector<LoopNode *>; |
| 93 std::vector<LoopNode *, CfgLocalAllocator<LoopNode *>>; | |
| 94 | 93 |
| 95 /// Process the node as part as part of Tarjan's algorithm and return either a | 94 /// Process the node as part as part of Tarjan's algorithm and return either a |
| 96 /// node to recurse into or nullptr when the node has been fully processed. | 95 /// node to recurse into or nullptr when the node has been fully processed. |
| 97 LoopNode *processNode(LoopNode &Node); | 96 LoopNode *processNode(LoopNode &Node); |
| 98 | 97 |
| 99 /// The function to analyze for loops. | 98 /// The function to analyze for loops. |
| 100 Cfg *const Func; | 99 Cfg *const Func; |
| 101 /// A list of decorated nodes in the same order as Func->getNodes() which | 100 /// A list of decorated nodes in the same order as Func->getNodes() which |
| 102 /// means the node's index will also be valid in this list. | 101 /// means the node's index will also be valid in this list. |
| 103 LoopNodeList AllNodes; | 102 LoopNodeList AllNodes; |
| 104 /// This is used as a replacement for the call stack. | 103 /// This is used as a replacement for the call stack. |
| 105 LoopNodePtrList WorkStack; | 104 LoopNodePtrList WorkStack; |
| 106 /// Track which loop a node belongs to. | 105 /// Track which loop a node belongs to. |
| 107 LoopNodePtrList LoopStack; | 106 LoopNodePtrList LoopStack; |
| 108 /// The index to assign to the next visited node. | 107 /// The index to assign to the next visited node. |
| 109 IndexT NextIndex = FirstDefinedIndex; | 108 IndexT NextIndex = FirstDefinedIndex; |
| 110 /// The number of nodes which have been marked deleted. This is used to track | 109 /// The number of nodes which have been marked deleted. This is used to track |
| 111 /// when the iteration should end. | 110 /// when the iteration should end. |
| 112 LoopNodePtrList::size_type NumDeletedNodes = 0; | 111 LoopNodePtrList::size_type NumDeletedNodes = 0; |
| 113 }; | 112 }; |
| 114 | 113 |
| 115 } // end of namespace Ice | 114 } // end of namespace Ice |
| 116 | 115 |
| 117 #endif // SUBZERO_SRC_ICELOOPANALYZER_H | 116 #endif // SUBZERO_SRC_ICELOOPANALYZER_H |
| OLD | NEW |