//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "raise"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/Local.h"
#include "TransformInternals.h"
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
-NumLoadStorePeepholes("raise", "Number of load/store peepholes");
+STATISTIC(NumLoadStorePeepholes, "Number of load/store peepholes");
-static Statistic
-NumGEPInstFormed("raise", "Number of other getelementptr's formed");
+STATISTIC(NumGEPInstFormed, "Number of other getelementptr's formed");
-static Statistic
-NumExprTreesConv("raise", "Number of expression trees converted");
+STATISTIC(NumExprTreesConv, "Number of expression trees converted");
-static Statistic
-NumCastOfCast("raise", "Number of cast-of-self removed");
+STATISTIC(NumCastOfCast, "Number of cast-of-self removed");
-static Statistic
-NumDCEorCP("raise", "Number of insts DCEd or constprop'd");
+STATISTIC(NumDCEorCP, "Number of insts DCEd or constprop'd");
-static Statistic
-NumVarargCallChanges("raise", "Number of vararg call peepholes");
+STATISTIC(NumVarargCallChanges, "Number of vararg call peepholes");
#define PRINT_PEEPHOLE(ID, NUM, I) \
DOUT << "Inst P/H " << ID << "[" << NUM << "] " << I
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "break-crit-edges"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Analysis/Dominators.h"
#include "llvm/ADT/Statistic.h"
using namespace llvm;
-namespace {
- Statistic NumBroken("break-crit-edges", "Number of blocks inserted");
+STATISTIC(NumBroken, "Number of blocks inserted");
+namespace {
struct VISIBILITY_HIDDEN BreakCriticalEdges : public FunctionPass {
virtual bool runOnFunction(Function &F);
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "lcssa"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Constants.h"
#include "llvm/Pass.h"
#include "llvm/Support/CFG.h"
#include <algorithm>
#include <map>
-
using namespace llvm;
+STATISTIC(NumLCSSA, "Number of live out of a loop variables");
+
namespace {
- static Statistic NumLCSSA("lcssa",
- "Number of live out of a loop variables");
-
struct LCSSA : public FunctionPass {
// Cached analysis information for the current function.
LoopInfo *LI;
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "loopsimplify"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Constant.h"
#include "llvm/Instructions.h"
#include "llvm/ADT/DepthFirstIterator.h"
using namespace llvm;
-namespace {
- Statistic
- NumInserted("loopsimplify", "Number of pre-header or exit blocks inserted");
- Statistic
- NumNested("loopsimplify", "Number of nested loops split out");
+STATISTIC(NumInserted, "Number of pre-header or exit blocks inserted");
+STATISTIC(NumNested , "Number of nested loops split out");
+namespace {
struct VISIBILITY_HIDDEN LoopSimplify : public FunctionPass {
// AA - If we have an alias analysis object to update, this is it, otherwise
// this is null.
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "lowerallocs"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
#include "llvm/Module.h"
#include "llvm/Support/Compiler.h"
using namespace llvm;
-namespace {
- Statistic NumLowered("lowerallocs", "Number of allocations lowered");
+STATISTIC(NumLowered, "Number of allocations lowered");
+namespace {
/// LowerAllocations - Turn malloc and free instructions into %malloc and
/// %free calls.
///
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "lowerinvoke"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include <csetjmp>
using namespace llvm;
-namespace {
- 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",
+STATISTIC(NumInvokes, "Number of invokes replaced");
+STATISTIC(NumUnwinds, "Number of unwinds replaced");
+STATISTIC(NumSpilled, "Number of registers live across unwind edges");
+
+static cl::opt<bool> ExpensiveEHSupport("enable-correct-eh-support",
cl::desc("Make the -lowerinvoke pass insert expensive, but correct, EH code"));
+namespace {
class VISIBILITY_HIDDEN LowerInvoke : public FunctionPass {
// Used for both models.
Function *WriteFn;
#include "llvm/Instructions.h"
#include "llvm/Pass.h"
#include "llvm/Type.h"
-#include "llvm/ADT/Statistic.h"
using namespace llvm;
namespace {
- Statistic NumLowered("lowerselect","Number of select instructions lowered");
-
/// LowerSelect - Turn select instructions into conditional branches.
///
class LowerSelect : public FunctionPass {
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Compiler.h"
-#include "llvm/ADT/Statistic.h"
#include <algorithm>
using namespace llvm;
namespace {
- 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
/// modifies the CFG!
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "mem2reg"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/PromoteMemToReg.h"
#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
#include "llvm/Support/Compiler.h"
using namespace llvm;
-namespace {
- Statistic NumPromoted("mem2reg", "Number of alloca's promoted");
+STATISTIC(NumPromoted, "Number of alloca's promoted");
+namespace {
struct VISIBILITY_HIDDEN PromotePass : public FunctionPass {
// runOnFunction - To run this pass, first we calculate the alloca
// instructions that are safe for promotion, then we promote each one.