From f523b3e0878ea47e72b7d880b8fd18a33636fbde Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Mon, 30 Aug 2010 22:45:55 +0000 Subject: [PATCH] Add statistics to evaluate this pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112545 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/ValuePropagation.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Transforms/Scalar/ValuePropagation.cpp b/lib/Transforms/Scalar/ValuePropagation.cpp index ae58eafcee1..7e4fb8b3ce2 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; } -- 2.34.1