llvm.org GIT mirror llvm / 3b27d68
eliminate static ctors from Statistics git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32697 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 13 years ago
4 changed file(s) with 41 addition(s) and 56 deletion(s). Raw diff Collapse all Expand all
6363 #include
6464 using namespace llvm;
6565
66 STATISTIC(NumIters , "Number of iterations to reach convergence");
67 STATISTIC(NumConstraints , "Number of constraints");
68 STATISTIC(NumNodes , "Number of nodes");
69 STATISTIC(NumEscapingFunctions, "Number of internal functions that escape");
70 STATISTIC(NumIndirectCallees , "Number of indirect callees found");
71
6672 namespace {
67 Statistic
68 NumIters("anders-aa", "Number of iterations to reach convergence");
69 Statistic
70 NumConstraints("anders-aa", "Number of constraints");
71 Statistic
72 NumNodes("anders-aa", "Number of nodes");
73 Statistic
74 NumEscapingFunctions("anders-aa", "Number of internal functions that escape");
75 Statistic
76 NumIndirectCallees("anders-aa", "Number of indirect callees found");
77
7873 class Andersens : public ModulePass, public AliasAnalysis,
7974 private InstVisitor {
8075 /// Node class - This class is used to represent a memory object in the
1313 //
1414 //===----------------------------------------------------------------------===//
1515
16 #define DEBUG_TYPE "globalsmodref-aa"
1617 #include "llvm/Analysis/Passes.h"
1718 #include "llvm/Module.h"
1819 #include "llvm/Pass.h"
2829 #include
2930 using namespace llvm;
3031
32 STATISTIC(NumNonAddrTakenGlobalVars,
33 "Number of global vars without address taken");
34 STATISTIC(NumNonAddrTakenFunctions,"Number of functions without address taken");
35 STATISTIC(NumNoMemFunctions, "Number of functions that do not access memory");
36 STATISTIC(NumReadMemFunctions, "Number of functions that only read memory");
37 STATISTIC(NumIndirectGlobalVars, "Number of indirect global objects");
38
3139 namespace {
32 Statistic
33 NumNonAddrTakenGlobalVars("globalsmodref-aa",
34 "Number of global vars without address taken");
35 Statistic
36 NumNonAddrTakenFunctions("globalsmodref-aa",
37 "Number of functions without address taken");
38 Statistic
39 NumNoMemFunctions("globalsmodref-aa",
40 "Number of functions that do not access memory");
41 Statistic
42 NumReadMemFunctions("globalsmodref-aa",
43 "Number of functions that only read memory");
44 Statistic
45 NumIndirectGlobalVars("globalsmodref-aa",
46 "Number of indirect global objects");
47
4840 /// FunctionRecord - One instance of this structure is stored for every
4941 /// function in the program. Later, the entries for these functions are
5042 /// removed if the function is found to call an external function (in which
1010 //
1111 //===----------------------------------------------------------------------===//
1212
13 #define DEBUG_TYPE "instcount"
1314 #include "llvm/Analysis/Passes.h"
1415 #include "llvm/Pass.h"
1516 #include "llvm/Function.h"
1920 #include
2021 using namespace llvm;
2122
22 namespace {
23 Statistic TotalInsts ("instcount", "Number of instructions (of all types)");
24 Statistic TotalBlocks("instcount", "Number of basic blocks");
25 Statistic TotalFuncs ("instcount", "Number of non-external functions");
26 Statistic TotalMemInst("instcount", "Number of memory instructions");
23 STATISTIC(TotalInsts , "Number of instructions (of all types)");
24 STATISTIC(TotalBlocks, "Number of basic blocks");
25 STATISTIC(TotalFuncs , "Number of non-external functions");
26 STATISTIC(TotalMemInst, "Number of memory instructions");
2727
2828 #define HANDLE_INST(N, OPCODE, CLASS) \
29 Statistic Num##OPCODE##Inst("instcount", "Number of " #OPCODE " insts");
29 STATISTIC(Num ## OPCODE ## Inst, "Number of " #OPCODE " insts");
3030
3131 #include "llvm/Instruction.def"
3232
33
34 namespace {
3335 class InstCount : public FunctionPass, public InstVisitor {
3436 friend class InstVisitor;
3537
5858 //
5959 //===----------------------------------------------------------------------===//
6060
61 #define DEBUG_TYPE "scalar-evolution"
6162 #include "llvm/Analysis/ScalarEvolutionExpressions.h"
6263 #include "llvm/Constants.h"
6364 #include "llvm/DerivedTypes.h"
8182 #include
8283 using namespace llvm;
8384
85 STATISTIC(NumBruteForceEvaluations,
86 "Number of brute force evaluations needed to "
87 "calculate high-order polynomial exit values");
88 STATISTIC(NumArrayLenItCounts,
89 "Number of trip counts computed with array length");
90 STATISTIC(NumTripCountsComputed,
91 "Number of loops with predictable loop counts");
92 STATISTIC(NumTripCountsNotComputed,
93 "Number of loops without predictable loop counts");
94 STATISTIC(NumBruteForceTripCountsComputed,
95 "Number of loops with trip counts computed by force");
96
97 cl::opt
98 MaxBruteForceIterations("scalar-evolution-max-iterations", cl::ReallyHidden,
99 cl::desc("Maximum number of iterations SCEV will "
100 "symbolically execute a constant derived loop"),
101 cl::init(100));
102
84103 namespace {
85104 RegisterPass
86105 R("scalar-evolution", "Scalar Evolution Analysis");
87
88 Statistic
89 NumBruteForceEvaluations("scalar-evolution",
90 "Number of brute force evaluations needed to "
91 "calculate high-order polynomial exit values");
92 Statistic
93 NumArrayLenItCounts("scalar-evolution",
94 "Number of trip counts computed with array length");
95 Statistic
96 NumTripCountsComputed("scalar-evolution",
97 "Number of loops with predictable loop counts");
98 Statistic
99 NumTripCountsNotComputed("scalar-evolution",
100 "Number of loops without predictable loop counts");
101 Statistic
102 NumBruteForceTripCountsComputed("scalar-evolution",
103 "Number of loops with trip counts computed by force");
104
105 cl::opt
106 MaxBruteForceIterations("scalar-evolution-max-iterations", cl::ReallyHidden,
107 cl::desc("Maximum number of iterations SCEV will "
108 "symbolically execute a constant derived loop"),
109 cl::init(100));
110106 }
111107
112108 //===----------------------------------------------------------------------===//