[llvm-commits] CVS: llvm/lib/Analysis/InstCount.cpp ScalarEvolution.cpp
Chris Lattner
sabre at nondot.org
Tue Dec 19 14:30:50 PST 2006
Changes in directory llvm/lib/Analysis:
InstCount.cpp updated: 1.18 -> 1.19
ScalarEvolution.cpp updated: 1.73 -> 1.74
---
Log message:
eliminate static ctors from Statistics
---
Diffs of the changes: (+27 -29)
InstCount.cpp | 14 ++++++++------
ScalarEvolution.cpp | 42 +++++++++++++++++++-----------------------
2 files changed, 27 insertions(+), 29 deletions(-)
Index: llvm/lib/Analysis/InstCount.cpp
diff -u llvm/lib/Analysis/InstCount.cpp:1.18 llvm/lib/Analysis/InstCount.cpp:1.19
--- llvm/lib/Analysis/InstCount.cpp:1.18 Wed Dec 6 19:30:31 2006
+++ llvm/lib/Analysis/InstCount.cpp Tue Dec 19 16:30:33 2006
@@ -11,6 +11,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "instcount"
#include "llvm/Analysis/Passes.h"
#include "llvm/Pass.h"
#include "llvm/Function.h"
@@ -20,17 +21,18 @@
#include <ostream>
using namespace llvm;
-namespace {
- Statistic TotalInsts ("instcount", "Number of instructions (of all types)");
- Statistic TotalBlocks("instcount", "Number of basic blocks");
- Statistic TotalFuncs ("instcount", "Number of non-external functions");
- Statistic TotalMemInst("instcount", "Number of memory instructions");
+STATISTIC(TotalInsts , "Number of instructions (of all types)");
+STATISTIC(TotalBlocks, "Number of basic blocks");
+STATISTIC(TotalFuncs , "Number of non-external functions");
+STATISTIC(TotalMemInst, "Number of memory instructions");
#define HANDLE_INST(N, OPCODE, CLASS) \
- Statistic Num##OPCODE##Inst("instcount", "Number of " #OPCODE " insts");
+ STATISTIC(Num ## OPCODE ## Inst, "Number of " #OPCODE " insts");
#include "llvm/Instruction.def"
+
+namespace {
class InstCount : public FunctionPass, public InstVisitor<InstCount> {
friend class InstVisitor<InstCount>;
Index: llvm/lib/Analysis/ScalarEvolution.cpp
diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.73 llvm/lib/Analysis/ScalarEvolution.cpp:1.74
--- llvm/lib/Analysis/ScalarEvolution.cpp:1.73 Mon Dec 18 19:16:02 2006
+++ llvm/lib/Analysis/ScalarEvolution.cpp Tue Dec 19 16:30:33 2006
@@ -59,6 +59,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "scalar-evolution"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
@@ -82,32 +83,27 @@
#include <cmath>
using namespace llvm;
+STATISTIC(NumBruteForceEvaluations,
+ "Number of brute force evaluations needed to "
+ "calculate high-order polynomial exit values");
+STATISTIC(NumArrayLenItCounts,
+ "Number of trip counts computed with array length");
+STATISTIC(NumTripCountsComputed,
+ "Number of loops with predictable loop counts");
+STATISTIC(NumTripCountsNotComputed,
+ "Number of loops without predictable loop counts");
+STATISTIC(NumBruteForceTripCountsComputed,
+ "Number of loops with trip counts computed by force");
+
+cl::opt<unsigned>
+MaxBruteForceIterations("scalar-evolution-max-iterations", cl::ReallyHidden,
+ cl::desc("Maximum number of iterations SCEV will "
+ "symbolically execute a constant derived loop"),
+ cl::init(100));
+
namespace {
RegisterPass<ScalarEvolution>
R("scalar-evolution", "Scalar Evolution Analysis");
-
- Statistic
- NumBruteForceEvaluations("scalar-evolution",
- "Number of brute force evaluations needed to "
- "calculate high-order polynomial exit values");
- Statistic
- NumArrayLenItCounts("scalar-evolution",
- "Number of trip counts computed with array length");
- Statistic
- NumTripCountsComputed("scalar-evolution",
- "Number of loops with predictable loop counts");
- Statistic
- NumTripCountsNotComputed("scalar-evolution",
- "Number of loops without predictable loop counts");
- Statistic
- NumBruteForceTripCountsComputed("scalar-evolution",
- "Number of loops with trip counts computed by force");
-
- cl::opt<unsigned>
- MaxBruteForceIterations("scalar-evolution-max-iterations", cl::ReallyHidden,
- cl::desc("Maximum number of iterations SCEV will "
- "symbolically execute a constant derived loop"),
- cl::init(100));
}
//===----------------------------------------------------------------------===//
More information about the llvm-commits
mailing list