diff options
author | Owen Anderson <resistor@mac.com> | 2010-08-30 22:45:55 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2010-08-30 22:45:55 +0000 |
commit | 30bacbdfdf9ee9cc1db901e84f53abbc4cd8c2fd (patch) | |
tree | 71b765db47c8b31e0cff2d11cebca25cbe1d5a53 | |
parent | 1ddcbbe49cf2ac1c9e7e67df65a056a2f8889ee0 (diff) | |
download | bcm5719-llvm-30bacbdfdf9ee9cc1db901e84f53abbc4cd8c2fd.tar.gz bcm5719-llvm-30bacbdfdf9ee9cc1db901e84f53abbc4cd8c2fd.zip |
Add statistics to evaluate this pass.
llvm-svn: 112545
-rw-r--r-- | llvm/lib/Transforms/Scalar/ValuePropagation.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/ValuePropagation.cpp b/llvm/lib/Transforms/Scalar/ValuePropagation.cpp index ae58eafcee1..7e4fb8b3ce2 100644 --- a/llvm/lib/Transforms/Scalar/ValuePropagation.cpp +++ b/llvm/lib/Transforms/Scalar/ValuePropagation.cpp @@ -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 @@ 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; } |