[llvm] ce4459a - [NFC][LoopRotate] Add a statistic for how many times rotation failed due to the header size

Roman Lebedev via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 15 14:22:23 PDT 2020


Author: Roman Lebedev
Date: 2020-07-16T00:21:55+03:00
New Revision: ce4459a0db91456ff98b9b43018833655367a59e

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

LOG: [NFC][LoopRotate] Add a statistic for how many times rotation failed due to the header size

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/LoopRotationUtils.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
index da1c09e6ebca..d3151bb91047 100644
--- a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
@@ -44,6 +44,8 @@ using namespace llvm;
 
 #define DEBUG_TYPE "loop-rotate"
 
+STATISTIC(NumNotRotatedDueToHeaderSize,
+          "Number of loops not rotated due to the header size");
 STATISTIC(NumRotated, "Number of loops rotated");
 
 static cl::opt<bool>
@@ -320,6 +322,7 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) {
                           << " instructions, which is more than the threshold ("
                           << MaxHeaderSize << " instructions): ";
                    L->dump());
+        ++NumNotRotatedDueToHeaderSize;
         return Rotated;
       }
     }


        


More information about the llvm-commits mailing list