[PATCH] D59285: Add visited functions statistics info

zhutianyang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 19:33:07 PDT 2019


zhutianyang created this revision.
zhutianyang added reviewers: LuoYuanke, annita.zhang.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D59285

Files:
  lib/CodeGen/ResetMachineFunctionPass.cpp


Index: lib/CodeGen/ResetMachineFunctionPass.cpp
===================================================================
--- lib/CodeGen/ResetMachineFunctionPass.cpp
+++ lib/CodeGen/ResetMachineFunctionPass.cpp
@@ -26,6 +26,7 @@
 #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 @@
     }
 
     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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59285.190373.patch
Type: text/x-patch
Size: 775 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190313/e5243841/attachment.bin>


More information about the llvm-commits mailing list