[polly] r294893 - [ScopDetection] Add statistics to count the maximal number of scops in loop

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 12 02:52:57 PST 2017


Author: grosser
Date: Sun Feb 12 04:52:57 2017
New Revision: 294893

URL: http://llvm.org/viewvc/llvm-project?rev=294893&view=rev
Log:
[ScopDetection] Add statistics to count the maximal number of scops in loop

Modified:
    polly/trunk/lib/Analysis/ScopDetection.cpp

Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=294893&r1=294892&r2=294893&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Sun Feb 12 04:52:57 2017
@@ -221,6 +221,9 @@ STATISTIC(NumProfScopsDepthFive,
 STATISTIC(NumProfScopsDepthLarger,
           "Number of scops with maximal loop depth 6 and larger "
           "(profitable scops only)");
+STATISTIC(MaxNumLoopsInScop, "Maximal number of loops in scops");
+STATISTIC(MaxNumLoopsInProfScop,
+          "Maximal number of loops in scops (profitable scops only)");
 
 class DiagnosticScopFound : public DiagnosticInfo {
 private:
@@ -1550,6 +1553,8 @@ void updateLoopCountStatistic(ScopDetect
                               bool OnlyProfitable) {
   if (!OnlyProfitable) {
     NumLoopsInScop += Stats.NumLoops;
+    MaxNumLoopsInScop =
+        std::max(MaxNumLoopsInScop.getValue(), (unsigned)Stats.NumLoops);
     if (Stats.MaxDepth == 1)
       NumScopsDepthOne++;
     else if (Stats.MaxDepth == 2)
@@ -1564,6 +1569,8 @@ void updateLoopCountStatistic(ScopDetect
       NumScopsDepthLarger++;
   } else {
     NumLoopsInProfScop += Stats.NumLoops;
+    MaxNumLoopsInProfScop =
+        std::max(MaxNumLoopsInProfScop.getValue(), (unsigned)Stats.NumLoops);
     if (Stats.MaxDepth == 1)
       NumProfScopsDepthOne++;
     else if (Stats.MaxDepth == 2)




More information about the llvm-commits mailing list