summaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-12-19 22:17:40 +0000
committerChris Lattner <sabre@nondot.org>2006-12-19 22:17:40 +0000
commitd216e8ba60494caacf919cbf5fef110d48f0d162 (patch)
treea6e2c243cbac1f503451d51a705d0aa4d0ea012a /lib/Transforms
parent86453c52ba02e743d29c08456e51006500041456 (diff)
downloadllvm-d216e8ba60494caacf919cbf5fef110d48f0d162.tar.gz
llvm-d216e8ba60494caacf919cbf5fef110d48f0d162.tar.bz2
llvm-d216e8ba60494caacf919cbf5fef110d48f0d162.tar.xz
switch more statistics over to STATISTIC, eliminating static ctors. Also,
delete some dead ones. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32694 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/LevelRaise.cpp19
-rw-r--r--lib/Transforms/Utils/BreakCriticalEdges.cpp5
-rw-r--r--lib/Transforms/Utils/LCSSA.cpp7
-rw-r--r--lib/Transforms/Utils/LoopSimplify.cpp9
-rw-r--r--lib/Transforms/Utils/LowerAllocations.cpp5
-rw-r--r--lib/Transforms/Utils/LowerInvoke.cpp13
-rw-r--r--lib/Transforms/Utils/LowerSelect.cpp3
-rw-r--r--lib/Transforms/Utils/LowerSwitch.cpp3
-rw-r--r--lib/Transforms/Utils/Mem2Reg.cpp5
9 files changed, 30 insertions, 39 deletions
diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp
index c5ac8c98b9..9930d1bdf8 100644
--- a/lib/Transforms/LevelRaise.cpp
+++ b/lib/Transforms/LevelRaise.cpp
@@ -13,6 +13,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "raise"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/Local.h"
#include "TransformInternals.h"
@@ -34,23 +35,17 @@ static cl::opt<std::string>
StartInst("raise-start-inst", cl::Hidden, cl::value_desc("inst name"),
cl::desc("Start raise pass at the instruction with the specified name"));
-static Statistic
-NumLoadStorePeepholes("raise", "Number of load/store peepholes");
+STATISTIC(NumLoadStorePeepholes, "Number of load/store peepholes");
-static Statistic
-NumGEPInstFormed("raise", "Number of other getelementptr's formed");
+STATISTIC(NumGEPInstFormed, "Number of other getelementptr's formed");
-static Statistic
-NumExprTreesConv("raise", "Number of expression trees converted");
+STATISTIC(NumExprTreesConv, "Number of expression trees converted");
-static Statistic
-NumCastOfCast("raise", "Number of cast-of-self removed");
+STATISTIC(NumCastOfCast, "Number of cast-of-self removed");
-static Statistic
-NumDCEorCP("raise", "Number of insts DCEd or constprop'd");
+STATISTIC(NumDCEorCP, "Number of insts DCEd or constprop'd");
-static Statistic
-NumVarargCallChanges("raise", "Number of vararg call peepholes");
+STATISTIC(NumVarargCallChanges, "Number of vararg call peepholes");
#define PRINT_PEEPHOLE(ID, NUM, I) \
DOUT << "Inst P/H " << ID << "[" << NUM << "] " << I
diff --git a/lib/Transforms/Utils/BreakCriticalEdges.cpp b/lib/Transforms/Utils/BreakCriticalEdges.cpp
index 668d19dff7..e06a746ed3 100644
--- a/lib/Transforms/Utils/BreakCriticalEdges.cpp
+++ b/lib/Transforms/Utils/BreakCriticalEdges.cpp
@@ -16,6 +16,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "break-crit-edges"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Analysis/Dominators.h"
@@ -29,9 +30,9 @@
#include "llvm/ADT/Statistic.h"
using namespace llvm;
-namespace {
- Statistic NumBroken("break-crit-edges", "Number of blocks inserted");
+STATISTIC(NumBroken, "Number of blocks inserted");
+namespace {
struct VISIBILITY_HIDDEN BreakCriticalEdges : public FunctionPass {
virtual bool runOnFunction(Function &F);
diff --git a/lib/Transforms/Utils/LCSSA.cpp b/lib/Transforms/Utils/LCSSA.cpp
index fe9890316f..554dcbcec2 100644
--- a/lib/Transforms/Utils/LCSSA.cpp
+++ b/lib/Transforms/Utils/LCSSA.cpp
@@ -27,6 +27,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "lcssa"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Constants.h"
#include "llvm/Pass.h"
@@ -39,13 +40,11 @@
#include "llvm/Support/CFG.h"
#include <algorithm>
#include <map>
-
using namespace llvm;
+STATISTIC(NumLCSSA, "Number of live out of a loop variables");
+
namespace {
- static Statistic NumLCSSA("lcssa",
- "Number of live out of a loop variables");
-
struct LCSSA : public FunctionPass {
// Cached analysis information for the current function.
LoopInfo *LI;
diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp
index 7796022e89..ab850d58fc 100644
--- a/lib/Transforms/Utils/LoopSimplify.cpp
+++ b/lib/Transforms/Utils/LoopSimplify.cpp
@@ -32,6 +32,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "loopsimplify"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Constant.h"
#include "llvm/Instructions.h"
@@ -48,12 +49,10 @@
#include "llvm/ADT/DepthFirstIterator.h"
using namespace llvm;
-namespace {
- Statistic
- NumInserted("loopsimplify", "Number of pre-header or exit blocks inserted");
- Statistic
- NumNested("loopsimplify", "Number of nested loops split out");
+STATISTIC(NumInserted, "Number of pre-header or exit blocks inserted");
+STATISTIC(NumNested , "Number of nested loops split out");
+namespace {
struct VISIBILITY_HIDDEN LoopSimplify : public FunctionPass {
// AA - If we have an alias analysis object to update, this is it, otherwise
// this is null.
diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp
index 30b0ab827e..da0b9ed45c 100644
--- a/lib/Transforms/Utils/LowerAllocations.cpp
+++ b/lib/Transforms/Utils/LowerAllocations.cpp
@@ -12,6 +12,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "lowerallocs"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
#include "llvm/Module.h"
@@ -24,9 +25,9 @@
#include "llvm/Support/Compiler.h"
using namespace llvm;
-namespace {
- Statistic NumLowered("lowerallocs", "Number of allocations lowered");
+STATISTIC(NumLowered, "Number of allocations lowered");
+namespace {
/// LowerAllocations - Turn malloc and free instructions into %malloc and
/// %free calls.
///
diff --git a/lib/Transforms/Utils/LowerInvoke.cpp b/lib/Transforms/Utils/LowerInvoke.cpp
index 4fbd43c6f4..e4117d5874 100644
--- a/lib/Transforms/Utils/LowerInvoke.cpp
+++ b/lib/Transforms/Utils/LowerInvoke.cpp
@@ -34,6 +34,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "lowerinvoke"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
@@ -49,14 +50,14 @@
#include <csetjmp>
using namespace llvm;
-namespace {
- Statistic NumInvokes("lowerinvoke", "Number of invokes replaced");
- Statistic NumUnwinds("lowerinvoke", "Number of unwinds replaced");
- Statistic NumSpilled("lowerinvoke",
- "Number of registers live across unwind edges");
- cl::opt<bool> ExpensiveEHSupport("enable-correct-eh-support",
+STATISTIC(NumInvokes, "Number of invokes replaced");
+STATISTIC(NumUnwinds, "Number of unwinds replaced");
+STATISTIC(NumSpilled, "Number of registers live across unwind edges");
+
+static cl::opt<bool> ExpensiveEHSupport("enable-correct-eh-support",
cl::desc("Make the -lowerinvoke pass insert expensive, but correct, EH code"));
+namespace {
class VISIBILITY_HIDDEN LowerInvoke : public FunctionPass {
// Used for both models.
Function *WriteFn;
diff --git a/lib/Transforms/Utils/LowerSelect.cpp b/lib/Transforms/Utils/LowerSelect.cpp
index 5efdd9bc19..c0c8a329da 100644
--- a/lib/Transforms/Utils/LowerSelect.cpp
+++ b/lib/Transforms/Utils/LowerSelect.cpp
@@ -24,12 +24,9 @@
#include "llvm/Instructions.h"
#include "llvm/Pass.h"
#include "llvm/Type.h"
-#include "llvm/ADT/Statistic.h"
using namespace llvm;
namespace {
- Statistic NumLowered("lowerselect","Number of select instructions lowered");
-
/// LowerSelect - Turn select instructions into conditional branches.
///
class LowerSelect : public FunctionPass {
diff --git a/lib/Transforms/Utils/LowerSwitch.cpp b/lib/Transforms/Utils/LowerSwitch.cpp
index f0ae3852d8..69df51c792 100644
--- a/lib/Transforms/Utils/LowerSwitch.cpp
+++ b/lib/Transforms/Utils/LowerSwitch.cpp
@@ -21,13 +21,10 @@
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/Statistic.h"
#include <algorithm>
using namespace llvm;
namespace {
- Statistic NumLowered("lowerswitch", "Number of SwitchInst's replaced");
-
/// LowerSwitch Pass - Replace all SwitchInst instructions with chained branch
/// instructions. Note that this cannot be a BasicBlock pass because it
/// modifies the CFG!
diff --git a/lib/Transforms/Utils/Mem2Reg.cpp b/lib/Transforms/Utils/Mem2Reg.cpp
index e0f79dd36c..78117fb11e 100644
--- a/lib/Transforms/Utils/Mem2Reg.cpp
+++ b/lib/Transforms/Utils/Mem2Reg.cpp
@@ -12,6 +12,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "mem2reg"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/PromoteMemToReg.h"
#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
@@ -23,9 +24,9 @@
#include "llvm/Support/Compiler.h"
using namespace llvm;
-namespace {
- Statistic NumPromoted("mem2reg", "Number of alloca's promoted");
+STATISTIC(NumPromoted, "Number of alloca's promoted");
+namespace {
struct VISIBILITY_HIDDEN PromotePass : public FunctionPass {
// runOnFunction - To run this pass, first we calculate the alloca
// instructions that are safe for promotion, then we promote each one.