aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/ResetMachineFunctionPass.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2019-03-14 01:13:15 +0000
committerCraig Topper <craig.topper@intel.com>2019-03-14 01:13:15 +0000
commit66df7361fff74f29d1cae48822288ddd9e9cf0f3 (patch)
tree252b73b7c3b2cc6488f8f04de43215102fe935ea /llvm/lib/CodeGen/ResetMachineFunctionPass.cpp
parent23b37bf3628e6ce3e543ec2dc0713d217fba5ce8 (diff)
downloadllvm-66df7361fff74f29d1cae48822288ddd9e9cf0f3.zip
llvm-66df7361fff74f29d1cae48822288ddd9e9cf0f3.tar.gz
llvm-66df7361fff74f29d1cae48822288ddd9e9cf0f3.tar.bz2
[ResetMachineFunctionPass] Add visited functions statistics info
Adding a "NumFunctionsVisited" for collecting the visited function number. It can be used to collect function pass rate in some tests, the pass rate = (NumberVisited - NumberReset)/NumberVisited. e.g. it can be used for caculating GlobalISel pass rate in Test-Suite. Patch by Tianyang Zhu (zhutianyang) Differential Revision: https://reviews.llvm.org/D59285 llvm-svn: 356114
Diffstat (limited to 'llvm/lib/CodeGen/ResetMachineFunctionPass.cpp')
-rw-r--r--llvm/lib/CodeGen/ResetMachineFunctionPass.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/ResetMachineFunctionPass.cpp b/llvm/lib/CodeGen/ResetMachineFunctionPass.cpp
index 2e5ff23b..019de65 100644
--- a/llvm/lib/CodeGen/ResetMachineFunctionPass.cpp
+++ b/llvm/lib/CodeGen/ResetMachineFunctionPass.cpp
@@ -26,6 +26,7 @@ using namespace llvm;
#define DEBUG_TYPE "reset-machine-function"
STATISTIC(NumFunctionsReset, "Number of functions reset");
+STATISTIC(NumFunctionsVisited, "Number of functions visited");
namespace {
class ResetMachineFunction : public MachineFunctionPass {
@@ -50,6 +51,7 @@ namespace {
}
bool runOnMachineFunction(MachineFunction &MF) override {
+ ++NumFunctionsVisited;
// No matter what happened, whether we successfully selected the function
// or not, nothing is going to use the vreg types after us. Make sure they
// disappear.