[llvm-commits] CVS: llvm/lib/CodeGen/BranchFolding.cpp LiveIntervalAnalysis.cpp PHIElimination.cpp RegAllocLinearScan.cpp RegAllocLocal.cpp RegAllocSimple.cpp TwoAddressInstructionPass.cpp VirtRegMap.cpp

Chris Lattner sabre at nondot.org
Tue Dec 19 14:41:40 PST 2006



Changes in directory llvm/lib/CodeGen:

BranchFolding.cpp updated: 1.38 -> 1.39
LiveIntervalAnalysis.cpp updated: 1.203 -> 1.204
PHIElimination.cpp updated: 1.52 -> 1.53
RegAllocLinearScan.cpp updated: 1.135 -> 1.136
RegAllocLocal.cpp updated: 1.98 -> 1.99
RegAllocSimple.cpp updated: 1.81 -> 1.82
TwoAddressInstructionPass.cpp updated: 1.44 -> 1.45
VirtRegMap.cpp updated: 1.91 -> 1.92
---
Log message:

Eliminate static ctors from Statistics


---
Diffs of the changes:  (+37 -52)

 BranchFolding.cpp             |    6 +++---
 LiveIntervalAnalysis.cpp      |   21 ++++++---------------
 PHIElimination.cpp            |    7 ++++---
 RegAllocLinearScan.cpp        |   15 ++++++---------
 RegAllocLocal.cpp             |    9 ++++-----
 RegAllocSimple.cpp            |    6 +++---
 TwoAddressInstructionPass.cpp |   11 ++++-------
 VirtRegMap.cpp                |   14 +++++++-------
 8 files changed, 37 insertions(+), 52 deletions(-)


Index: llvm/lib/CodeGen/BranchFolding.cpp
diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.38 llvm/lib/CodeGen/BranchFolding.cpp:1.39
--- llvm/lib/CodeGen/BranchFolding.cpp:1.38	Wed Dec  6 11:46:31 2006
+++ llvm/lib/CodeGen/BranchFolding.cpp	Tue Dec 19 16:41:21 2006
@@ -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: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.203 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.204
--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.203	Wed Dec  6 19:30:31 2006
+++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp	Tue Dec 19 16:41:21 2006
@@ -36,24 +36,15 @@
 #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: llvm/lib/CodeGen/PHIElimination.cpp
diff -u llvm/lib/CodeGen/PHIElimination.cpp:1.52 llvm/lib/CodeGen/PHIElimination.cpp:1.53
--- llvm/lib/CodeGen/PHIElimination.cpp:1.52	Wed Dec  6 11:46:31 2006
+++ llvm/lib/CodeGen/PHIElimination.cpp	Tue Dec 19 16:41:21 2006
@@ -13,6 +13,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "phielim"
 #include "llvm/CodeGen/LiveVariables.h"
 #include "llvm/CodeGen/Passes.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
@@ -28,10 +29,10 @@
 #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: llvm/lib/CodeGen/RegAllocLinearScan.cpp
diff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.135 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.136
--- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.135	Wed Dec  6 11:46:31 2006
+++ llvm/lib/CodeGen/RegAllocLinearScan.cpp	Tue Dec 19 16:41:21 2006
@@ -35,17 +35,14 @@
 #include <cmath>
 using namespace llvm;
 
-namespace {
+STATISTIC(NumIters     , "Number of iterations performed");
+STATISTIC(NumBacktracks, "Number of times we had to backtrack");
 
-  static Statistic NumIters
-  ("regalloc", "Number of iterations performed");
-  static Statistic NumBacktracks
-  ("regalloc", "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: llvm/lib/CodeGen/RegAllocLocal.cpp
diff -u llvm/lib/CodeGen/RegAllocLocal.cpp:1.98 llvm/lib/CodeGen/RegAllocLocal.cpp:1.99
--- llvm/lib/CodeGen/RegAllocLocal.cpp:1.98	Thu Dec  7 14:04:42 2006
+++ llvm/lib/CodeGen/RegAllocLocal.cpp	Tue Dec 19 16:41:21 2006
@@ -32,12 +32,11 @@
 #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: llvm/lib/CodeGen/RegAllocSimple.cpp
diff -u llvm/lib/CodeGen/RegAllocSimple.cpp:1.81 llvm/lib/CodeGen/RegAllocSimple.cpp:1.82
--- llvm/lib/CodeGen/RegAllocSimple.cpp:1.81	Fri Dec  8 12:45:48 2006
+++ llvm/lib/CodeGen/RegAllocSimple.cpp	Tue Dec 19 16:41:21 2006
@@ -29,10 +29,10 @@
 #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: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
diff -u llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.44 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.45
--- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.44	Thu Dec  7 14:28:15 2006
+++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp	Tue Dec 19 16:41:21 2006
@@ -43,14 +43,11 @@
 #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: llvm/lib/CodeGen/VirtRegMap.cpp
diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.91 llvm/lib/CodeGen/VirtRegMap.cpp:1.92
--- llvm/lib/CodeGen/VirtRegMap.cpp:1.91	Sat Dec 16 23:15:13 2006
+++ llvm/lib/CodeGen/VirtRegMap.cpp	Tue Dec 19 16:41:21 2006
@@ -32,14 +32,14 @@
 #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>






More information about the llvm-commits mailing list