1
0
mirror of https://github.com/c64scene-ar/llvm-6502.git synced 2025-03-23 01:31:05 +00:00

Add statistics to evaluate this pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112545 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson 2010-08-30 22:45:55 +00:00
parent d930f205db
commit f523b3e087

@ -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;
}