Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: src/IceLoopAnalyzer.h

Issue 2138443002: Subzero: Loop Invariant Code Motion (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Put invariant detection logic into separate function Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« src/IceCfg.cpp ('K') | « src/IceClFlags.def ('k') | src/IceLoopAnalyzer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698