Add statistics to evaluate this pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112545 91177308-0d34-0410-b5e6-96231b3b80d8
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 @@
assert(0 && "Select on constant is neither 0 nor 1?");
}
+ ++NumSelects;
+
return true;
}
@@ -88,6 +94,8 @@
changed = true;
}
+ ++NumPhis;
+
return changed;
}