]> granicus.if.org Git - llvm/commitdiff
[ResetMachineFunction] Add statistic on the number of reset functions.
authorQuentin Colombet <qcolombet@apple.com>
Fri, 23 Sep 2016 18:38:13 +0000 (18:38 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Fri, 23 Sep 2016 18:38:13 +0000 (18:38 +0000)
As the development of GlobalISel move forward, this statistic should
strictly decrease until it reaches zero. At this point, it would mean
GlobalISel can replace SDISel (at least on the tested inputs :P).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282275 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/ResetMachineFunctionPass.cpp

index 07a8259a70cf6a5b9131af7a4e425f51e9c3cb0c..554760ff891c2429c47f565c2b4786558ec8db2d 100644 (file)
@@ -10,6 +10,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "llvm/ADT/Statistic.h"
 #include "llvm/CodeGen/Passes.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
@@ -19,6 +20,8 @@ using namespace llvm;
 
 #define DEBUG_TYPE "reset-machine-function"
 
+STATISTIC(NumFunctionsReset, "Number of functions reset");
+
 namespace {
   class ResetMachineFunction : public MachineFunctionPass {
     /// Tells whether or not this pass should emit a fallback
@@ -38,6 +41,7 @@ namespace {
       if (MF.getProperties().hasProperty(
               MachineFunctionProperties::Property::FailedISel)) {
         DEBUG(dbgs() << "Reseting: " << MF.getName() << '\n');
+        ++NumFunctionsReset;
         MF.reset();
         if (EmitFallbackDiag) {
           const Function &F = *MF.getFunction();