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

Unified Diff: src/IceLoopAnalyzer.cpp

Issue 2138443002: Subzero: Loop Invariant Code Motion (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Address comments 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
« no previous file with comments | « src/IceLoopAnalyzer.h ('k') | src/IceTargetLoweringX86BaseImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceLoopAnalyzer.cpp
diff --git a/src/IceLoopAnalyzer.cpp b/src/IceLoopAnalyzer.cpp
index a76dfe2976138db0a1c11fae4b0d2c77931a430f..344ffcea6f534278956f022404e3f830075cf625 100644
--- a/src/IceLoopAnalyzer.cpp
+++ b/src/IceLoopAnalyzer.cpp
@@ -54,6 +54,7 @@ LoopAnalyzer::LoopAnalyzer(Cfg *Fn) : Func(Fn) {
// Create the LoopNodes from the function's CFG
for (CfgNode *Node : Nodes)
AllNodes.emplace_back(Node);
+ computeLoopNestDepth();
}
void LoopAnalyzer::computeLoopNestDepth() {
@@ -141,6 +142,12 @@ LoopAnalyzer::processNode(LoopAnalyzer::LoopNode &Node) {
if (*It == &Node) {
(*It)->setDeleted();
++NumDeletedNodes;
+ CfgVector<SizeT> LoopNodes;
+ for (auto LoopIter = It.base() - 1; LoopIter != LoopStack.end();
+ ++LoopIter) {
+ LoopNodes.push_back((*LoopIter)->getNode()->getIndex());
+ }
+ Loops[(*It)->getNode()->getIndex()] = LoopNodes;
LoopStack.erase(It.base() - 1, LoopStack.end());
break;
}
« no previous file with comments | « src/IceLoopAnalyzer.h ('k') | src/IceTargetLoweringX86BaseImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698