[llvm-commits] CVS: llvm/lib/Transforms/Scalar/GVNPRE.cpp
Owen Anderson
resistor at mac.com
Fri Jun 8 15:02:58 PDT 2007
Changes in directory llvm/lib/Transforms/Scalar:
GVNPRE.cpp updated: 1.26 -> 1.27
---
Log message:
Collect statistics from GVN-PRE.
---
Diffs of the changes: (+9 -0)
GVNPRE.cpp | 9 +++++++++
1 files changed, 9 insertions(+)
Index: llvm/lib/Transforms/Scalar/GVNPRE.cpp
diff -u llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.26 llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.27
--- llvm/lib/Transforms/Scalar/GVNPRE.cpp:1.26 Fri Jun 8 15:57:08 2007
+++ llvm/lib/Transforms/Scalar/GVNPRE.cpp Fri Jun 8 17:02:36 2007
@@ -114,6 +114,10 @@
"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 @@
if (av != avail.end())
avail.erase(av);
avail.insert(std::make_pair(*PI, newVal));
+
+ ++NumInsertedVals;
}
}
@@ -655,6 +661,8 @@
DOUT << "\n\n";
new_set.insert(p);
+
+ ++NumInsertedPhis;
}
}
}
@@ -688,6 +696,7 @@
if (Instr->getParent() != 0 && Instr != BI) {
replace.push_back(std::make_pair(BI, leader));
erase.push_back(BI);
+ ++NumEliminated;
}
}
}
More information about the llvm-commits
mailing list