[llvm] 3ac828b - Use llvm::size rather than an empty loop to get the number of top

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 15:00:25 PDT 2020


Author: Eric Christopher
Date: 2020-07-23T14:55:50-07:00
New Revision: 3ac828b8f7a848ab1d801fcacc515b51a9cb684a

URL: https://github.com/llvm/llvm-project/commit/3ac828b8f7a848ab1d801fcacc515b51a9cb684a
DIFF: https://github.com/llvm/llvm-project/commit/3ac828b8f7a848ab1d801fcacc515b51a9cb684a.diff

LOG: Use llvm::size rather than an empty loop to get the number of top
level loops.

Added: 
    

Modified: 
    llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp b/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
index 3db108c94985..b6ff27dcaf55 100644
--- a/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
+++ b/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
@@ -53,9 +53,7 @@ FunctionPropertiesInfo::getFunctionPropertiesInfo(const Function &F,
     if (FPI.MaxLoopDepth < LoopDepth)
       FPI.MaxLoopDepth = LoopDepth;
   }
-  for (Loop *L : LI) {
-    ++FPI.TopLevelLoopCount;
-  }
+  FPI.TopLevelLoopCount += llvm::size(LI);
   return FPI;
 }
 


        


More information about the llvm-commits mailing list