Chromium Code Reviews| Index: src/IceLoopAnalyzer.h |
| diff --git a/src/IceLoopAnalyzer.h b/src/IceLoopAnalyzer.h |
| index eaaad9862045b3a420e0ba2fb724f75e611b8751..a8924bb4b7e6ad9ee17069c83876d5c5c401d242 100644 |
| --- a/src/IceLoopAnalyzer.h |
| +++ b/src/IceLoopAnalyzer.h |
| @@ -36,12 +36,13 @@ public: |
| /// This only computes the loop nest depth within the function and does not |
| /// take into account whether the function was called from within a loop. |
| // TODO(ascull): this currently uses a extension of Tarjan's algorithm with |
| - // is bounded linear. ncbray suggests another algorithm which is linear in |
| + // is bounded linear. ncbray suggests another algorithm whichis linear in |
|
Jim Stichnoth
2016/07/12 10:51:51
undo this
|
| // practice but not bounded linear. I think it also finds dominators. |
| // http://lenx.100871.net/papers/loop-SAS.pdf |
| - void computeLoopNestDepth(); |
| + CfgUnorderedMap<SizeT, CfgVector<SizeT>> getLoopInfo() { return Loops; } |
| private: |
| + void computeLoopNestDepth(); |
| using IndexT = uint32_t; |
| static constexpr IndexT UndefinedIndex = 0; |
| static constexpr IndexT FirstDefinedIndex = 1; |
| @@ -80,6 +81,8 @@ private: |
| void incrementLoopNestDepth(); |
| bool hasSelfEdge() const; |
| + CfgNode *getNode() { return BB; } |
| + |
| private: |
| CfgNode *BB; |
| NodeList::const_iterator Succ; |
| @@ -110,6 +113,8 @@ private: |
| /// The number of nodes which have been marked deleted. This is used to track |
| /// when the iteration should end. |
| LoopNodePtrList::size_type NumDeletedNodes = 0; |
| + /// Detailed loop information |
| + CfgUnorderedMap<SizeT, CfgVector<SizeT>> Loops; |
| }; |
| } // end of namespace Ice |