aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/ADT/Statistic.h39
-rw-r--r--lib/Analysis/DataStructure/BottomUpClosure.cpp6
-rw-r--r--lib/Analysis/DataStructure/CallTargets.cpp8
-rw-r--r--lib/Analysis/DataStructure/CompleteBottomUp.cpp2
-rw-r--r--lib/Analysis/DataStructure/DataStructure.cpp12
-rw-r--r--lib/Analysis/DataStructure/DataStructureOpt.cpp4
-rw-r--r--lib/Analysis/DataStructure/DataStructureStats.cpp10
-rw-r--r--lib/Analysis/DataStructure/EquivClassGraphs.cpp4
-rw-r--r--lib/Analysis/DataStructure/Printer.cpp4
-rw-r--r--lib/Analysis/DataStructure/TopDownClosure.cpp2
-rw-r--r--lib/Analysis/IPA/Andersens.cpp10
-rw-r--r--lib/Analysis/IPA/GlobalsModRef.cpp10
-rw-r--r--lib/Analysis/InstCount.cpp10
-rw-r--r--lib/Analysis/ScalarEvolution.cpp10
-rw-r--r--lib/Bytecode/Writer/Writer.cpp2
-rw-r--r--lib/CodeGen/BranchFolding.cpp6
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp10
-rw-r--r--lib/CodeGen/PHIElimination.cpp4
-rw-r--r--lib/CodeGen/RegAllocLinearScan.cpp4
-rw-r--r--lib/CodeGen/RegAllocLocal.cpp6
-rw-r--r--lib/CodeGen/RegAllocSimple.cpp4
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp6
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp4
-rw-r--r--lib/CodeGen/TwoAddressInstructionPass.cpp6
-rw-r--r--lib/CodeGen/VirtRegMap.cpp12
-rw-r--r--lib/ExecutionEngine/ExecutionEngine.cpp4
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp2
-rw-r--r--lib/ExecutionEngine/JIT/JITEmitter.cpp4
-rw-r--r--lib/Support/Statistic.cpp4
-rw-r--r--lib/Support/Timer.cpp2
-rw-r--r--lib/Target/ARM/ARMAsmPrinter.cpp2
-rw-r--r--lib/Target/Alpha/AlphaAsmPrinter.cpp2
-rw-r--r--lib/Target/Alpha/AlphaCodeEmitter.cpp2
-rw-r--r--lib/Target/Alpha/AlphaLLRP.cpp4
-rw-r--r--lib/Target/IA64/IA64AsmPrinter.cpp2
-rw-r--r--lib/Target/IA64/IA64Bundling.cpp2
-rw-r--r--lib/Target/IA64/IA64ISelDAGToDAG.cpp4
-rw-r--r--lib/Target/PowerPC/PPCAsmPrinter.cpp2
-rw-r--r--lib/Target/PowerPC/PPCBranchSelector.cpp2
-rw-r--r--lib/Target/PowerPC/PPCISelDAGToDAG.cpp2
-rw-r--r--lib/Target/Sparc/DelaySlotFiller.cpp2
-rw-r--r--lib/Target/Sparc/FPMover.cpp4
-rw-r--r--lib/Target/Sparc/SparcAsmPrinter.cpp2
-rw-r--r--lib/Target/X86/X86AsmPrinter.cpp2
-rwxr-xr-xlib/Target/X86/X86AsmPrinter.h2
-rw-r--r--lib/Target/X86/X86CodeEmitter.cpp2
-rw-r--r--lib/Target/X86/X86FloatingPoint.cpp4
-rw-r--r--lib/Target/X86/X86ISelDAGToDAG.cpp4
-rw-r--r--lib/Transforms/Hello/Hello.cpp2
-rw-r--r--lib/Transforms/IPO/ArgumentPromotion.cpp6
-rw-r--r--lib/Transforms/IPO/ConstantMerge.cpp2
-rw-r--r--lib/Transforms/IPO/DeadArgumentElimination.cpp4
-rw-r--r--lib/Transforms/IPO/DeadTypeElimination.cpp2
-rw-r--r--lib/Transforms/IPO/FunctionResolution.cpp4
-rw-r--r--lib/Transforms/IPO/GlobalDCE.cpp4
-rw-r--r--lib/Transforms/IPO/GlobalOpt.cpp22
-rw-r--r--lib/Transforms/IPO/IPConstantPropagation.cpp4
-rw-r--r--lib/Transforms/IPO/IndMemRemoval.cpp4
-rw-r--r--lib/Transforms/IPO/Inliner.cpp4
-rw-r--r--lib/Transforms/IPO/Internalize.cpp4
-rw-r--r--lib/Transforms/IPO/LoopExtractor.cpp2
-rw-r--r--lib/Transforms/IPO/LowerSetJmp.cpp8
-rw-r--r--lib/Transforms/IPO/PruneEH.cpp4
-rw-r--r--lib/Transforms/IPO/RaiseAllocations.cpp2
-rw-r--r--lib/Transforms/IPO/SimplifyLibCalls.cpp4
-rw-r--r--lib/Transforms/Instrumentation/RSProfiling.cpp2
-rw-r--r--lib/Transforms/LevelRaise.cpp12
-rw-r--r--lib/Transforms/Scalar/ADCE.cpp6
-rw-r--r--lib/Transforms/Scalar/BasicBlockPlacement.cpp2
-rw-r--r--lib/Transforms/Scalar/CondPropagate.cpp4
-rw-r--r--lib/Transforms/Scalar/ConstantProp.cpp2
-rw-r--r--lib/Transforms/Scalar/CorrelatedExprs.cpp6
-rw-r--r--lib/Transforms/Scalar/DCE.cpp4
-rw-r--r--lib/Transforms/Scalar/DeadStoreElimination.cpp4
-rw-r--r--lib/Transforms/Scalar/GCSE.cpp10
-rw-r--r--lib/Transforms/Scalar/IndVarSimplify.cpp10
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp10
-rw-r--r--lib/Transforms/Scalar/LICM.cpp10
-rw-r--r--lib/Transforms/Scalar/LoopStrengthReduce.cpp6
-rw-r--r--lib/Transforms/Scalar/LoopUnroll.cpp2
-rw-r--r--lib/Transforms/Scalar/LoopUnswitch.cpp10
-rw-r--r--lib/Transforms/Scalar/PredicateSimplifier.cpp6
-rw-r--r--lib/Transforms/Scalar/Reassociate.cpp10
-rw-r--r--lib/Transforms/Scalar/Reg2Mem.cpp2
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp12
-rw-r--r--lib/Transforms/Scalar/ScalarReplAggregates.cpp6
-rw-r--r--lib/Transforms/Scalar/SimplifyCFG.cpp2
-rw-r--r--lib/Transforms/Scalar/TailDuplication.cpp4
-rw-r--r--lib/Transforms/Scalar/TailRecursionElimination.cpp4
-rw-r--r--lib/Transforms/Utils/BreakCriticalEdges.cpp2
-rw-r--r--lib/Transforms/Utils/LCSSA.cpp2
-rw-r--r--lib/Transforms/Utils/LoopSimplify.cpp4
-rw-r--r--lib/Transforms/Utils/LowerAllocations.cpp2
-rw-r--r--lib/Transforms/Utils/LowerInvoke.cpp6
-rw-r--r--lib/Transforms/Utils/LowerSelect.cpp2
-rw-r--r--lib/Transforms/Utils/LowerSwitch.cpp2
-rw-r--r--lib/Transforms/Utils/Mem2Reg.cpp2
97 files changed, 252 insertions, 255 deletions
diff --git a/include/llvm/ADT/Statistic.h b/include/llvm/ADT/Statistic.h
index 99160da106..332a57d121 100644
--- a/include/llvm/ADT/Statistic.h
+++ b/include/llvm/ADT/Statistic.h
@@ -8,17 +8,19 @@
//===----------------------------------------------------------------------===//
//
// This file defines the 'Statistic' class, which is designed to be an easy way
-// to expose various success metrics from passes. These statistics are printed
-// at the end of a run, when the -stats command line option is enabled on the
-// command line.
+// to expose various metrics from passes. These statistics are printed at the
+// end of a run (from llvm_shutdown), when the -stats command line option is
+// passed on the command line.
//
// This is useful for reporting information like the number of instructions
// simplified, optimized or removed by various transformations, like this:
//
-// static Statistic<> NumInstsKilled("gcse", "Number of instructions killed");
+// static Statistic NumInstsKilled("gcse", "Number of instructions killed");
//
// Later, in the code: ++NumInstsKilled;
//
+// NOTE: Statistics *must* be declared as global variables.
+//
//===----------------------------------------------------------------------===//
#ifndef LLVM_ADT_STATISTIC_H
@@ -29,7 +31,7 @@
namespace llvm {
-// StatisticBase - Nontemplated base class for Statistic<> class...
+// StatisticBase - Nontemplated base class for Statistic class...
class StatisticBase {
const char *Name;
const char *Desc;
@@ -55,39 +57,36 @@ protected:
};
// Statistic Class - templated on the data type we are monitoring...
-template <typename DataType=unsigned>
class Statistic : private StatisticBase {
- DataType Value;
+ unsigned Value;
virtual void printValue(std::ostream &o) const { o << Value; }
- virtual bool hasSomeData() const { return Value != DataType(); }
+ virtual bool hasSomeData() const { return Value != 0; }
public:
// Normal constructor, default initialize data item...
Statistic(const char *name, const char *desc)
- : StatisticBase(name, desc), Value(DataType()) {}
+ : StatisticBase(name, desc), Value(0) {}
// Constructor to provide an initial value...
- Statistic(const DataType &Val, const char *name, const char *desc)
+ Statistic(const unsigned &Val, const char *name, const char *desc)
: StatisticBase(name, desc), Value(Val) {}
// Print information when destroyed, iff command line option is specified
~Statistic() { destroy(); }
// Allow use of this class as the value itself...
- operator DataType() const { return Value; }
- const Statistic &operator=(DataType Val) { Value = Val; return *this; }
+ operator unsigned() const { return Value; }
+ const Statistic &operator=(unsigned Val) { Value = Val; return *this; }
const Statistic &operator++() { ++Value; return *this; }
- DataType operator++(int) { return Value++; }
+ unsigned operator++(int) { return Value++; }
const Statistic &operator--() { --Value; return *this; }
- DataType operator--(int) { return Value--; }
- const Statistic &operator+=(const DataType &V) { Value += V; return *this; }
- const Statistic &operator-=(const DataType &V) { Value -= V; return *this; }
- const Statistic &operator*=(const DataType &V) { Value *= V; return *this; }
- const Statistic &operator/=(const DataType &V) { Value /= V; return *this; }
+ unsigned operator--(int) { return Value--; }
+ const Statistic &operator+=(const unsigned &V) { Value += V; return *this; }
+ const Statistic &operator-=(const unsigned &V) { Value -= V; return *this; }
+ const Statistic &operator*=(const unsigned &V) { Value *= V; return *this; }
+ const Statistic &operator/=(const unsigned &V) { Value /= V; return *this; }
};
-EXTERN_TEMPLATE_INSTANTIATION(class Statistic<unsigned>);
-
} // End llvm namespace
#endif
diff --git a/lib/Analysis/DataStructure/BottomUpClosure.cpp b/lib/Analysis/DataStructure/BottomUpClosure.cpp
index 19b3ec1533..f5ca5fd6f5 100644
--- a/lib/Analysis/DataStructure/BottomUpClosure.cpp
+++ b/lib/Analysis/DataStructure/BottomUpClosure.cpp
@@ -26,9 +26,9 @@
using namespace llvm;
namespace {
- Statistic<> MaxSCC("budatastructure", "Maximum SCC Size in Call Graph");
- Statistic<> NumBUInlines("budatastructures", "Number of graphs inlined");
- Statistic<> NumCallEdges("budatastructures", "Number of 'actual' call edges");
+ Statistic MaxSCC("budatastructure", "Maximum SCC Size in Call Graph");
+ Statistic NumBUInlines("budatastructures", "Number of graphs inlined");
+ Statistic NumCallEdges("budatastructures", "Number of 'actual' call edges");
cl::opt<bool>
AddGlobals("budatastructures-annotate-calls", cl::Hidden,
diff --git a/lib/Analysis/DataStructure/CallTargets.cpp b/lib/Analysis/DataStructure/CallTargets.cpp
index 5850749c6f..5ed4457418 100644
--- a/lib/Analysis/DataStructure/CallTargets.cpp
+++ b/lib/Analysis/DataStructure/CallTargets.cpp
@@ -29,10 +29,10 @@
using namespace llvm;
namespace {
- Statistic<> DirCall("calltarget", "Number of direct calls");
- Statistic<> IndCall("calltarget", "Number of indirect calls");
- Statistic<> CompleteInd("calltarget", "Number of complete indirect calls");
- Statistic<> CompleteEmpty("calltarget", "Number of complete empty calls");
+ Statistic DirCall("calltarget", "Number of direct calls");
+ Statistic IndCall("calltarget", "Number of indirect calls");
+ Statistic CompleteInd("calltarget", "Number of complete indirect calls");
+ Statistic CompleteEmpty("calltarget", "Number of complete empty calls");
RegisterPass<CallTargetFinder> X("calltarget","Find Call Targets (uses DSA)");
}
diff --git a/lib/Analysis/DataStructure/CompleteBottomUp.cpp b/lib/Analysis/DataStructure/CompleteBottomUp.cpp
index aea113d97d..af33e0d741 100644
--- a/lib/Analysis/DataStructure/CompleteBottomUp.cpp
+++ b/lib/Analysis/DataStructure/CompleteBottomUp.cpp
@@ -26,7 +26,7 @@ using namespace llvm;
namespace {
RegisterPass<CompleteBUDataStructures>
X("cbudatastructure", "'Complete' Bottom-up Data Structure Analysis");
- Statistic<> NumCBUInlines("cbudatastructures", "Number of graphs inlined");
+ Statistic NumCBUInlines("cbudatastructures", "Number of graphs inlined");
}
diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp
index 6eee541aeb..80237c4f0b 100644
--- a/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/lib/Analysis/DataStructure/DataStructure.cpp
@@ -34,12 +34,12 @@ using namespace llvm;
#define COLLAPSE_ARRAYS_AGGRESSIVELY 0
namespace {
- Statistic<> NumFolds ("dsa", "Number of nodes completely folded");
- Statistic<> NumCallNodesMerged("dsa", "Number of call nodes merged");
- Statistic<> NumNodeAllocated ("dsa", "Number of nodes allocated");
- Statistic<> NumDNE ("dsa", "Number of nodes removed by reachability");
- Statistic<> NumTrivialDNE ("dsa", "Number of nodes trivially removed");
- Statistic<> NumTrivialGlobalDNE("dsa", "Number of globals trivially removed");
+ Statistic NumFolds ("dsa", "Number of nodes completely folded");
+ Statistic NumCallNodesMerged("dsa", "Number of call nodes merged");
+ Statistic NumNodeAllocated ("dsa", "Number of nodes allocated");
+ Statistic NumDNE ("dsa", "Number of nodes removed by reachability");
+ Statistic NumTrivialDNE ("dsa", "Number of nodes trivially removed");
+ Statistic NumTrivialGlobalDNE("dsa", "Number of globals trivially removed");
static cl::opt<unsigned>
DSAFieldLimit("dsa-field-limit", cl::Hidden,
cl::desc("Number of fields to track before collapsing a node"),
diff --git a/lib/Analysis/DataStructure/DataStructureOpt.cpp b/lib/Analysis/DataStructure/DataStructureOpt.cpp
index 56748832ab..85da1763ac 100644
--- a/lib/Analysis/DataStructure/DataStructureOpt.cpp
+++ b/lib/Analysis/DataStructure/DataStructureOpt.cpp
@@ -22,9 +22,9 @@
using namespace llvm;
namespace {
- Statistic<>
+ Statistic
NumGlobalsConstanted("ds-opt", "Number of globals marked constant");
- Statistic<>
+ Statistic
NumGlobalsIsolated("ds-opt", "Number of globals with references dropped");
class DSOpt : public ModulePass {
diff --git a/lib/Analysis/DataStructure/DataStructureStats.cpp b/lib/Analysis/DataStructure/DataStructureStats.cpp
index 469ab2e719..f7fbe3b33c 100644
--- a/lib/Analysis/DataStructure/DataStructureStats.cpp
+++ b/lib/Analysis/DataStructure/DataStructureStats.cpp
@@ -23,19 +23,19 @@
using namespace llvm;
namespace {
- Statistic<> TotalNumCallees("totalcallees",
+ Statistic TotalNumCallees("totalcallees",
"Total number of callee functions at all indirect call sites");
- Statistic<> NumIndirectCalls("numindirect",
+ Statistic NumIndirectCalls("numindirect",
"Total number of indirect call sites in the program");
- Statistic<> NumPoolNodes("numpools",
+ Statistic NumPoolNodes("numpools",
"Number of allocation nodes that could be pool allocated");
// Typed/Untyped memory accesses: If DSA can infer that the types the loads
// and stores are accessing are correct (ie, the node has not been collapsed),
// increment the appropriate counter.
- Statistic<> NumTypedMemAccesses("numtypedmemaccesses",
+ Statistic NumTypedMemAccesses("numtypedmemaccesses",
"Number of loads/stores which are fully typed");
- Statistic<> NumUntypedMemAccesses("numuntypedmemaccesses",
+ Statistic NumUntypedMemAccesses("numuntypedmemaccesses",
"Number of loads/stores which are untyped");
class DSGraphStats : public FunctionPass, public InstVisitor<DSGraphStats> {
diff --git a/lib/Analysis/DataStructure/EquivClassGraphs.cpp b/lib/Analysis/DataStructure/EquivClassGraphs.cpp
index 38aaf0b93c..49c93ffc4f 100644
--- a/lib/Analysis/DataStructure/EquivClassGraphs.cpp
+++ b/lib/Analysis/DataStructure/EquivClassGraphs.cpp
@@ -31,9 +31,9 @@ using namespace llvm;
namespace {
RegisterPass<EquivClassGraphs> X("eqdatastructure",
"Equivalence-class Bottom-up Data Structure Analysis");