//===----------------------------------------------------------------------===//
//
// 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
namespace llvm {
-// StatisticBase - Nontemplated base class for Statistic<> class...
+// StatisticBase - Nontemplated base class for Statistic class...
class StatisticBase {
const char *Name;
const char *Desc;
};
// 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
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,
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)");
}
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");
}
#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"),
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 {
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> {
namespace {
RegisterPass<EquivClassGraphs> X("eqdatastructure",
"Equivalence-class Bottom-up Data Structure Analysis");
- Statistic<> NumEquivBUInlines("equivdatastructures",
+ Statistic NumEquivBUInlines("equivdatastructures",
"Number of graphs inlined");
- Statistic<> NumFoldGraphInlines("Inline equiv-class graphs bottom up",
+ Statistic NumFoldGraphInlines("Inline equiv-class graphs bottom up",
"Number of graphs inlined");
}
namespace {
cl::opt<bool> OnlyPrintMain("only-print-main-ds", cl::ReallyHidden);
cl::opt<bool> DontPrintAnything("dont-print-ds", cl::ReallyHidden);
- Statistic<> MaxGraphSize ("dsa", "Maximum graph size");
- Statistic<> NumFoldedNodes ("dsa", "Number of folded nodes (in final graph)");
+ Statistic MaxGraphSize ("dsa", "Maximum graph size");
+ Statistic NumFoldedNodes ("dsa", "Number of folded nodes (in final graph)");
}
void DSNode::dump() const { print(llvm_cerr, 0); }
RegisterPass<TDDataStructures> // Register the pass
Y("tddatastructure", "Top-down Data Structure Analysis");
- Statistic<> NumTDInlines("tddatastructures", "Number of graphs inlined");
+ Statistic NumTDInlines("tddatastructures", "Number of graphs inlined");
}
void TDDataStructures::markReachableFunctionsExternallyAccessible(DSNode *N,
using namespace llvm;
namespace {
- Statistic<>
+ Statistic
NumIters("anders-aa", "Number of iterations to reach convergence");
- Statistic<>
+ Statistic
NumConstraints("anders-aa", "Number of constraints");
- Statistic<>
+ Statistic
NumNodes("anders-aa", "Number of nodes");
- Statistic<>
+ Statistic
NumEscapingFunctions("anders-aa", "Number of internal functions that escape");
- Statistic<>
+ Statistic
NumIndirectCallees("anders-aa", "Number of indirect callees found");
class Andersens : public ModulePass, public AliasAnalysis,
using namespace llvm;
namespace {
- Statistic<>
+ Statistic
NumNonAddrTakenGlobalVars("globalsmodref-aa",
"Number of global vars without address taken");
- Statistic<>
+ Statistic
NumNonAddrTakenFunctions("globalsmodref-aa",
"Number of functions without address taken");
- Statistic<>
+ Statistic
NumNoMemFunctions("globalsmodref-aa",
"Number of functions that do not access memory");
- Statistic<>
+ Statistic
NumReadMemFunctions("globalsmodref-aa",
"Number of functions that only read memory");
- Statistic<>
+ Statistic
NumIndirectGlobalVars("globalsmodref-aa",
"Number of indirect global objects");
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 ("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");
#define HANDLE_INST(N, OPCODE, CLASS) \
- Statistic<> Num##OPCODE##Inst("instcount", "Number of " #OPCODE " insts");
+ Statistic Num##OPCODE##Inst("instcount", "Number of " #OPCODE " insts");
#include "llvm/Instruction.def"
RegisterPass<ScalarEvolution>
R("scalar-evolution", "Scalar Evolution Analysis");
- Statistic<>
+ Statistic
NumBruteForceEvaluations("scalar-evolution",
"Number of brute force evaluations needed to "
"calculate high-order polynomial exit values");
- Statistic<>
+ Statistic
NumArrayLenItCounts("scalar-evolution",
"Number of trip counts computed with array length");
- Statistic<>
+ Statistic
NumTripCountsComputed("scalar-evolution",
"Number of loops with predictable loop counts");
- Statistic<>
+ Statistic
NumTripCountsNotComputed("scalar-evolution",
"Number of loops without predictable loop counts");
- Statistic<>
+ Statistic
NumBruteForceTripCountsComputed("scalar-evolution",
"Number of loops with trip counts computed by force");
static RegisterPass<WriteBytecodePass> X("emitbytecode", "Bytecode Writer");
-static Statistic<>
+static Statistic
BytesWritten("bytecodewriter", "Number of bytecode bytes written");
//===----------------------------------------------------------------------===//
#include <algorithm>
using namespace llvm;
-static Statistic<> NumDeadBlocks("branchfold", "Number of dead blocks removed");
-static Statistic<> NumBranchOpts("branchfold", "Number of branches optimized");
-static Statistic<> NumTailMerge ("branchfold", "Number of block tails merged");
+static Statistic NumDeadBlocks("branchfold", "Number of dead blocks removed");
+static Statistic NumBranchOpts("branchfold", "Number of branches optimized");
+static Statistic NumTailMerge ("branchfold", "Number of block tails merged");
static cl::opt<bool> EnableTailMerge("enable-tail-merge", cl::Hidden);
namespace {
namespace {
RegisterPass<LiveIntervals> X("liveintervals", "Live Interval Analysis");
- static Statistic<> numIntervals
+ static Statistic numIntervals
("liveintervals", "Number of original intervals");
- static Statistic<> numIntervalsAfter
+ static Statistic numIntervalsAfter
("liveintervals", "Number of intervals after coalescing");
- static Statistic<> numJoins
+ static Statistic numJoins
("liveintervals", "Number of interval joins performed");
- static Statistic<> numPeep
+ static Statistic numPeep
("liveintervals", "Number of identity moves eliminated after coalescing");
- static Statistic<> numFolded
+ static Statistic numFolded
("liveintervals", "Number of loads/stores folded into instructions");
static cl::opt<bool>
using namespace llvm;
namespace {
- static Statistic<> NumAtomic("phielim", "Number of atomic phis lowered");
- static Statistic<> NumSimple("phielim", "Number of simple phis lowered");
+ static Statistic NumAtomic("phielim", "Number of atomic phis lowered");
+ static Statistic NumSimple("phielim", "Number of simple phis lowered");
struct VISIBILITY_HIDDEN PNE : public MachineFunctionPass {
bool runOnMachineFunction(MachineFunction &Fn) {
namespace {
- static Statistic<> NumIters
+ static Statistic NumIters
("regalloc", "Number of iterations performed");
- static Statistic<> NumBacktracks
+ static Statistic NumBacktracks
("regalloc", "Number of times we had to backtrack");
static RegisterRegAlloc
using namespace llvm;
namespace {
- static Statistic<> NumStores("ra-local", "Number of stores added");
- static Statistic<> NumLoads ("ra-local", "Number of loads added");
- static Statistic<> NumFolded("ra-local", "Number of loads/stores folded "
+ static Statistic NumStores("ra-local", "Number of stores added");
+ static Statistic NumLoads ("ra-local", "Number of loads added");
+ static Statistic NumFolded("ra-local", "Number of loads/stores folded "
"into instructions");
static RegisterRegAlloc
using namespace llvm;
namespace {
- static Statistic<> NumStores("ra-simple", "Number of stores added");
- static Statistic<> NumLoads ("ra-simple", "Number of loads added");
+ static Statistic NumStores("ra-simple", "Number of stores added");
+ static Statistic NumLoads ("ra-simple", "Number of loads added");
static RegisterRegAlloc
simpleRegAlloc("simple", " simple register allocator",
using namespace llvm;
namespace {
- static Statistic<> NodesCombined ("dagcombiner",
+ static Statistic NodesCombined ("dagcombiner",
"Number of dag nodes combined");
- static Statistic<> PreIndexedNodes ("pre_indexed_ops",
+ static Statistic PreIndexedNodes ("pre_indexed_ops",
"Number of pre-indexed nodes created");
- static Statistic<> PostIndexedNodes ("post_indexed_ops",
+ static Statistic PostIndexedNodes ("post_indexed_ops",
"Number of post-indexed nodes created");
static cl::opt<bool>
using namespace llvm;
namespace {
- static Statistic<> NumNoops ("scheduler", "Number of noops inserted");
- static Statistic<> NumStalls("scheduler", "Number of pipeline stalls");
+ static Statistic NumNoops ("scheduler", "Number of noops inserted");
+ static Statistic NumStalls("scheduler", "Number of pipeline stalls");
}
static RegisterScheduler
using namespace llvm;
namespace {
- static Statistic<> NumTwoAddressInstrs("twoaddressinstruction",
+ static Statistic NumTwoAddressInstrs("twoaddressinstruction",
"Number of two-address instructions");
- static Statistic<> NumCommuted("twoaddressinstruction",
+ static Statistic NumCommuted("twoaddressinstruction",
"Number of instructions commuted to coalesce");
- static Statistic<> NumConvertedTo3Addr("twoaddressinstruction",
+ static Statistic NumConvertedTo3Addr("twoaddressinstruction",
"Number of instructions promoted to 3-address");
struct VISIBILITY_HIDDEN TwoAddressInstructionPass
using namespace llvm;
namespace {
- static Statistic<> NumSpills("spiller", "Number of register spills");
- static Statistic<> NumStores("spiller", "Number of stores added");
- static Statistic<> NumLoads ("spiller", "Number of loads added");
- static Statistic<> NumReused("spiller", "Number of values reused");
- static Statistic<> NumDSE ("spiller", "Number of dead stores elided");
- static Statistic<> NumDCE ("spiller", "Number of copies elided");
+ static Statistic NumSpills("spiller", "Number of register spills");
+ static Statistic NumStores("spiller", "Number of stores added");
+ static Statistic NumLoads ("spiller", "Number of loads added");
+ static Statistic NumReused("spiller", "Number of values reused");
+ static Statistic NumDSE ("spiller", "Number of dead stores elided");
+ static Statistic NumDCE ("spiller", "Number of copies elided");
enum SpillerName { simple, local };
using namespace llvm;
namespace {
- Statistic<> NumInitBytes("lli", "Number of bytes of global vars initialized");
- Statistic<> NumGlobals ("lli", "Number of global vars initialized");
+ Statistic NumInitBytes("lli", "Number of bytes of global vars initialized");
+ Statistic NumGlobals ("lli", "Number of global vars initialized");
}
ExecutionEngine::EECtorFn ExecutionEngine::JITCtor = 0;
using namespace llvm;
namespace {
- Statistic<> NumDynamicInsts("lli", "Number of dynamic instructions executed");
+ Statistic NumDynamicInsts("lli", "Number of dynamic instructions executed");
Interpreter *TheEE = 0;
}
using namespace llvm;
namespace {
- Statistic<> NumBytes("jit", "Number of bytes of machine code compiled");
- Statistic<> NumRelos("jit", "Number of relocations applied");
+ Statistic NumBytes("jit", "Number of bytes of machine code compiled");
+ Statistic NumRelos("jit", "Number of relocations applied");
JIT *TheJIT = 0;
}
// This is useful for reporting information like the number of instructions
// simplified, optimized or removed by various transformations, like this:
//
-// static Statistic<> NumInstEliminated("GCSE - Number of instructions killed");
+// static Statistic NumInstEliminated("GCSE - Number of instructions killed");
//
// Later, in the code: ++NumInstEliminated;
//
unsigned StatisticBase::NumStats = 0;
-TEMPLATE_INSTANTIATION(class Statistic<unsigned>);
-
// -stats - Command line option to cause transformations to emit stats about
// what they did.
//
// getLibSupportInfoOutputFilename - This ugly hack is brought to you courtesy
// of constructor/destructor ordering being unspecified by C++. Basically the
-// problem is that a Statistic<> object gets destroyed, which ends up calling
+// problem is that a Statistic object gets destroyed, which ends up calling
// 'GetLibSupportInfoOutputFile()' (below), which calls this function.
// LibSupportInfoOutputFilename used to be a global variable, but sometimes it
// would get destroyed before the Statistic, causing havoc to ensue. We "fix"
using namespace llvm;
namespace {
- Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
+ Statistic EmittedInsts("asm-printer", "Number of machine instrs printed");
static const char *ARMCondCodeToString(ARMCC::CondCodes CC) {
switch (CC) {
using namespace llvm;
namespace {
- Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
+ Statistic EmittedInsts("asm-printer", "Number of machine instrs printed");
struct VISIBILITY_HIDDEN AlphaAsmPrinter : public AsmPrinter {
using namespace llvm;
namespace {
- Statistic<>
+ Statistic
NumEmitted("alpha-emitter", "Number of machine instructions emitted");
}
using namespace llvm;
namespace {
- Statistic<> nopintro("alpha-nops", "Number of nops inserted");
- Statistic<> nopalign("alpha-nops-align",
+ Statistic nopintro("alpha-nops", "Number of nops inserted");
+ Statistic nopalign("alpha-nops-align",
"Number of nops inserted for alignment");
cl::opt<bool>
using namespace llvm;
namespace {
- Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
+ Statistic EmittedInsts("asm-printer", "Number of machine instrs printed");
struct IA64AsmPrinter : public AsmPrinter {
std::set<std::string> ExternalFunctionNames, ExternalObjectNames;
using namespace llvm;
namespace {
- Statistic<> StopBitsAdded("ia64-codegen", "Number of stop bits added");
+ Statistic StopBitsAdded("ia64-codegen", "Number of stop bits added");
struct IA64BundlingPass : public MachineFunctionPass {
/// Target machine description which we query for reg. names, data
using namespace llvm;
namespace {
- Statistic<> FusedFP ("ia64-codegen", "Number of fused fp operations");
- Statistic<> FrameOff("ia64-codegen", "Number of frame idx offsets collapsed");
+ Statistic FusedFP ("ia64-codegen", "Number of fused fp operations");
+ Statistic FrameOff("ia64-codegen", "Number of frame idx offsets collapsed");
//===--------------------------------------------------------------------===//
/// IA64DAGToDAGISel - IA64 specific code to select IA64 machine
using namespace llvm;
namespace {
- Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
+ Statistic EmittedInsts("asm-printer", "Number of machine instrs printed");
struct VISIBILITY_HIDDEN PPCAsmPrinter : public AsmPrinter {
std::set<std::string> FnStubs, GVStubs;
#include "llvm/Support/MathExtras.h"
using namespace llvm;
-static Statistic<> NumExpanded("ppc-branch-select",
+static Statistic NumExpanded("ppc-branch-select",
"Num branches expanded to long format");
namespace {
using namespace llvm;
namespace {
- Statistic<> FrameOff("ppc-codegen", "Number of frame idx offsets collapsed");
+ Statistic FrameOff("ppc-codegen", "Number of frame idx offsets collapsed");
//===--------------------------------------------------------------------===//
/// PPCDAGToDAGISel - PPC specific code to select PPC machine
using namespace llvm;
namespace {
- Statistic<> FilledSlots("delayslotfiller", "Num. of delay slots filled");
+ Statistic FilledSlots("delayslotfiller", "Num. of delay slots filled");
struct Filler : public MachineFunctionPass {
/// Target machine description which we query for reg. names, data
using namespace llvm;
namespace {
- Statistic<> NumFpDs("fpmover", "Number of instructions translated");
- Statistic<> NoopFpDs("fpmover", "Number of noop instructions removed");
+ Statistic NumFpDs("fpmover", "Number of instructions translated");
+ Statistic NoopFpDs("fpmover", "Number of noop instructions removed");
struct FPMover : public MachineFunctionPass {
/// Target machine description which we query for reg. names, data
using namespace llvm;
namespace {
- Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
+ Statistic EmittedInsts("asm-printer", "Number of machine instrs printed");
struct VISIBILITY_HIDDEN SparcAsmPrinter : public AsmPrinter {
SparcAsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
using namespace llvm;
-Statistic<> llvm::EmittedInsts("asm-printer",
+Statistic llvm::EmittedInsts("asm-printer",
"Number of machine instrs printed");
static X86FunctionInfo calculateFunctionInfo(const Function *F,
namespace llvm {
-extern Statistic<> EmittedInsts;
+extern Statistic EmittedInsts;
// FIXME: Move this to CodeGen/AsmPrinter.h
namespace PICStyle {
using namespace llvm;
namespace {
- Statistic<>
+ Statistic
NumEmitted("x86-emitter", "Number of machine instructions emitted");
}
using namespace llvm;
namespace {
- Statistic<> NumFXCH("x86-codegen", "Number of fxch instructions inserted");
- Statistic<> NumFP ("x86-codegen", "Number of floating point instructions");
+ Statistic NumFXCH("x86-codegen", "Number of fxch instructions inserted");
+ Statistic NumFP ("x86-codegen", "Number of floating point instructions");
struct VISIBILITY_HIDDEN FPS : public MachineFunctionPass {
virtual bool runOnMachineFunction(MachineFunction &MF);
}
namespace {
- Statistic<>
+ Statistic
NumFPKill("x86-codegen", "Number of FP_REG_KILL instructions added");
- Statistic<>
+ Statistic
NumLoadMoved("x86-codegen", "Number of loads moved below TokenFactor");
//===--------------------------------------------------------------------===//
using namespace llvm;
namespace {
- Statistic<> HelloCounter("hellocount",
+ Statistic HelloCounter("hellocount",
"Counts number of functions greeted");
// Hello - The first implementation, without getAnalysisUsage.
struct Hello : public FunctionPass {
using namespace llvm;
namespace {
- Statistic<> NumArgumentsPromoted("argpromotion",
+ Statistic NumArgumentsPromoted("argpromotion",
"Number of pointer arguments promoted");
- Statistic<> NumAggregatesPromoted("argpromotion",
+ Statistic NumAggregatesPromoted("argpromotion",
"Number of aggregate arguments promoted");
- Statistic<> NumArgumentsDead("argpromotion",
+ Statistic NumArgumentsDead("argpromotion",
"Number of dead pointer args eliminated");
/// ArgPromotion - The 'by reference' to 'by value' argument promotion pass.
using namespace llvm;
namespace {
- Statistic<> NumMerged("constmerge", "Number of global constants merged");
+ Statistic NumMerged("constmerge", "Number of global constants merged");
struct ConstantMerge : public ModulePass {
// run - For this pass, process all of the globals in the module,
using namespace llvm;
namespace {
- Statistic<> NumArgumentsEliminated("deadargelim",
+ Statistic NumArgumentsEliminated("deadargelim",
"Number of unread args removed");
- Statistic<> NumRetValsEliminated("deadargelim",
+ Statistic NumRetValsEliminated("deadargelim",
"Number of unused return values removed");
/// DAE - The dead argument elimination pass.
}
};
RegisterPass<DTE> X("deadtypeelim", "Dead Type Elimination");
- Statistic<>
+ Statistic
NumKilled("deadtypeelim", "Number of unused typenames removed from symtab");
}
using namespace llvm;
namespace {
- Statistic<>NumResolved("funcresolve", "Number of varargs functions resolved");
- Statistic<> NumGlobals("funcresolve", "Number of global variables resolved");
+ Statistic NumResolved("funcresolve", "Number of varargs functions resolved");
+ Statistic NumGlobals("funcresolve", "Number of global variables resolved");
struct FunctionResolvingPass : public ModulePass {
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
using namespace llvm;
namespace {
- Statistic<> NumFunctions("globaldce","Number of functions removed");
- Statistic<> NumVariables("globaldce","Number of global variables removed");
+ Statistic NumFunctions("globaldce","Number of functions removed");
+ Statistic NumVariables("globaldce","Number of global variables removed");
struct GlobalDCE : public ModulePass {
// run - Do the GlobalDCE pass on the specified module, optionally updating
using namespace llvm;
namespace {
- Statistic<> NumMarked ("globalopt", "Number of globals marked constant");
- Statistic<> NumSRA ("globalopt", "Number of aggregate globals broken "
+ Statistic NumMarked ("globalopt", "Number of globals marked constant");
+ Statistic NumSRA ("globalopt", "Number of aggregate globals broken "
"into scalars");
- Statistic<> NumHeapSRA ("globalopt", "Number of heap objects SRA'd");
- Statistic<> NumSubstitute("globalopt",
+ Statistic NumHeapSRA ("globalopt", "Number of heap objects SRA'd");
+ Statistic NumSubstitute("globalopt",
"Number of globals with initializers stored into them");
- Statistic<> NumDeleted ("globalopt", "Number of globals deleted");
- Statistic<> NumFnDeleted("globalopt", "Number of functions deleted");
- Statistic<> NumGlobUses ("globalopt", "Number of global uses devirtualized");
- Statistic<> NumLocalized("globalopt", "Number of globals localized");
- Statistic<> NumShrunkToBool("globalopt",
+ Statistic NumDeleted ("globalopt", "Number of globals deleted");
+ Statistic NumFnDeleted("globalopt", "Number of functions deleted");
+ Statistic NumGlobUses ("globalopt", "Number of global uses devirtualized");
+ Statistic NumLocalized("globalopt", "Number of globals localized");
+ Statistic NumShrunkToBool("globalopt",
"Number of global vars shrunk to booleans");
- Statistic<> NumFastCallFns("globalopt",
+ Statistic NumFastCallFns("globalopt",
"Number of functions converted to fastcc");
- Statistic<> NumCtorsEvaluated("globalopt","Number of static ctors evaluated");
+ Statistic NumCtorsEvaluated("globalopt","Number of static ctors evaluated");
struct GlobalOpt : public ModulePass {
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
using namespace llvm;
namespace {
- Statistic<> NumArgumentsProped("ipconstprop",
+ Statistic NumArgumentsProped("ipconstprop",
"Number of args turned into constants");
- Statistic<> NumReturnValProped("ipconstprop",
+ Statistic NumReturnValProped("ipconstprop",
"Number of return values turned into constants");
/// IPCP - The interprocedural constant propagation pass
using namespace llvm;
namespace {
- Statistic<> NumBounceSites("indmemrem", "Number of sites modified");
- Statistic<> NumBounce ("indmemrem", "Number of bounce functions created");
+ Statistic NumBounceSites("indmemrem", "Number of sites modified");
+ Statistic NumBounce ("indmemrem", "Number of bounce functions created");
class IndMemRemPass : public ModulePass {
using namespace llvm;
namespace {
- Statistic<> NumInlined("inline", "Number of functions inlined");
- Statistic<> NumDeleted("inline",
+ Statistic NumInlined("inline", "Number of functions inlined");
+ Statistic NumDeleted("inline",
"Number of functions deleted because all callers found");
cl::opt<unsigned> // FIXME: 200 is VERY conservative
InlineLimit("inline-threshold", cl::Hidden, cl::init(200),
using namespace llvm;
namespace {
- Statistic<> NumFunctions("internalize", "Number of functions internalized");
- Statistic<> NumGlobals ("internalize", "Number of global vars internalized");
+ Statistic NumFunctions("internalize", "Number of functions internalized");
+ Statistic NumGlobals ("internalize", "Number of global vars internalized");
// APIFile - A file which contains a list of symbols that should not be marked
// external.
using namespace llvm;
namespace {
- Statistic<> NumExtracted("loop-extract", "Number of loops extracted");
+ Statistic NumExtracted("loop-extract", "Number of loops extracted");
// FIXME: This is not a function pass, but the PassManager doesn't allow
// Module passes to require FunctionPasses, so we can't get loop info if we're
using namespace llvm;
namespace {
- Statistic<> LongJmpsTransformed("lowersetjmp",
+ Statistic LongJmpsTransformed("lowersetjmp",
"Number of longjmps transformed");
- Statistic<> SetJmpsTransformed("lowersetjmp",
+ Statistic SetJmpsTransformed("lowersetjmp",
"Number of setjmps transformed");
- Statistic<> CallsTransformed("lowersetjmp",
+ Statistic CallsTransformed("lowersetjmp",
"Number of calls invokified");
- Statistic<> InvokesTransformed("lowersetjmp",
+ Statistic InvokesTransformed("lowersetjmp",
"Number of invokes modified");
//===--------------------------------------------------------------------===//
using namespace llvm;
namespace {
- Statistic<> NumRemoved("prune-eh", "Number of invokes removed");
- Statistic<> NumUnreach("prune-eh", "Number of noreturn calls optimized");
+ Statistic NumRemoved("prune-eh", "Number of invokes removed");
+ Statistic NumUnreach("prune-eh", "Number of noreturn calls optimized");
struct PruneEH : public CallGraphSCCPass {
/// DoesNotUnwind - This set contains all of the functions which we have
using namespace llvm;
namespace {
- Statistic<> NumRaised("raiseallocs", "Number of allocations raised");
+ Statistic NumRaised("raiseallocs", "Number of allocations raised");
// RaiseAllocations - Turn %malloc and %free calls into the appropriate
// instruction.
/// This statistic keeps track of the total number of library calls that have
/// been simplified regardless of which call it is.
-Statistic<> SimplifiedLibCalls("simplify-libcalls",
+Statistic SimplifiedLibCalls("simplify-libcalls",
"Number of library calls simplified");
// Forward declarations
LibCallOptimization **Prev, *Next;
const char *FunctionName; ///< Name of the library call we optimize
#ifndef NDEBUG
- Statistic<> occurrences; ///< debug statistic (-debug-only=simplify-libcalls)
+ Statistic occurrences; ///< debug statistic (-debug-only=simplify-libcalls)
#endif
public:
/// The \p fname argument must be the name of the library function being
using namespace llvm;
namespace {
- Statistic<> NumBackEdges("bedge", "Number of BackEdges");
+ Statistic NumBackEdges("bedge", "Number of BackEdges");
enum RandomMeth {
GBV, GBVO, HOSTCC
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<>
+static Statistic
NumLoadStorePeepholes("raise", "Number of load/store peepholes");
-static Statistic<>
+static Statistic
NumGEPInstFormed("raise", "Number of other getelementptr's formed");
-static Statistic<>
+static Statistic
NumExprTreesConv("raise", "Number of expression trees converted");
-static Statistic<>
+static Statistic
NumCastOfCast("raise", "Number of cast-of-self removed");
-static Statistic<>
+static Statistic
NumDCEorCP("raise", "Number of insts DCEd or constprop'd");
-static Statistic<>
+static Statistic
NumVarargCallChanges("raise", "Number of vararg call peepholes");
#define PRINT_PEEPHOLE(ID, NUM, I) \
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("adce", "Number of basic blocks removed");
+ Statistic NumInstRemoved ("adce", "Number of instructions removed");
+ Statistic NumCallRemoved ("adce", "Number of calls and invokes removed");
//===----------------------------------------------------------------------===//
// ADCE Class
using namespace llvm;
namespace {
- Statistic<> NumMoved("block-placement", "Number of basic blocks moved");
+ Statistic NumMoved("block-placement", "Number of basic blocks moved");
struct BlockPlacement : public FunctionPass {
virtual bool runOnFunction(Function &F);
using namespace llvm;
namespace {
- Statistic<>
+ Statistic
NumBrThread("condprop", "Number of CFG edges threaded through branches");
- Statistic<>
+ Statistic
NumSwThread("condprop", "Number of CFG edges threaded through switches");
struct CondProp : public FunctionPass {
using namespace llvm;
namespace {
- Statistic<> NumInstKilled("constprop", "Number of instructions killed");
+ Statistic NumInstKilled("constprop", "Number of instructions killed");
struct ConstantPropagation : public FunctionPass {
bool runOnFunction(Function &F);
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("cee", "Number of setcc instruction eliminated");
+ Statistic NumOperandsCann("cee", "Number of operands canonicalized");
+ Statistic BranchRevectors("cee", "Number of branches revectored");
class ValueInfo;
class Relation {
using namespace llvm;
namespace {
- Statistic<> DIEEliminated("die", "Number of insts removed");
- Statistic<> DCEEliminated("dce", "Number of insts removed");
+ Statistic DIEEliminated("die", "Number of insts removed");
+ Statistic DCEEliminated("dce", "Number of insts removed");
//===--------------------------------------------------------------------===//
// DeadInstElimination pass implementation
using namespace llvm;
namespace {
- Statistic<> NumStores("dse", "Number of stores deleted");
- Statistic<> NumOther ("dse", "Number of other instrs removed");
+ Statistic NumStores("dse", "Number of stores deleted");
+ Statistic NumOther ("dse", "Number of other instrs removed");
struct DSE : public FunctionPass {
using namespace llvm;
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 "
+ 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 "
+ Statistic NumArgsRepl ("gcse", "Number of function arguments replaced "
"with constant values");
struct GCSE : public FunctionPass {
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 ("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");
class IndVarSimplify : public FunctionPass {
LoopInfo *LI;
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 ("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");
class VISIBILITY_HIDDEN InstCombiner
: public FunctionPass,
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",
+ 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 {
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 ("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");
/// IVStrideUse - Keep track of one use of a strided induction variable, where
/// the stride is stored externally. The Offset member keeps track of the
using namespace llvm;
namespace {
- Statistic<> NumUnrolled("loop-unroll", "Number of loops completely unrolled");
+ Statistic NumUnrolled("loop-unroll", "Number of loops completely unrolled");
cl::opt<unsigned>
UnrollThreshold("unroll-threshold", cl::init(100), cl::Hidden,
using namespace llvm;
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",
+ 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",
+ Statistic NumSimplify("loop-unswitch",
"Number of simplifications of unswitched code");
cl::opt<unsigned>
Threshold("loop-unswitch-threshold", cl::desc("Max loop size to unswitch"),
using namespace llvm;
namespace {
- Statistic<>
+ Statistic
NumVarsReplaced("predsimplify", "Number of argument substitutions");
- Statistic<>
+ Statistic
NumInstruction("predsimplify", "Number of instructions removed");
- Statistic<>
+ Statistic
NumSimple("predsimplify", "Number of simple replacements");
/// The InequalityGraph stores the relationships between values.
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 ("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");
struct ValueEntry {
unsigned Rank;
using namespace llvm;
namespace {
- Statistic<> NumDemoted("reg2mem", "Number of registers demoted");
+ Statistic NumDemoted("reg2mem", "Number of registers demoted");
struct RegToMem : public FunctionPass {
namespace {
- Statistic<> NumInstRemoved("sccp", "Number of instructions removed");
- Statistic<> NumDeadBlocks ("sccp", "Number of basic blocks unreachable");
+ Statistic NumInstRemoved("sccp", "Number of instructions removed");
+ Statistic NumDeadBlocks ("sccp", "Number of basic blocks unreachable");
//===--------------------------------------------------------------------===//
//
}
namespace {
- Statistic<> IPNumInstRemoved("ipsccp", "Number of instructions removed");
- Statistic<> IPNumDeadBlocks ("ipsccp", "Number of basic blocks unreachable");
- Statistic<> IPNumArgsElimed ("ipsccp",
+ 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",
+ Statistic IPNumGlobalConst("ipsccp",
"Number of globals found to be constant");
//===--------------------------------------------------------------------===//
using namespace llvm;
namespace {
- Statistic<> NumReplaced("scalarrepl", "Number of allocas broken up");
- Statistic<> NumPromoted("scalarrepl", "Number of allocas promoted");
- Statistic<> NumConverted("scalarrepl",
+ Statistic NumReplaced("scalarrepl", "Number of allocas broken up");
+ Statistic NumPromoted("scalarrepl", "Number of allocas promoted");
+ Statistic NumConverted("scalarrepl",
"Number of aggregates converted to scalar");
struct VISIBILITY_HIDDEN SROA : public FunctionPass {
using namespace llvm;
namespace {
- Statistic<> NumSimpl("cfgsimplify", "Number of blocks simplified");
+ Statistic NumSimpl("cfgsimplify", "Number of blocks simplified");
struct CFGSimplifyPass : public FunctionPass {
virtual bool runOnFunction(Function &F);
cl::opt<unsigned>
Threshold("taildup-threshold", cl::desc("Max block size to tail duplicate"),
cl::init(6), cl::Hidden);
- Statistic<> NumEliminated("tailduplicate",
+ Statistic NumEliminated("tailduplicate",
"Number of unconditional branches eliminated");
- Statistic<> NumPHINodes("tailduplicate", "Number of phi nodes inserted");
+ Statistic NumPHINodes("tailduplicate", "Number of phi nodes inserted");
class TailDup : public FunctionPass {
bool runOnFunction(Function &F);
using namespace llvm;
namespace {
- Statistic<> NumEliminated("tailcallelim", "Number of tail calls removed");
- Statistic<> NumAccumAdded("tailcallelim","Number of accumulators introduced");
+ Statistic NumEliminated("tailcallelim", "Number of tail calls removed");
+ Statistic NumAccumAdded("tailcallelim","Number of accumulators introduced");
struct TailCallElim : public FunctionPass {
virtual bool runOnFunction(Function &F);
using namespace llvm;
namespace {
- Statistic<> NumBroken("break-crit-edges", "Number of blocks inserted");
+ Statistic NumBroken("break-crit-edges", "Number of blocks inserted");
struct VISIBILITY_HIDDEN BreakCriticalEdges : public FunctionPass {
virtual bool runOnFunction(Function &F);
using namespace llvm;
namespace {
- static Statistic<> NumLCSSA("lcssa",
+ static Statistic NumLCSSA("lcssa",
"Number of live out of a loop variables");
struct LCSSA : public FunctionPass {
using namespace llvm;
namespace {
- Statistic<>
+ Statistic
NumInserted("loopsimplify", "Number of pre-header or exit blocks inserted");
- Statistic<>
+ Statistic
NumNested("loopsimplify", "Number of nested loops split out");
struct VISIBILITY_HIDDEN LoopSimplify : public FunctionPass {
using namespace llvm;
namespace {
- Statistic<> NumLowered("lowerallocs", "Number of allocations lowered");
+ Statistic NumLowered("lowerallocs", "Number of allocations lowered");
/// LowerAllocations - Turn malloc and free instructions into %malloc and
/// %free calls.
using namespace llvm;
namespace {
- Statistic<> NumInvokes("lowerinvoke", "Number of invokes replaced");
- Statistic<> NumUnwinds("lowerinvoke", "Number of unwinds replaced");
- Statistic<> NumSpilled("lowerinvoke",
+ 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",
cl::desc("Make the -lowerinvoke pass insert expensive, but correct, EH code"));
using namespace llvm;
namespace {
- Statistic<> NumLowered("lowerselect","Number of select instructions lowered");
+ Statistic NumLowered("lowerselect","Number of select instructions lowered");
/// LowerSelect - Turn select instructions into conditional branches.
///
using namespace llvm;
namespace {
- Statistic<> NumLowered("lowerswitch", "Number of SwitchInst's replaced");
+ 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
using namespace llvm;
namespace {
- Statistic<> NumPromoted("mem2reg", "Number of alloca's promoted");
+ Statistic NumPromoted("mem2reg", "Number of alloca's promoted");
struct VISIBILITY_HIDDEN PromotePass : public FunctionPass {
// runOnFunction - To run this pass, first we calculate the alloca