Eliminate static ctors from Statistics
authorChris Lattner <sabre@nondot.org>
Tue, 19 Dec 2006 22:41:21 +0000 (22:41 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 19 Dec 2006 22:41:21 +0000 (22:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32698 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/BranchFolding.cpp
lib/CodeGen/LiveIntervalAnalysis.cpp
lib/CodeGen/PHIElimination.cpp
lib/CodeGen/RegAllocLinearScan.cpp
lib/CodeGen/RegAllocLocal.cpp
lib/CodeGen/RegAllocSimple.cpp
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
lib/CodeGen/TwoAddressInstructionPass.cpp
lib/CodeGen/VirtRegMap.cpp

index 0dfa4928f99e5f906a4176df9b26cc00aac4447d..69c6f4e62eaf14845a02236bd7f5350b6f7dd9f5 100644 (file)
@@ -30,9 +30,9 @@
 #include <algorithm>
 using namespace llvm;
 
-static Statistic NumDeadBlocks("branchfold", "Number of dead blocks removed");
-static Statistic NumBranchOpts("branchfold", "Number of branches optimized");
-static Statistic NumTailMerge ("branchfold", "Number of block tails merged");
+STATISTIC(NumDeadBlocks, "Number of dead blocks removed");
+STATISTIC(NumBranchOpts, "Number of branches optimized");
+STATISTIC(NumTailMerge , "Number of block tails merged");
 static cl::opt<bool> EnableTailMerge("enable-tail-merge", cl::Hidden);
 
 namespace {
index 2175d3584832f13fb36d8d1ee6f0fee8bfdbbe79..68d194883757ce6859bcb0b9f9b2c3162fdaa377 100644 (file)
 #include <cmath>
 using namespace llvm;
 
+STATISTIC(numIntervals, "Number of original intervals");
+STATISTIC(numIntervalsAfter, "Number of intervals after coalescing");
+STATISTIC(numJoins    , "Number of interval joins performed");
+STATISTIC(numPeep     , "Number of identity moves eliminated after coalescing");
+STATISTIC(numFolded   , "Number of loads/stores folded into instructions");
+
 namespace {
   RegisterPass<LiveIntervals> X("liveintervals", "Live Interval Analysis");
 
-  static Statistic numIntervals
-  ("liveintervals", "Number of original intervals");
-
-  static Statistic numIntervalsAfter
-  ("liveintervals", "Number of intervals after coalescing");
-
-  static Statistic numJoins
-  ("liveintervals", "Number of interval joins performed");
-
-  static Statistic numPeep
-  ("liveintervals", "Number of identity moves eliminated after coalescing");
-
-  static Statistic numFolded
-  ("liveintervals", "Number of loads/stores folded into instructions");
-
   static cl::opt<bool>
   EnableJoining("join-liveintervals",
                 cl::desc("Coallesce copies (default=true)"),
index fec54eac373905680914ea8be53257a1efada4c9..a5d17c2e4b075f13cc9cb072db488d6877eed86f 100644 (file)
@@ -13,6 +13,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "phielim"
 #include "llvm/CodeGen/LiveVariables.h"
 #include "llvm/CodeGen/Passes.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include <algorithm>
 using namespace llvm;
 
+STATISTIC(NumAtomic, "Number of atomic phis lowered");
+//STATISTIC(NumSimple, "Number of simple phis lowered");
+
 namespace {
-  static Statistic NumAtomic("phielim", "Number of atomic phis lowered");
-  static Statistic NumSimple("phielim", "Number of simple phis lowered");
-  
   struct VISIBILITY_HIDDEN PNE : public MachineFunctionPass {
     bool runOnMachineFunction(MachineFunction &Fn) {
       analyzePHINodes(Fn);
index 1977a5489de8f199910f9378adeeba3925ced08a..5c6512d8ed7b41d3ab1547adda3bc4062214cad6 100644 (file)
 #include <cmath>
 using namespace llvm;
 
-namespace {
-
-  static Statistic NumIters
-  ("regalloc", "Number of iterations performed");
-  static Statistic NumBacktracks
-  ("regalloc", "Number of times we had to backtrack");
+STATISTIC(NumIters     , "Number of iterations performed");
+STATISTIC(NumBacktracks, "Number of times we had to backtrack");
 
-  static RegisterRegAlloc
-    linearscanRegAlloc("linearscan", "  linear scan register allocator",
-                       createLinearScanRegisterAllocator);
+static RegisterRegAlloc
+linearscanRegAlloc("linearscan", "  linear scan register allocator",
+                   createLinearScanRegisterAllocator);
 
+namespace {
   static unsigned numIterations = 0;
   static unsigned numIntervals = 0;
 
index 876eb950d9e37c26525fc6860f38f2dbcc796819..644e221212ae360a8fefb1e4dd158d7ce34c1393 100644 (file)
 #include <algorithm>
 using namespace llvm;
 
-namespace {
-  static Statistic NumStores("ra-local", "Number of stores added");
-  static Statistic NumLoads ("ra-local", "Number of loads added");
-  static Statistic NumFolded("ra-local", "Number of loads/stores folded "
-                              "into instructions");
+STATISTIC(NumStores, "Number of stores added");
+STATISTIC(NumLoads , "Number of loads added");
+STATISTIC(NumFolded, "Number of loads/stores folded into instructions");
 
+namespace {
   static RegisterRegAlloc
     localRegAlloc("local", "  local register allocator",
                   createLocalRegisterAllocator);
index 01504045c8992d3bc9c8faa2ad11877b69006530..e632e3599ac65b42fb116aed3efb51dfeafc8a0a 100644 (file)
 #include "llvm/ADT/STLExtras.h"
 using namespace llvm;
 
-namespace {
-  static Statistic NumStores("ra-simple", "Number of stores added");
-  static Statistic NumLoads ("ra-simple", "Number of loads added");
+STATISTIC(NumStores, "Number of stores added");
+STATISTIC(NumLoads , "Number of loads added");
 
+namespace {
   static RegisterRegAlloc
     simpleRegAlloc("simple", "  simple register allocator",
                    createSimpleRegisterAllocator);
index 3e53130ba5084ce0ee7b4221132119af2cd822df..33509536eb5e1b59195b83a1f0d4d75ac3432a0a 100644 (file)
 #include <algorithm>
 using namespace llvm;
 
+STATISTIC(NodesCombined   , "Number of dag nodes combined");
+STATISTIC(PreIndexedNodes , "Number of pre-indexed nodes created");
+STATISTIC(PostIndexedNodes, "Number of post-indexed nodes created");
+
 namespace {
-  static Statistic NodesCombined ("dagcombiner", 
-                                   "Number of dag nodes combined");
-            
-  static Statistic PreIndexedNodes ("pre_indexed_ops", 
-                                      "Number of pre-indexed nodes created");
-  static Statistic PostIndexedNodes ("post_indexed_ops", 
-                                       "Number of post-indexed nodes created");
-            
   static cl::opt<bool>
     CombinerAA("combiner-alias-analysis", cl::Hidden,
                cl::desc("Turn on alias analysis during testing"));
index 401b0249db646c0735fa0d08c8ab6bf08da2d8b9..d21ef34c6457610534bfbfecbb8ec8350479bcbf 100644 (file)
 #include <queue>
 using namespace llvm;
 
-namespace {
-  static Statistic NumNoops ("scheduler", "Number of noops inserted");
-  static Statistic NumStalls("scheduler", "Number of pipeline stalls");
-}
+STATISTIC(NumNoops , "Number of noops inserted");
+STATISTIC(NumStalls, "Number of pipeline stalls");
 
 static RegisterScheduler
   tdListDAGScheduler("list-td", "  Top-down list scheduler",
index be19e46168e51d0e9fe0192c121f7993b38a3fd5..ba768ba19fa5b347628e8c8e0cb429a1fb7125ca 100644 (file)
 #include "llvm/ADT/STLExtras.h"
 using namespace llvm;
 
-namespace {
-  static Statistic NumTwoAddressInstrs("twoaddressinstruction",
-                                  "Number of two-address instructions");
-  static Statistic NumCommuted("twoaddressinstruction",
-                          "Number of instructions commuted to coalesce");
-  static Statistic NumConvertedTo3Addr("twoaddressinstruction",
-                                "Number of instructions promoted to 3-address");
+STATISTIC(NumTwoAddressInstrs, "Number of two-address instructions");
+STATISTIC(NumCommuted        , "Number of instructions commuted to coalesce");
+STATISTIC(NumConvertedTo3Addr, "Number of instructions promoted to 3-address");
 
+namespace {
   struct VISIBILITY_HIDDEN TwoAddressInstructionPass
    : public MachineFunctionPass {
     virtual void getAnalysisUsage(AnalysisUsage &AU) const;
index 26b6eebf42952fe006cf587475d2f115bb922ce7..2c93e09e3f27dc9e01f61d22d2638403ac9f6b8f 100644 (file)
 #include <algorithm>
 using namespace llvm;
 
-namespace {
-  static Statistic NumSpills("spiller", "Number of register spills");
-  static Statistic NumStores("spiller", "Number of stores added");
-  static Statistic NumLoads ("spiller", "Number of loads added");
-  static Statistic NumReused("spiller", "Number of values reused");
-  static Statistic NumDSE   ("spiller", "Number of dead stores elided");
-  static Statistic NumDCE   ("spiller", "Number of copies elided");
+STATISTIC(NumSpills, "Number of register spills");
+STATISTIC(NumStores, "Number of stores added");
+STATISTIC(NumLoads , "Number of loads added");
+STATISTIC(NumReused, "Number of values reused");
+STATISTIC(NumDSE   , "Number of dead stores elided");
+STATISTIC(NumDCE   , "Number of copies elided");
 
+namespace {
   enum SpillerName { simple, local };
 
   static cl::opt<SpillerName>