[llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp BasicBlockPlacement.cpp CondPropagate.cpp ConstantProp.cpp CorrelatedExprs.cpp DCE.cpp DeadStoreElimination.cpp GCSE.cpp IndVarSimplify.cpp InstructionCombining.cpp LICM.cpp LoopStrengthReduce.cpp LoopUnroll.cpp LoopUnswitch.cpp Reassociate.cpp Reg2Mem.cpp SCCP.cpp ScalarReplAggregates.cpp SimplifyCFG.cpp TailDuplication.cpp TailRecursionElimination.cpp
Chris Lattner
sabre at nondot.org
Tue Dec 19 13:40:33 PST 2006
Changes in directory llvm/lib/Transforms/Scalar:
ADCE.cpp updated: 1.100 -> 1.101
BasicBlockPlacement.cpp updated: 1.7 -> 1.8
CondPropagate.cpp updated: 1.10 -> 1.11
ConstantProp.cpp updated: 1.53 -> 1.54
CorrelatedExprs.cpp updated: 1.40 -> 1.41
DCE.cpp updated: 1.60 -> 1.61
DeadStoreElimination.cpp updated: 1.15 -> 1.16
GCSE.cpp updated: 1.49 -> 1.50
IndVarSimplify.cpp updated: 1.97 -> 1.98
InstructionCombining.cpp updated: 1.571 -> 1.572
LICM.cpp updated: 1.82 -> 1.83
LoopStrengthReduce.cpp updated: 1.100 -> 1.101
LoopUnroll.cpp updated: 1.32 -> 1.33
LoopUnswitch.cpp updated: 1.51 -> 1.52
Reassociate.cpp updated: 1.68 -> 1.69
Reg2Mem.cpp updated: 1.8 -> 1.9
SCCP.cpp updated: 1.141 -> 1.142
ScalarReplAggregates.cpp updated: 1.58 -> 1.59
SimplifyCFG.cpp updated: 1.17 -> 1.18
TailDuplication.cpp updated: 1.35 -> 1.36
TailRecursionElimination.cpp updated: 1.26 -> 1.27
---
Log message:
Switch over Transforms/Scalar to use the STATISTIC macro. For each statistic
converted, we lose a static initializer. This also allows GCC to emit warnings
about unused statistics.
---
Diffs of the changes: (+101 -102)
ADCE.cpp | 9 +++++----
BasicBlockPlacement.cpp | 5 +++--
CondPropagate.cpp | 8 +++-----
ConstantProp.cpp | 5 +++--
CorrelatedExprs.cpp | 9 +++++----
DCE.cpp | 15 +++++++--------
DeadStoreElimination.cpp | 7 ++++---
GCSE.cpp | 16 ++++++++--------
IndVarSimplify.cpp | 13 +++++++------
InstructionCombining.cpp | 12 ++++++------
LICM.cpp | 13 ++++++-------
LoopStrengthReduce.cpp | 8 ++++----
LoopUnroll.cpp | 4 ++--
LoopUnswitch.cpp | 13 ++++++-------
Reassociate.cpp | 11 +++++------
Reg2Mem.cpp | 7 +++----
SCCP.cpp | 20 ++++++++++----------
ScalarReplAggregates.cpp | 10 +++++-----
SimplifyCFG.cpp | 5 +++--
TailDuplication.cpp | 6 ++----
TailRecursionElimination.cpp | 7 ++++---
21 files changed, 101 insertions(+), 102 deletions(-)
Index: llvm/lib/Transforms/Scalar/ADCE.cpp
diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.100 llvm/lib/Transforms/Scalar/ADCE.cpp:1.101
--- llvm/lib/Transforms/Scalar/ADCE.cpp:1.100 Wed Dec 6 11:46:32 2006
+++ llvm/lib/Transforms/Scalar/ADCE.cpp Tue Dec 19 15:40:18 2006
@@ -13,6 +13,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "adce"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Constants.h"
#include "llvm/Instructions.h"
@@ -29,11 +30,11 @@
#include <algorithm>
using namespace llvm;
-namespace {
- Statistic NumBlockRemoved("adce", "Number of basic blocks removed");
- Statistic NumInstRemoved ("adce", "Number of instructions removed");
- Statistic NumCallRemoved ("adce", "Number of calls and invokes removed");
+STATISTIC(NumBlockRemoved, "Number of basic blocks removed");
+STATISTIC(NumInstRemoved , "Number of instructions removed");
+STATISTIC(NumCallRemoved , "Number of calls and invokes removed");
+namespace {
//===----------------------------------------------------------------------===//
// ADCE Class
//
Index: llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp
diff -u llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.7 llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.8
--- llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.7 Wed Dec 6 11:46:32 2006
+++ llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp Tue Dec 19 15:40:18 2006
@@ -26,6 +26,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "block-placement"
#include "llvm/Analysis/ProfileInfo.h"
#include "llvm/Function.h"
#include "llvm/Pass.h"
@@ -35,9 +36,9 @@
#include <set>
using namespace llvm;
-namespace {
- Statistic NumMoved("block-placement", "Number of basic blocks moved");
+STATISTIC(NumMoved, "Number of basic blocks moved");
+namespace {
struct BlockPlacement : public FunctionPass {
virtual bool runOnFunction(Function &F);
Index: llvm/lib/Transforms/Scalar/CondPropagate.cpp
diff -u llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.10 llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.11
--- llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.10 Wed Dec 6 11:46:32 2006
+++ llvm/lib/Transforms/Scalar/CondPropagate.cpp Tue Dec 19 15:40:18 2006
@@ -25,12 +25,10 @@
#include "llvm/Support/Streams.h"
using namespace llvm;
-namespace {
- Statistic
- NumBrThread("condprop", "Number of CFG edges threaded through branches");
- Statistic
- NumSwThread("condprop", "Number of CFG edges threaded through switches");
+STATISTIC(NumBrThread, "Number of CFG edges threaded through branches");
+STATISTIC(NumSwThread, "Number of CFG edges threaded through switches");
+namespace {
struct CondProp : public FunctionPass {
virtual bool runOnFunction(Function &F);
Index: llvm/lib/Transforms/Scalar/ConstantProp.cpp
diff -u llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.53 llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.54
--- llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.53 Wed Dec 6 11:46:32 2006
+++ llvm/lib/Transforms/Scalar/ConstantProp.cpp Tue Dec 19 15:40:18 2006
@@ -18,6 +18,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "constprop"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Constant.h"
@@ -28,9 +29,9 @@
#include <set>
using namespace llvm;
-namespace {
- Statistic NumInstKilled("constprop", "Number of instructions killed");
+STATISTIC(NumInstKilled, "Number of instructions killed");
+namespace {
struct ConstantPropagation : public FunctionPass {
bool runOnFunction(Function &F);
Index: llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp
diff -u llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.40 llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.41
--- llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.40 Thu Dec 7 14:04:42 2006
+++ llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp Tue Dec 19 15:40:18 2006
@@ -26,6 +26,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "cee"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Constants.h"
#include "llvm/Pass.h"
@@ -44,11 +45,11 @@
#include <algorithm>
using namespace llvm;
-namespace {
- Statistic NumSetCCRemoved("cee", "Number of setcc instruction eliminated");
- Statistic NumOperandsCann("cee", "Number of operands canonicalized");
- Statistic BranchRevectors("cee", "Number of branches revectored");
+STATISTIC(NumSetCCRemoved, "Number of setcc instruction eliminated");
+STATISTIC(NumOperandsCann, "Number of operands canonicalized");
+STATISTIC(BranchRevectors, "Number of branches revectored");
+namespace {
class ValueInfo;
class Relation {
Value *Val; // Relation to what value?
Index: llvm/lib/Transforms/Scalar/DCE.cpp
diff -u llvm/lib/Transforms/Scalar/DCE.cpp:1.60 llvm/lib/Transforms/Scalar/DCE.cpp:1.61
--- llvm/lib/Transforms/Scalar/DCE.cpp:1.60 Wed Dec 6 11:46:32 2006
+++ llvm/lib/Transforms/Scalar/DCE.cpp Tue Dec 19 15:40:18 2006
@@ -16,6 +16,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "dce"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Instruction.h"
@@ -25,14 +26,13 @@
#include <set>
using namespace llvm;
-namespace {
- Statistic DIEEliminated("die", "Number of insts removed");
- Statistic DCEEliminated("dce", "Number of insts removed");
+STATISTIC(DIEEliminated, "Number of insts removed by DIE pass");
+STATISTIC(DCEEliminated, "Number of insts removed");
+namespace {
//===--------------------------------------------------------------------===//
// DeadInstElimination pass implementation
//
-
struct DeadInstElimination : public BasicBlockPass {
virtual bool runOnBasicBlock(BasicBlock &BB) {
bool Changed = false;
@@ -58,11 +58,10 @@
}
-//===----------------------------------------------------------------------===//
-// DeadCodeElimination pass implementation
-//
-
namespace {
+ //===--------------------------------------------------------------------===//
+ // DeadCodeElimination pass implementation
+ //
struct DCE : public FunctionPass {
virtual bool runOnFunction(Function &F);
Index: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
diff -u llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.15 llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.16
--- llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.15 Wed Dec 6 11:46:32 2006
+++ llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp Tue Dec 19 15:40:18 2006
@@ -15,6 +15,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "dse"
#include "llvm/Transforms/Scalar.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Function.h"
@@ -27,10 +28,10 @@
#include "llvm/ADT/Statistic.h"
using namespace llvm;
-namespace {
- Statistic NumStores("dse", "Number of stores deleted");
- Statistic NumOther ("dse", "Number of other instrs removed");
+STATISTIC(NumStores, "Number of stores deleted");
+STATISTIC(NumOther , "Number of other instrs removed");
+namespace {
struct DSE : public FunctionPass {
virtual bool runOnFunction(Function &F) {
Index: llvm/lib/Transforms/Scalar/GCSE.cpp
diff -u llvm/lib/Transforms/Scalar/GCSE.cpp:1.49 llvm/lib/Transforms/Scalar/GCSE.cpp:1.50
--- llvm/lib/Transforms/Scalar/GCSE.cpp:1.49 Wed Dec 6 11:46:32 2006
+++ llvm/lib/Transforms/Scalar/GCSE.cpp Tue Dec 19 15:40:18 2006
@@ -14,6 +14,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "gcse"
#include "llvm/Transforms/Scalar.h"
#include "llvm/BasicBlock.h"
#include "llvm/Constant.h"
@@ -27,15 +28,14 @@
#include <algorithm>
using namespace llvm;
+STATISTIC(NumInstRemoved, "Number of instructions removed");
+STATISTIC(NumLoadRemoved, "Number of loads removed");
+STATISTIC(NumCallRemoved, "Number of calls removed");
+STATISTIC(NumNonInsts , "Number of instructions removed due "
+ "to non-instruction values");
+STATISTIC(NumArgsRepl , "Number of function arguments replaced "
+ "with constant values");
namespace {
- Statistic NumInstRemoved("gcse", "Number of instructions removed");
- Statistic NumLoadRemoved("gcse", "Number of loads removed");
- Statistic NumCallRemoved("gcse", "Number of calls removed");
- Statistic NumNonInsts ("gcse", "Number of instructions removed due "
- "to non-instruction values");
- Statistic NumArgsRepl ("gcse", "Number of function arguments replaced "
- "with constant values");
-
struct GCSE : public FunctionPass {
virtual bool runOnFunction(Function &F);
Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.97 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.98
--- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.97 Wed Dec 6 11:46:32 2006
+++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Tue Dec 19 15:40:18 2006
@@ -37,6 +37,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "indvars"
#include "llvm/Transforms/Scalar.h"
#include "llvm/BasicBlock.h"
#include "llvm/Constants.h"
@@ -51,13 +52,13 @@
#include "llvm/ADT/Statistic.h"
using namespace llvm;
-namespace {
- Statistic NumRemoved ("indvars", "Number of aux indvars removed");
- Statistic NumPointer ("indvars", "Number of pointer indvars promoted");
- Statistic NumInserted("indvars", "Number of canonical indvars added");
- Statistic NumReplaced("indvars", "Number of exit values replaced");
- Statistic NumLFTR ("indvars", "Number of loop exit tests replaced");
+STATISTIC(NumRemoved , "Number of aux indvars removed");
+STATISTIC(NumPointer , "Number of pointer indvars promoted");
+STATISTIC(NumInserted, "Number of canonical indvars added");
+STATISTIC(NumReplaced, "Number of exit values replaced");
+STATISTIC(NumLFTR , "Number of loop exit tests replaced");
+namespace {
class IndVarSimplify : public FunctionPass {
LoopInfo *LI;
ScalarEvolution *SE;
Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.571 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.572
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.571 Mon Dec 18 02:47:13 2006
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Dec 19 15:40:18 2006
@@ -55,13 +55,13 @@
using namespace llvm;
using namespace llvm::PatternMatch;
-namespace {
- Statistic NumCombined ("instcombine", "Number of insts combined");
- Statistic NumConstProp("instcombine", "Number of constant folds");
- Statistic NumDeadInst ("instcombine", "Number of dead inst eliminated");
- Statistic NumDeadStore("instcombine", "Number of dead stores eliminated");
- Statistic NumSunkInst ("instcombine", "Number of instructions sunk");
+STATISTIC(NumCombined , "Number of insts combined");
+STATISTIC(NumConstProp, "Number of constant folds");
+STATISTIC(NumDeadInst , "Number of dead inst eliminated");
+STATISTIC(NumDeadStore, "Number of dead stores eliminated");
+STATISTIC(NumSunkInst , "Number of instructions sunk");
+namespace {
class VISIBILITY_HIDDEN InstCombiner
: public FunctionPass,
public InstVisitor<InstCombiner, Instruction*> {
Index: llvm/lib/Transforms/Scalar/LICM.cpp
diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.82 llvm/lib/Transforms/Scalar/LICM.cpp:1.83
--- llvm/lib/Transforms/Scalar/LICM.cpp:1.82 Wed Dec 6 11:46:33 2006
+++ llvm/lib/Transforms/Scalar/LICM.cpp Tue Dec 19 15:40:18 2006
@@ -49,18 +49,17 @@
#include <algorithm>
using namespace llvm;
+STATISTIC(NumSunk , "Number of instructions sunk out of loop");
+STATISTIC(NumHoisted , "Number of instructions hoisted out of loop");
+STATISTIC(NumMovedLoads, "Number of load insts hoisted or sunk");
+STATISTIC(NumMovedCalls, "Number of call insts hoisted or sunk");
+STATISTIC(NumPromoted , "Number of memory locations promoted to registers");
+
namespace {
cl::opt<bool>
DisablePromotion("disable-licm-promotion", cl::Hidden,
cl::desc("Disable memory promotion in LICM pass"));
- Statistic NumSunk("licm", "Number of instructions sunk out of loop");
- Statistic NumHoisted("licm", "Number of instructions hoisted out of loop");
- Statistic NumMovedLoads("licm", "Number of load insts hoisted or sunk");
- Statistic NumMovedCalls("licm", "Number of call insts hoisted or sunk");
- Statistic NumPromoted("licm",
- "Number of memory locations promoted to registers");
-
struct LICM : public FunctionPass {
virtual bool runOnFunction(Function &F);
Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.100 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.101
--- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.100 Wed Dec 13 02:06:42 2006
+++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue Dec 19 15:40:18 2006
@@ -37,11 +37,11 @@
#include <set>
using namespace llvm;
-namespace {
- Statistic NumReduced ("loop-reduce", "Number of GEPs strength reduced");
- Statistic NumInserted("loop-reduce", "Number of PHIs inserted");
- Statistic NumVariable("loop-reduce","Number of PHIs with variable strides");
+STATISTIC(NumReduced , "Number of GEPs strength reduced");
+STATISTIC(NumInserted, "Number of PHIs inserted");
+STATISTIC(NumVariable, "Number of PHIs with variable strides");
+namespace {
/// IVStrideUse - Keep track of one use of a strided induction variable, where
/// the stride is stored externally. The Offset member keeps track of the
/// offset from the IV, User is the actual user of the operand, and 'Operand'
Index: llvm/lib/Transforms/Scalar/LoopUnroll.cpp
diff -u llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.32 llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.33
--- llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.32 Wed Dec 6 11:46:33 2006
+++ llvm/lib/Transforms/Scalar/LoopUnroll.cpp Tue Dec 19 15:40:18 2006
@@ -36,9 +36,9 @@
#include <algorithm>
using namespace llvm;
-namespace {
- Statistic NumUnrolled("loop-unroll", "Number of loops completely unrolled");
+STATISTIC(NumUnrolled, "Number of loops completely unrolled");
+namespace {
cl::opt<unsigned>
UnrollThreshold("unroll-threshold", cl::init(100), cl::Hidden,
cl::desc("The cut-off point for loop unrolling"));
Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.51 llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.52
--- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.51 Wed Dec 6 11:46:33 2006
+++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Tue Dec 19 15:40:18 2006
@@ -43,14 +43,13 @@
#include <set>
using namespace llvm;
+STATISTIC(NumBranches, "Number of branches unswitched");
+STATISTIC(NumSwitches, "Number of switches unswitched");
+STATISTIC(NumSelects , "Number of selects unswitched");
+STATISTIC(NumTrivial , "Number of unswitches that are trivial");
+STATISTIC(NumSimplify, "Number of simplifications of unswitched code");
+
namespace {
- Statistic NumBranches("loop-unswitch", "Number of branches unswitched");
- Statistic NumSwitches("loop-unswitch", "Number of switches unswitched");
- Statistic NumSelects ("loop-unswitch", "Number of selects unswitched");
- Statistic NumTrivial ("loop-unswitch",
- "Number of unswitches that are trivial");
- Statistic NumSimplify("loop-unswitch",
- "Number of simplifications of unswitched code");
cl::opt<unsigned>
Threshold("loop-unswitch-threshold", cl::desc("Max loop size to unswitch"),
cl::init(10), cl::Hidden);
Index: llvm/lib/Transforms/Scalar/Reassociate.cpp
diff -u llvm/lib/Transforms/Scalar/Reassociate.cpp:1.68 llvm/lib/Transforms/Scalar/Reassociate.cpp:1.69
--- llvm/lib/Transforms/Scalar/Reassociate.cpp:1.68 Thu Dec 7 14:04:42 2006
+++ llvm/lib/Transforms/Scalar/Reassociate.cpp Tue Dec 19 15:40:18 2006
@@ -35,13 +35,12 @@
#include <algorithm>
using namespace llvm;
-namespace {
- Statistic NumLinear ("reassociate","Number of insts linearized");
- Statistic NumChanged("reassociate","Number of insts reassociated");
- Statistic NumSwapped("reassociate","Number of insts with operands swapped");
- Statistic NumAnnihil("reassociate","Number of expr tree annihilated");
- Statistic NumFactor ("reassociate","Number of multiplies factored");
+STATISTIC(NumLinear , "Number of insts linearized");
+STATISTIC(NumChanged, "Number of insts reassociated");
+STATISTIC(NumAnnihil, "Number of expr tree annihilated");
+STATISTIC(NumFactor , "Number of multiplies factored");
+namespace {
struct ValueEntry {
unsigned Rank;
Value *Op;
Index: llvm/lib/Transforms/Scalar/Reg2Mem.cpp
diff -u llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.8 llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.9
--- llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.8 Wed Dec 6 11:46:33 2006
+++ llvm/lib/Transforms/Scalar/Reg2Mem.cpp Tue Dec 19 15:40:18 2006
@@ -16,6 +16,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "reg2mem"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Pass.h"
@@ -24,14 +25,12 @@
#include "llvm/BasicBlock.h"
#include "llvm/Instructions.h"
#include "llvm/ADT/Statistic.h"
-
#include <list>
-
using namespace llvm;
+STATISTIC(NumDemoted, "Number of registers demoted");
+
namespace {
- Statistic NumDemoted("reg2mem", "Number of registers demoted");
-
struct RegToMem : public FunctionPass {
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
Index: llvm/lib/Transforms/Scalar/SCCP.cpp
diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.141 llvm/lib/Transforms/Scalar/SCCP.cpp:1.142
--- llvm/lib/Transforms/Scalar/SCCP.cpp:1.141 Mon Dec 11 23:04:59 2006
+++ llvm/lib/Transforms/Scalar/SCCP.cpp Tue Dec 19 15:40:18 2006
@@ -39,6 +39,16 @@
#include <set>
using namespace llvm;
+STATISTIC(NumInstRemoved, "Number of instructions removed");
+STATISTIC(NumDeadBlocks , "Number of basic blocks unreachable");
+
+STATISTIC(IPNumInstRemoved, "Number ofinstructions removed by IPSCCP");
+STATISTIC(IPNumDeadBlocks , "Number of basic blocks unreachable by IPSCCP");
+STATISTIC(IPNumArgsElimed ,"Number of arguments constant propagated by IPSCCP");
+STATISTIC(IPNumGlobalConst, "Number of globals found to be constant by IPSCCP");
+
+
+
// LatticeVal class - This class represents the different lattice values that an
// instruction may occupy. It is a simple class with value semantics.
//
@@ -1081,9 +1091,6 @@
namespace {
- Statistic NumInstRemoved("sccp", "Number of instructions removed");
- Statistic NumDeadBlocks ("sccp", "Number of basic blocks unreachable");
-
//===--------------------------------------------------------------------===//
//
/// SCCP Class - This class uses the SCCPSolver to implement a per-function
@@ -1192,13 +1199,6 @@
}
namespace {
- Statistic IPNumInstRemoved("ipsccp", "Number of instructions removed");
- Statistic IPNumDeadBlocks ("ipsccp", "Number of basic blocks unreachable");
- Statistic IPNumArgsElimed ("ipsccp",
- "Number of arguments constant propagated");
- Statistic IPNumGlobalConst("ipsccp",
- "Number of globals found to be constant");
-
//===--------------------------------------------------------------------===//
//
/// IPSCCP Class - This class implements interprocedural Sparse Conditional
Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.58 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.59
--- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.58 Fri Dec 15 01:32:38 2006
+++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Tue Dec 19 15:40:18 2006
@@ -19,6 +19,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "scalarrepl"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
@@ -36,12 +37,11 @@
#include "llvm/ADT/StringExtras.h"
using namespace llvm;
-namespace {
- Statistic NumReplaced("scalarrepl", "Number of allocas broken up");
- Statistic NumPromoted("scalarrepl", "Number of allocas promoted");
- Statistic NumConverted("scalarrepl",
- "Number of aggregates converted to scalar");
+STATISTIC(NumReplaced, "Number of allocas broken up");
+STATISTIC(NumPromoted, "Number of allocas promoted");
+STATISTIC(NumConverted, "Number of aggregates converted to scalar");
+namespace {
struct VISIBILITY_HIDDEN SROA : public FunctionPass {
bool runOnFunction(Function &F);
Index: llvm/lib/Transforms/Scalar/SimplifyCFG.cpp
diff -u llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.17 llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.18
--- llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.17 Fri Dec 8 15:52:01 2006
+++ llvm/lib/Transforms/Scalar/SimplifyCFG.cpp Tue Dec 19 15:40:18 2006
@@ -18,6 +18,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "simplifycfg"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Constants.h"
@@ -29,9 +30,9 @@
#include <set>
using namespace llvm;
-namespace {
- Statistic NumSimpl("cfgsimplify", "Number of blocks simplified");
+STATISTIC(NumSimpl, "Number of blocks simplified");
+namespace {
struct CFGSimplifyPass : public FunctionPass {
virtual bool runOnFunction(Function &F);
};
Index: llvm/lib/Transforms/Scalar/TailDuplication.cpp
diff -u llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.35 llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.36
--- llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.35 Wed Dec 6 11:46:33 2006
+++ llvm/lib/Transforms/Scalar/TailDuplication.cpp Tue Dec 19 15:40:18 2006
@@ -33,14 +33,12 @@
#include "llvm/ADT/Statistic.h"
using namespace llvm;
+STATISTIC(NumEliminated, "Number of unconditional branches eliminated");
+
namespace {
cl::opt<unsigned>
Threshold("taildup-threshold", cl::desc("Max block size to tail duplicate"),
cl::init(6), cl::Hidden);
- Statistic NumEliminated("tailduplicate",
- "Number of unconditional branches eliminated");
- Statistic NumPHINodes("tailduplicate", "Number of phi nodes inserted");
-
class TailDup : public FunctionPass {
bool runOnFunction(Function &F);
private:
Index: llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
diff -u llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.26 llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.27
--- llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.26 Wed Dec 6 11:46:33 2006
+++ llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp Tue Dec 19 15:40:18 2006
@@ -50,6 +50,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "tailcallelim"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
@@ -60,10 +61,10 @@
#include "llvm/ADT/Statistic.h"
using namespace llvm;
-namespace {
- Statistic NumEliminated("tailcallelim", "Number of tail calls removed");
- Statistic NumAccumAdded("tailcallelim","Number of accumulators introduced");
+STATISTIC(NumEliminated, "Number of tail calls removed");
+STATISTIC(NumAccumAdded, "Number of accumulators introduced");
+namespace {
struct TailCallElim : public FunctionPass {
virtual bool runOnFunction(Function &F);
More information about the llvm-commits
mailing list