[llvm] r356114 - [ResetMachineFunctionPass] Add visited functions statistics info

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 18:13:16 PDT 2019


Author: ctopper
Date: Wed Mar 13 18:13:15 2019
New Revision: 356114

URL: http://llvm.org/viewvc/llvm-project?rev=356114&view=rev
Log:
[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

Modified:
    llvm/trunk/lib/CodeGen/ResetMachineFunctionPass.cpp

Modified: llvm/trunk/lib/CodeGen/ResetMachineFunctionPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ResetMachineFunctionPass.cpp?rev=356114&r1=356113&r2=356114&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ResetMachineFunctionPass.cpp (original)
+++ llvm/trunk/lib/CodeGen/ResetMachineFunctionPass.cpp Wed Mar 13 18:13:15 2019
@@ -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.




More information about the llvm-commits mailing list