Updates to work with recent Statistic's changes:
authorChris Lattner <sabre@nondot.org>
Tue, 1 Oct 2002 22:38:41 +0000 (22:38 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 1 Oct 2002 22:38:41 +0000 (22:38 +0000)
    * Renamed StatisticReporter.h/cpp to Statistic.h/cpp
    * Broke constructor to take two const char * arguments instead of one, so
      that indendation can be taken care of automatically.
    * Sort the list by pass name when printing
    * Make sure to print all statistics as a group, instead of randomly when
      the statistics dtors are called.
    * Updated ProgrammersManual with new semantics.

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

27 files changed:
lib/Bytecode/Writer/InstructionWriter.cpp
lib/Bytecode/Writer/Writer.cpp
lib/Transforms/IPO/ConstantMerge.cpp
lib/Transforms/IPO/DeadTypeElimination.cpp
lib/Transforms/IPO/FunctionResolution.cpp
lib/Transforms/IPO/GlobalDCE.cpp
lib/Transforms/IPO/Internalize.cpp
lib/Transforms/IPO/MutateStructTypes.cpp
lib/Transforms/IPO/RaiseAllocations.cpp
lib/Transforms/Scalar/ADCE.cpp
lib/Transforms/Scalar/BreakCriticalEdges.cpp
lib/Transforms/Scalar/ConstantProp.cpp
lib/Transforms/Scalar/CorrelatedExprs.cpp
lib/Transforms/Scalar/DCE.cpp
lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
lib/Transforms/Scalar/GCSE.cpp
lib/Transforms/Scalar/IndVarSimplify.cpp
lib/Transforms/Scalar/InstructionCombining.cpp
lib/Transforms/Scalar/LICM.cpp
lib/Transforms/Scalar/PiNodeInsertion.cpp
lib/Transforms/Scalar/Reassociate.cpp
lib/Transforms/Scalar/SCCP.cpp
lib/Transforms/Scalar/SimplifyCFG.cpp
lib/Transforms/Utils/BreakCriticalEdges.cpp
lib/Transforms/Utils/LoopSimplify.cpp
lib/Transforms/Utils/LowerAllocations.cpp
lib/Transforms/Utils/PromoteMemoryToRegister.cpp

index 49365af17e261e423a6fd78721094ef0665c670d..fe03554827f8667a3115850cbd20c4e50c4e89f6 100644 (file)
 #include "llvm/DerivedTypes.h"
 #include "llvm/iOther.h"
 #include "llvm/iTerminators.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 #include <algorithm>
 
 static Statistic<> 
-NumOversized("bytecodewriter\t- Number of oversized instructions");
+NumOversized("bytecodewriter", "Number of oversized instructions");
 static Statistic<> 
-NumNormal("bytecodewriter\t- Number of normal instructions");
+NumNormal("bytecodewriter", "Number of normal instructions");
 
 typedef unsigned char uchar;
 
index 4eade8827583b2e10cfcac152d74d10db808d014..012f9bc8c7ab534ed880282df51053c13f5c5667 100644 (file)
 #include "llvm/SymbolTable.h"
 #include "llvm/DerivedTypes.h"
 #include "Support/STLExtras.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 #include <string.h>
 #include <algorithm>
 
 static RegisterPass<WriteBytecodePass> X("emitbytecode", "Bytecode Writer");
 
 static Statistic<> 
-BytesWritten("bytecodewriter\t- Number of bytecode bytes written");
+BytesWritten("bytecodewriter", "Number of bytecode bytes written");
 
 
 BytecodeWriter::BytecodeWriter(std::deque<unsigned char> &o, const Module *M) 
index 28c6519478f5a0f23726cbb8f45641c5dba0d03d..02a9100a2e7f0a53a7aae205d8689edf78702161 100644 (file)
@@ -14,7 +14,7 @@
 #include "llvm/Module.h"
 #include "llvm/Constants.h"
 #include "llvm/Pass.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 
 namespace {
   struct ConstantMerge : public Pass {
@@ -28,7 +28,7 @@ namespace {
     void replaceConstantWith(Constant *Old, Constant *New);
   };
 
-  Statistic<> NumMerged("constmerge\t\t- Number of global constants merged");
+  Statistic<> NumMerged("constmerge", "Number of global constants merged");
   RegisterOpt<ConstantMerge> X("constmerge","Merge Duplicate Global Constants");
 }
 
index 58fe7f0a595b7d7014285b8fd4013e9056460dc7..a1860a92e959dcb30859b6ebf0019e4f153eb711 100644 (file)
@@ -10,7 +10,7 @@
 #include "llvm/Module.h"
 #include "llvm/SymbolTable.h"
 #include "llvm/DerivedTypes.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 
 using std::vector;
 
@@ -31,7 +31,8 @@ namespace {
     }
   };
   RegisterOpt<DTE> X("deadtypeelim", "Dead Type Elimination");
-  Statistic<> NumKilled("deadtypeelim\t- Number of unused typenames removed from symtab");
+  Statistic<>
+  NumKilled("deadtypeelim", "Number of unused typenames removed from symtab");
 }
 
 Pass *createDeadTypeEliminationPass() {
index 9c63dca2492c94df0de4737f641faab2d5a75d89..bf65c49bf9ec3af3ca8bf4b03f596ddc4875d629 100644 (file)
@@ -18,7 +18,7 @@
 #include "llvm/Pass.h"
 #include "llvm/iOther.h"
 #include "llvm/Constant.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 #include <algorithm>
 
 using std::vector;
@@ -26,7 +26,7 @@ using std::string;
 using std::cerr;
 
 namespace {
-  Statistic<>NumResolved("funcresolve\t- Number of varargs functions resolved");
+  Statistic<>NumResolved("funcresolve", "Number of varargs functions resolved");
 
   struct FunctionResolvingPass : public Pass {
     bool run(Module &M);
index 1bb823dde99039645ddcd174f35084fd4026e4e1..7c81f180bb34eeb3a8d938bc7d5f597acda0c231 100644 (file)
@@ -9,54 +9,53 @@
 #include "llvm/Module.h"
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
-#include "llvm/GlobalVariable.h"
 #include "llvm/Analysis/CallGraph.h"
 #include "Support/DepthFirstIterator.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 #include <algorithm>
 
-static Statistic<> NumFunctions("globaldce\t- Number of functions removed");
-static Statistic<> NumVariables("globaldce\t- Number of global variables removed");
-static Statistic<> NumCPRs("globaldce\t- Number of const pointer refs removed");
-static Statistic<> NumConsts("globaldce\t- Number of init constants removed");
-
-static bool RemoveUnreachableFunctions(Module &M, CallGraph &CallGraph) {
-  // Calculate which functions are reachable from the external functions in the
-  // call graph.
-  //
-  std::set<CallGraphNode*> ReachableNodes(df_begin(&CallGraph),
-                                          df_end(&CallGraph));
-
-  // Loop over the functions in the module twice.  The first time is used to
-  // drop references that functions have to each other before they are deleted.
-  // The second pass removes the functions that need to be removed.
-  //
-  std::vector<CallGraphNode*> FunctionsToDelete;   // Track unused functions
-  for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
-    CallGraphNode *N = CallGraph[I];
+namespace {
+  Statistic<> NumFunctions("globaldce","Number of functions removed");
+  Statistic<> NumVariables("globaldce","Number of global variables removed");
+  Statistic<> NumCPRs("globaldce", "Number of const pointer refs removed");
+  Statistic<> NumConsts("globaldce", "Number of init constants removed");
+
+  bool RemoveUnreachableFunctions(Module &M, CallGraph &CallGraph) {
+    // Calculate which functions are reachable from the external functions in
+    // the call graph.
+    //
+    std::set<CallGraphNode*> ReachableNodes(df_begin(&CallGraph),
+                                            df_end(&CallGraph));
 
-    if (!ReachableNodes.count(N)) {              // Not reachable??
-      I->dropAllReferences();
-      N->removeAllCalledFunctions();
-      FunctionsToDelete.push_back(N);
-      ++NumFunctions;
+    // Loop over the functions in the module twice.  The first time is used to
+    // drop references that functions have to each other before they are
+    // deleted.  The second pass removes the functions that need to be removed.
+    //
+    std::vector<CallGraphNode*> FunctionsToDelete;   // Track unused functions
+    for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
+      CallGraphNode *N = CallGraph[I];
+      
+      if (!ReachableNodes.count(N)) {              // Not reachable??
+        I->dropAllReferences();
+        N->removeAllCalledFunctions();
+        FunctionsToDelete.push_back(N);
+        ++NumFunctions;
+      }
     }
+    
+    // Nothing to do if no unreachable functions have been found...
+    if (FunctionsToDelete.empty()) return false;
+    
+    // Unreachables functions have been found and should have no references to
+    // them, delete them now.
+    //
+    for (std::vector<CallGraphNode*>::iterator I = FunctionsToDelete.begin(),
+           E = FunctionsToDelete.end(); I != E; ++I)
+      delete CallGraph.removeFunctionFromModule(*I);
+    
+    return true;
   }
-
-  // Nothing to do if no unreachable functions have been found...
-  if (FunctionsToDelete.empty()) return false;
-
-  // Unreachables functions have been found and should have no references to
-  // them, delete them now.
-  //
-  for (std::vector<CallGraphNode*>::iterator I = FunctionsToDelete.begin(),
-        E = FunctionsToDelete.end(); I != E; ++I)
-    delete CallGraph.removeFunctionFromModule(*I);
-
-  return true;
-}
-
-namespace {
+  
   struct GlobalDCE : public Pass {
     // run - Do the GlobalDCE pass on the specified module, optionally updating
     // the specified callgraph to reflect the changes.
index f0b0b1b0b7b5169f9afab181052773312f4bb657..58b1dccdaef25c6c624a99413f6069807998bfde 100644 (file)
@@ -9,12 +9,11 @@
 #include "llvm/Transforms/IPO.h"
 #include "llvm/Pass.h"
 #include "llvm/Module.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 
 namespace {
-  Statistic<> NumFunctions("internalize\t- Number of functions internalized");
-  Statistic<> NumGlobals  ("internalize\t- Number of global vars internalized");
-
+  Statistic<> NumFunctions("internalize", "Number of functions internalized");
+  Statistic<> NumGlobals  ("internalize", "Number of global vars internalized");
 
   class InternalizePass : public Pass {
     virtual bool run(Module &M) {
index 8130c6f0604985c9dd9ec95ce0e5c08ed1943f3c..7f62f2b50e1947c086100d4d6649003bbafe7d3e 100644 (file)
 #include "llvm/iMemory.h"
 #include "llvm/iTerminators.h"
 #include "llvm/iOther.h"
-#include "llvm/Argument.h"
 #include "llvm/Constants.h"
 #include "Support/STLExtras.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 #include <algorithm>
-#include <iostream>
+
 using std::map;
 using std::vector;
 
index 2f4a1df842eaebfe2486a26ed74497ba52e82f41..75c2247755cdf48e6cdba26a67d54da28bcdae16 100644 (file)
 #include "llvm/iMemory.h"
 #include "llvm/iOther.h"
 #include "llvm/Pass.h"
-#include "Support/StatisticReporter.h"
-
-static Statistic<> NumRaised("raiseallocs\t- Number of allocations raised");
+#include "Support/Statistic.h"
 
 namespace {
+  Statistic<> NumRaised("raiseallocs", "Number of allocations raised");
 
-// RaiseAllocations - Turn %malloc and %free calls into the appropriate
-// instruction.
-//
-class RaiseAllocations : public BasicBlockPass {
-  Function *MallocFunc;   // Functions in the module we are processing
-  Function *FreeFunc;     // Initialized by doPassInitializationVirt
-public:
-  RaiseAllocations() : MallocFunc(0), FreeFunc(0) {}
-
-  // doPassInitialization - For the raise allocations pass, this finds a
-  // declaration for malloc and free if they exist.
+  // RaiseAllocations - Turn %malloc and %free calls into the appropriate
+  // instruction.
   //
-  bool doInitialization(Module &M);
-
-  // runOnBasicBlock - This method does the actual work of converting
-  // instructions over, assuming that the pass has already been initialized.
-  //
-  bool runOnBasicBlock(BasicBlock &BB);
-};
-
+  class RaiseAllocations : public BasicBlockPass {
+    Function *MallocFunc;   // Functions in the module we are processing
+    Function *FreeFunc;     // Initialized by doPassInitializationVirt
+  public:
+    RaiseAllocations() : MallocFunc(0), FreeFunc(0) {}
+    
+    // doPassInitialization - For the raise allocations pass, this finds a
+    // declaration for malloc and free if they exist.
+    //
+    bool doInitialization(Module &M);
+    
+    // runOnBasicBlock - This method does the actual work of converting
+    // instructions over, assuming that the pass has already been initialized.
+    //
+    bool runOnBasicBlock(BasicBlock &BB);
+  };
+  
   RegisterOpt<RaiseAllocations>
   X("raiseallocs", "Raise allocations from calls to instructions");
 }  // end anonymous namespace
index 7d1d896bd226d6f1f353243a8c5a16fc72952eb5..e2e9e86216cde540bbc4536f86660ad47cb47857 100644 (file)
 #include "llvm/Support/CFG.h"
 #include "Support/STLExtras.h"
 #include "Support/DepthFirstIterator.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 #include <algorithm>
-#include <iostream>
 using std::cerr;
 using std::vector;
 
-static Statistic<> NumBlockRemoved("adce\t\t- Number of basic blocks removed");
-static Statistic<> NumInstRemoved ("adce\t\t- Number of instructions removed");
-
 namespace {
+  Statistic<> NumBlockRemoved("adce", "Number of basic blocks removed");
+  Statistic<> NumInstRemoved ("adce", "Number of instructions removed");
 
 //===----------------------------------------------------------------------===//
 // ADCE Class
index 3927a81802b5cc7cd048615abc8e0c85981a3ab1..fa33fc7397dca773d4fa366b9dc377ef78aaa07a 100644 (file)
 #include "llvm/iTerminators.h"
 #include "llvm/iPHINode.h"
 #include "llvm/Support/CFG.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 
 namespace {
-  Statistic<> NumBroken("break-crit-edges\t- Number of blocks inserted");
+  Statistic<> NumBroken("break-crit-edges", "Number of blocks inserted");
 
   struct BreakCriticalEdges : public FunctionPass {
     virtual bool runOnFunction(Function &F);
index 5da909e2020bc68ddaa04894ff7f84fdcf3b1067..1c0d33bee8239bda0b847ddec19c6314f91cc481 100644 (file)
 #include "llvm/Instruction.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/InstIterator.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 #include <set>
 
-static Statistic<> NumInstKilled("constprop - Number of instructions killed");
-
 namespace {
+  Statistic<> NumInstKilled("constprop", "Number of instructions killed");
+
   struct ConstantPropogation : public FunctionPass {
     bool runOnFunction(Function &F);
 
index 441c7990f16e61c289c618e2a436b7d0329e711a..2ff504de6c0c866d05b46f838cc39357ca4c86d7 100644 (file)
 #include "llvm/Support/ConstantRange.h"
 #include "llvm/Support/CFG.h"
 #include "Support/PostOrderIterator.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 #include <algorithm>
 
 namespace {
-  Statistic<>NumSetCCRemoved("cee\t\t- Number of setcc instruction eliminated");
-  Statistic<>NumOperandsCann("cee\t\t- Number of operands cannonicalized");
-  Statistic<>BranchRevectors("cee\t\t- Number of branches revectored");
+  Statistic<> NumSetCCRemoved("cee", "Number of setcc instruction eliminated");
+  Statistic<> NumOperandsCann("cee", "Number of operands cannonicalized");
+  Statistic<> BranchRevectors("cee", "Number of branches revectored");
 
   class ValueInfo;
   class Relation {
index 2903699a8d16697353492452bcc3269bf06ba029..cfeb86858935b6de8b0df28c172632a01b9fb05c 100644 (file)
 #include "llvm/Instruction.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/InstIterator.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 #include <set>
 
-static Statistic<> DIEEliminated("die\t\t- Number of insts removed");
-static Statistic<> DCEEliminated("dce\t\t- Number of insts removed");
+namespace {
+  Statistic<> DIEEliminated("die", "Number of insts removed");
+  Statistic<> DCEEliminated("dce", "Number of insts removed");
 
-//===----------------------------------------------------------------------===//
-// DeadInstElimination pass implementation
-//
+  //===--------------------------------------------------------------------===//
+  // DeadInstElimination pass implementation
+  //
 
-namespace {
   struct DeadInstElimination : public BasicBlockPass {
     virtual bool runOnBasicBlock(BasicBlock &BB) {
       bool Changed = false;
index 2fb1346a5c859dde4584b789e0c439fb5927f720..d0f47d8b8069a1f580a1b00438c495ea2ce32356 100644 (file)
 #include "llvm/iOther.h"
 #include "llvm/BasicBlock.h"
 #include "llvm/Pass.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 
 namespace {
-  Statistic<> NumAdded("lowerrefs\t\t- # of getelementptr instructions added");
+  Statistic<> NumAdded("lowerrefs", "# of getelementptr instructions added");
 
   struct DecomposePass : public BasicBlockPass {
     virtual bool runOnBasicBlock(BasicBlock &BB);
index e8e140f2032884836f2680d08321ad2e2300d0be..e5f10c849f4faa82bb9fd5d1fdb028a2849f9878 100644 (file)
 #include "llvm/Analysis/Dominators.h"
 #include "llvm/Analysis/ValueNumbering.h"
 #include "llvm/Support/InstIterator.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 #include <algorithm>
 
 namespace {
-  Statistic<> NumInstRemoved("gcse\t\t- Number of instructions removed");
-  Statistic<> NumLoadRemoved("gcse\t\t- Number of loads removed");
-  Statistic<> NumNonInsts   ("gcse\t\t- Number of instructions removed due "
+  Statistic<> NumInstRemoved("gcse", "Number of instructions removed");
+  Statistic<> NumLoadRemoved("gcse", "Number of loads removed");
+  Statistic<> NumNonInsts   ("gcse", "Number of instructions removed due "
                              "to non-instruction values");
 
   class GCSE : public FunctionPass {
index 004297ff8f423deea2b1e574543d82881392920e..d7433802ee5ac3f5d3fdab9e747001ccdff97d6f 100644 (file)
 #include "llvm/Constants.h"
 #include "llvm/Support/CFG.h"
 #include "Support/STLExtras.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 
 namespace {
-  Statistic<> NumRemoved ("indvars\t\t- Number of aux indvars removed");
-  Statistic<> NumInserted("indvars\t\t- Number of cannonical indvars added");
+  Statistic<> NumRemoved ("indvars", "Number of aux indvars removed");
+  Statistic<> NumInserted("indvars", "Number of cannonical indvars added");
 }
 
 // InsertCast - Cast Val to Ty, setting a useful name on the cast if Val has a
index b60d1fa9720ff7f4044950bba12d82961f23c099..ec3ea074d929fb084aaa34efd537092ac27b28c9 100644 (file)
 #include "llvm/Pass.h"
 #include "llvm/Support/InstIterator.h"
 #include "llvm/Support/InstVisitor.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 #include <algorithm>
 
-static Statistic<> NumCombined ("instcombine\t- Number of insts combined");
-static Statistic<> NumConstProp("instcombine\t- Number of constant folds");
-static Statistic<> NumDeadInst ("instcombine\t- Number of dead inst eliminate");
-
 namespace {
+  Statistic<> NumCombined ("instcombine", "Number of insts combined");
+  Statistic<> NumConstProp("instcombine", "Number of constant folds");
+  Statistic<> NumDeadInst ("instcombine", "Number of dead inst eliminated");
+
   class InstCombiner : public FunctionPass,
                        public InstVisitor<InstCombiner, Instruction*> {
     // Worklist of all of the instructions that need to be simplified.
index bc0e433d29f3e281ad6cbc40d9f8411692b0815b..998dce937b28df73b914336832c45922f4136ec1 100644 (file)
 #include "llvm/iMemory.h"
 #include "llvm/Support/InstVisitor.h"
 #include "Support/STLExtras.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 #include "llvm/Assembly/Writer.h"
 #include <algorithm>
 using std::string;
 
 namespace {
-  Statistic<>NumHoisted("licm\t\t- Number of instructions hoisted out of loop");
-  Statistic<> NumHoistedLoads("licm\t\t- Number of load insts hoisted");
+  Statistic<> NumHoisted("licm", "Number of instructions hoisted out of loop");
+  Statistic<> NumHoistedLoads("licm", "Number of load insts hoisted");
 
   struct LICM : public FunctionPass, public InstVisitor<LICM> {
     virtual bool runOnFunction(Function &F);
index 940b56fd29b8100b8ec3795984066f66d6e950f1..9d431951d7ce72409e6cb82c18d5ce8bf16d3524 100644 (file)
 #include "llvm/Analysis/Dominators.h"
 #include "llvm/Pass.h"
 #include "llvm/Function.h"
-#include "llvm/BasicBlock.h"
 #include "llvm/iTerminators.h"
 #include "llvm/iOperators.h"
 #include "llvm/iPHINode.h"
 #include "llvm/Support/CFG.h"
-#include "Support/StatisticReporter.h"
-
-static Statistic<> NumInserted("pinodes\t\t- Number of Pi nodes inserted");
+#include "Support/Statistic.h"
 
 namespace {
+  Statistic<> NumInserted("pinodes", "Number of Pi nodes inserted");
+
   struct PiNodeInserter : public FunctionPass {
     virtual bool runOnFunction(Function &F);
     
index 7d76bfb681f8fc01eaa57ebd0b32900e3a3a2367..608ab52510cea006cfee7e58edc230b20e9959c7 100644 (file)
 
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Function.h"
-#include "llvm/BasicBlock.h"
 #include "llvm/iOperators.h"
 #include "llvm/Type.h"
 #include "llvm/Pass.h"
 #include "llvm/Constant.h"
 #include "llvm/Support/CFG.h"
 #include "Support/PostOrderIterator.h"
-#include "Support/StatisticReporter.h"
-
-static Statistic<> NumLinear ("reassociate\t- Number of insts linearized");
-static Statistic<> NumChanged("reassociate\t- Number of insts reassociated");
-static Statistic<> NumSwapped("reassociate\t- Number of insts with operands swapped");
+#include "Support/Statistic.h"
 
 namespace {
+  Statistic<> NumLinear ("reassociate","Number of insts linearized");
+  Statistic<> NumChanged("reassociate","Number of insts reassociated");
+  Statistic<> NumSwapped("reassociate","Number of insts with operands swapped");
+
   class Reassociate : public FunctionPass {
     std::map<BasicBlock*, unsigned> RankMap;
   public:
index ff5cdcb74c08524531d11749891a797c109f88c3..1540767d3b838e331f16c7df8826e1923e56ef65 100644 (file)
 #include "llvm/Pass.h"
 #include "llvm/Support/InstVisitor.h"
 #include "Support/STLExtras.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 #include <algorithm>
 #include <set>
 using std::cerr;
 
-static Statistic<> NumInstRemoved("sccp\t\t- Number of instructions removed");
-
 // InstVal class - This class represents the different lattice values that an 
 // instruction may occupy.  It is a simple class with value semantics.
 //
 namespace {
+  Statistic<> NumInstRemoved("sccp", "Number of instructions removed");
+
 class InstVal {
   enum { 
     undefined,           // This instruction has no known value
index 5f04e2fe8f92998408d2da10b1da4a346dc67f85..3e19aed94998b4ffc2b2b7986523e1a115be8dd7 100644 (file)
 #include "llvm/Module.h"
 #include "llvm/Support/CFG.h"
 #include "llvm/Pass.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 #include <set>
 
-static Statistic<> NumSimpl("cfgsimplify\t- Number of blocks simplified");
-
 namespace {
+  Statistic<> NumSimpl("cfgsimplify", "Number of blocks simplified");
+
   struct CFGSimplifyPass : public FunctionPass {
     virtual bool runOnFunction(Function &F);
   };
index 3927a81802b5cc7cd048615abc8e0c85981a3ab1..fa33fc7397dca773d4fa366b9dc377ef78aaa07a 100644 (file)
 #include "llvm/iTerminators.h"
 #include "llvm/iPHINode.h"
 #include "llvm/Support/CFG.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 
 namespace {
-  Statistic<> NumBroken("break-crit-edges\t- Number of blocks inserted");
+  Statistic<> NumBroken("break-crit-edges", "Number of blocks inserted");
 
   struct BreakCriticalEdges : public FunctionPass {
     virtual bool runOnFunction(Function &F);
index 1432b1ca62194c43b33b064036053909c0859238..66c9aa5402b539dd37f5ea740d82378cda53d46e 100644 (file)
 #include "llvm/iPHINode.h"
 #include "llvm/Constant.h"
 #include "llvm/Support/CFG.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 
 namespace {
-  Statistic<> NumInserted("preheaders\t- Number of pre-header nodes inserted");
+  Statistic<> NumInserted("preheaders", "Number of pre-header nodes inserted");
 
   struct Preheaders : public FunctionPass {
     virtual bool runOnFunction(Function &F);
index 99eb2d044e4feeab8c189108cfd824686c340330..8c6550003dd72b0dbe78a4c0ca89148bc83349a2 100644 (file)
 #include "llvm/Constants.h"
 #include "llvm/Pass.h"
 #include "llvm/Target/TargetData.h"
-#include "Support/StatisticReporter.h"
+#include "Support/Statistic.h"
 
-static Statistic<> NumLowered("lowerallocs\t- Number of allocations lowered");
 using std::vector;
 
 namespace {
+  Statistic<> NumLowered("lowerallocs", "Number of allocations lowered");
 
   /// LowerAllocations - Turn malloc and free instructions into %malloc and
   /// %free calls.
index 70c794e81661299e1270f67fa12c9db5925bf303..a526694c300b9a3e9c9f55c85ca5eaad0103bcd1 100644 (file)
 #include "llvm/iPHINode.h"
 #include "llvm/iTerminators.h"
 #include "llvm/Function.h"
-#include "llvm/BasicBlock.h"
 #include "llvm/Constant.h"
 #include "llvm/Type.h"
-#include "Support/StatisticReporter.h"
-
-static Statistic<> NumPromoted("mem2reg\t\t- Number of alloca's promoted");
+#include "Support/Statistic.h"
 
 using std::vector;
 using std::map;
 using std::set;
 
 namespace {
+  Statistic<> NumPromoted("mem2reg", "Number of alloca's promoted");
+
   struct PromotePass : public FunctionPass {
     vector<AllocaInst*>          Allocas;      // the alloca instruction..
     map<Instruction*, unsigned>  AllocaLookup; // reverse mapping of above