diff options
author | Owen Anderson <resistor@mac.com> | 2007-06-08 22:02:36 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2007-06-08 22:02:36 +0000 |
commit | b8b873cb7d7511ac6f58a40e324857a0d879bcf5 (patch) | |
tree | 1608c1328207c67cce2d3ed097d87fbbea0bab5b | |
parent | 7e75ba802e4e5df9fe8f0d38a85e05adc05ea7f3 (diff) |
Collect statistics from GVN-PRE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37530 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/GVNPRE.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/GVNPRE.cpp b/lib/Transforms/Scalar/GVNPRE.cpp index 446389ecda..3f34605657 100644 --- a/lib/Transforms/Scalar/GVNPRE.cpp +++ b/lib/Transforms/Scalar/GVNPRE.cpp @@ -114,6 +114,10 @@ RegisterPass<GVNPRE> X("gvnpre", "Global Value Numbering/Partial Redundancy Elimination"); +STATISTIC(NumInsertedVals, "Number of values inserted"); +STATISTIC(NumInsertedPhis, "Number of PHI nodes inserted"); +STATISTIC(NumEliminated, "Number of redundant instructions eliminated"); + bool GVNPRE::add(Value* V, uint32_t number) { std::pair<ValueTable::iterator, bool> ret = VN.insert(std::make_pair(V, number)); @@ -618,6 +622,8 @@ bool GVNPRE::runOnFunction(Function &F) { if (av != avail.end()) avail.erase(av); avail.insert(std::make_pair(*PI, newVal)); + + ++NumInsertedVals; } } @@ -655,6 +661,8 @@ bool GVNPRE::runOnFunction(Function &F) { DOUT << "\n\n"; new_set.insert(p); + + ++NumInsertedPhis; } } } @@ -688,6 +696,7 @@ bool GVNPRE::runOnFunction(Function &F) { if (Instr->getParent() != 0 && Instr != BI) { replace.push_back(std::make_pair(BI, leader)); erase.push_back(BI); + ++NumEliminated; } } } |