summaryrefslogtreecommitdiffstats
path: root/polly/lib/Analysis/ScopDetection.cpp
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2017-02-17 08:08:54 +0000
committerTobias Grosser <tobias@grosser.es>2017-02-17 08:08:54 +0000
commit65ce9362b8353513f5cd8fc8803932a50ec923aa (patch)
tree248e41428bd1fbb4fdabd2774fef69120cfcbc7f /polly/lib/Analysis/ScopDetection.cpp
parent958fcd75026983975f8a5e04b1e2a64bf20695d8 (diff)
downloadbcm5719-llvm-65ce9362b8353513f5cd8fc8803932a50ec923aa.tar.gz
bcm5719-llvm-65ce9362b8353513f5cd8fc8803932a50ec923aa.zip
[ScopDetection] Compute the maximal loop depth correctly
Before this change, we obtained loop depth numbers that were deeper then the actual loop depth. llvm-svn: 295430
Diffstat (limited to 'polly/lib/Analysis/ScopDetection.cpp')
-rw-r--r--polly/lib/Analysis/ScopDetection.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index c541b59cf69..bcdbe226eee 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -1145,7 +1145,7 @@ ScopDetection::countBeneficialSubLoops(Loop *L, ScalarEvolution &SE,
for (auto &SubLoop : *L) {
LoopStats Stats = countBeneficialSubLoops(SubLoop, SE, MinProfitableTrips);
NumLoops += Stats.NumLoops;
- MaxLoopDepth += std::max(MaxLoopDepth, Stats.MaxDepth + 1);
+ MaxLoopDepth = std::max(MaxLoopDepth, Stats.MaxDepth + 1);
}
return {NumLoops, MaxLoopDepth};
OpenPOWER on IntegriCloud