Add SlotIndex statistics.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 4 Mar 2011 18:08:29 +0000 (18:08 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 4 Mar 2011 18:08:29 +0000 (18:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127007 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SlotIndexes.cpp

index 73adb92101d7447e5283e1c6f40cbfc0d5b5f939..a495d1fd832cbd05cdda55e3a0276c96e2bfb528 100644 (file)
@@ -10,6 +10,7 @@
 #define DEBUG_TYPE "slotindexes"
 
 #include "llvm/CodeGen/SlotIndexes.h"
+#include "llvm/ADT/Statistic.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
@@ -21,6 +22,8 @@ char SlotIndexes::ID = 0;
 INITIALIZE_PASS(SlotIndexes, "slotindexes",
                 "Slot index numbering", false, false)
 
+STATISTIC(NumRenumPasses, "Number of slot index renumber passes");
+
 void SlotIndexes::getAnalysisUsage(AnalysisUsage &au) const {
   au.setPreservesAll();
   MachineFunctionPass::getAnalysisUsage(au);
@@ -128,6 +131,7 @@ void SlotIndexes::renumberIndexes() {
   // pass during the initial numbering of the function if the new instructions
   // had been present.
   DEBUG(dbgs() << "\n*** Renumbering SlotIndexes ***\n");
+  ++NumRenumPasses;
 
   unsigned index = 0;