[llvm-commits] [llvm] r112545 - /llvm/trunk/lib/Transforms/Scalar/ValuePropagation.cpp

Owen Anderson resistor at mac.com
Mon Aug 30 15:45:55 PDT 2010


Author: resistor
Date: Mon Aug 30 17:45:55 2010
New Revision: 112545

URL: http://llvm.org/viewvc/llvm-project?rev=112545&view=rev
Log:
Add statistics to evaluate this pass.

Modified:
    llvm/trunk/lib/Transforms/Scalar/ValuePropagation.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/ValuePropagation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ValuePropagation.cpp?rev=112545&r1=112544&r2=112545&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ValuePropagation.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ValuePropagation.cpp Mon Aug 30 17:45:55 2010
@@ -18,8 +18,12 @@
 #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 @@
     assert(0 && "Select on constant is neither 0 nor 1?");
   }
   
+  ++NumSelects;
+  
   return true;
 }
 
@@ -88,6 +94,8 @@
     changed = true;
   }
   
+  ++NumPhis;
+  
   return changed;
 }
 





More information about the llvm-commits mailing list