summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-08-30 22:45:55 +0000
committerOwen Anderson <resistor@mac.com>2010-08-30 22:45:55 +0000
commitf523b3e0878ea47e72b7d880b8fd18a33636fbde (patch)
tree53d3d3567aae1da31e20ff3181f5b8835a5c766f /lib
parentd930f205db1d5982cea5abbdc515c49793cadcc6 (diff)
downloadexternal_llvm-f523b3e0878ea47e72b7d880b8fd18a33636fbde.zip
external_llvm-f523b3e0878ea47e72b7d880b8fd18a33636fbde.tar.gz
external_llvm-f523b3e0878ea47e72b7d880b8fd18a33636fbde.tar.bz2
Add statistics to evaluate this pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112545 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/ValuePropagation.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/ValuePropagation.cpp b/lib/Transforms/Scalar/ValuePropagation.cpp
index ae58eaf..7e4fb8b 100644
--- a/lib/Transforms/Scalar/ValuePropagation.cpp
+++ b/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;
}