Add statistics to evaluate this pass.
authorOwen Anderson <resistor@mac.com>
Mon, 30 Aug 2010 22:45:55 +0000 (22:45 +0000)
committerOwen Anderson <resistor@mac.com>
Mon, 30 Aug 2010 22:45:55 +0000 (22:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112545 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/ValuePropagation.cpp

index ae58eafcee1755860b53bcef047724b2f1a0e581..7e4fb8b3ce2032f9e5db4c4b6abeb68f94c75774 100644 (file)
 #include "llvm/Pass.h"
 #include "llvm/Analysis/LazyValueInfo.h"
 #include "llvm/Transforms/Utils/Local.h"
+#include "llvm/ADT/Statistic.h"
 using namespace llvm;
 
+STATISTIC(NumPhis,    "Number of phis propagated");
+STATISTIC(NumSelects, "Number of selects propagated");
+
 namespace {
   class ValuePropagation : public FunctionPass {
     LazyValueInfo *LVI;
@@ -65,6 +69,8 @@ bool ValuePropagation::processSelect(SelectInst *S) {
     assert(0 && "Select on constant is neither 0 nor 1?");
   }
   
+  ++NumSelects;
+  
   return true;
 }
 
@@ -88,6 +94,8 @@ bool ValuePropagation::processPHI(PHINode *P) {
     changed = true;
   }
   
+  ++NumPhis;
+  
   return changed;
 }