LLVM API Documentation

InstCount.cpp File Reference

#include "llvm/Analysis/Passes.h"
#include "llvm/Pass.h"
#include "llvm/Function.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/InstVisitor.h"
#include "llvm/Support/Streams.h"
#include "llvm/ADT/Statistic.h"
#include <ostream>
#include "llvm/Instruction.def"

Include dependency graph for InstCount.cpp:

Go to the source code of this file.

Defines

#define DEBUG_TYPE   "instcount"
#define HANDLE_INST(N, OPCODE, CLASS)   STATISTIC(Num ## OPCODE ## Inst, "Number of " #OPCODE " insts");
#define HANDLE_INST(N, OPCODE, CLASS)   void visit##OPCODE(CLASS &) { ++Num##OPCODE##Inst; ++TotalInsts; }

Functions

 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")
FunctionPass * llvm::createInstCountPass ()

Variables

static RegisterPass< InstCount > X ("instcount","Counts the various types of Instructions", false, true)


Define Documentation

#define DEBUG_TYPE   "instcount"

Definition at line 14 of file InstCount.cpp.

#define HANDLE_INST ( N,
OPCODE,
CLASS   )     void visit##OPCODE(CLASS &) { ++Num##OPCODE##Inst; ++TotalInsts; }

Definition at line 44 of file InstCount.cpp.

#define HANDLE_INST ( N,
OPCODE,
CLASS   )     STATISTIC(Num ## OPCODE ## Inst, "Number of " #OPCODE " insts");

Definition at line 44 of file InstCount.cpp.


Function Documentation

STATISTIC ( TotalMemInst  ,
"Number of memory instructions"   
)

STATISTIC ( TotalFuncs  ,
"Number of non-external functions"   
)

STATISTIC ( TotalBlocks  ,
"Number of basic blocks"   
)

STATISTIC ( TotalInsts  ,
"Number of instructions (of all types)"   
)


Variable Documentation

Definition at line 197 of file InstCount.cpp.

Referenced by llvm::AddCatchInfo(), llvm::MachineModuleInfo::AnalyzeModule(), llvm::CastInst::castIsValid(), CleanupConstantGlobalUsers(), llvm::ComputeMaskedBits(), llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldInstOperands(), llvm::ConvertConstantType< ConstantExpr, Type >::convert(), llvm::TargetFolder::CreateBitCast(), llvm::IRBuilder< preserveNames, T >::CreateBitCast(), llvm::ConstantFolder::CreateBitCast(), llvm::CastInst::CreateFPCast(), llvm::CastInst::CreateIntegerCast(), llvm::CastInst::CreatePointerCast(), llvm::CastInst::CreateSExtOrBitCast(), llvm::CastInst::CreateTruncOrBitCast(), llvm::CastInst::CreateZExtOrBitCast(), llvm::AsmPrinter::EmitConstantValueOnly(), EnforceKnownAlignment(), evaluateICmpRelation(), findUsedValues(), llvm::GlobalAlias::getAliasedGlobal(), llvm::ConstantExpr::getBitCast(), getBitCastOperand(), llvm::ConstantExpr::getCast(), llvm::GetConstantStringInfo(), llvm::ExecutionEngine::getConstantValue(), GetDecodedCastOpcode(), GetEncodedCastOpcode(), llvm::ConstantExpr::getIntegerCast(), llvm::ConstantExpr::getPointerCast(), llvm::ConstantExpr::getSExtOrBitCast(), llvm::ConstantExpr::getTruncOrBitCast(), llvm::Value::getUnderlyingObject(), llvm::ConstantExpr::getWithOperandReplaced(), llvm::ConstantExpr::getWithOperands(), llvm::ConstantExpr::getZExtOrBitCast(), InsertCastToIntPtrTy(), InstCombineStoreToCast(), IsConstantOffsetFromGlobal(), llvm::CastInst::isEliminableCastPair(), llvm::CastInst::isIntegerCast(), llvm::CastInst::isLosslessCast(), llvm::CastInst::isNoopCast(), MightBeFoldableInst(), llvm::PointerMayBeCaptured(), PointsToConstantGlobal(), llvm::FastISel::SelectOperator(), and llvm::Value::stripPointerCasts().

char ID [static]

Definition at line 249 of file InstCount.cpp.

Definition at line 207 of file InstCount.cpp.

Referenced by getOpcode().

RegisterPass<InstCount> X("instcount","Counts the various types of Instructions", false, true) [static]