LLVM API Documentation
#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"
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 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.
| 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)" | ||||
| ) |
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().
| BinaryOperator MallocInst LoadInst ZExtInst FPToUIInst UIToFPInst FPTruncInst PtrToIntInst BitCastInst FCmpInst Call |
Definition at line 205 of file InstCount.cpp.
Referenced by llvm::CallInst::classof(), llvm::ComputeMaskedBits(), llvm::ConstantFoldInstOperands(), llvm::CallSite::get(), llvm::AliasAnalysis::getModRefInfo(), isUnmovableInstruction(), LLVMAddInstrAttribute(), LLVMRemoveInstrAttribute(), LLVMSetInstrParamAlignment(), llvm::Instruction::mayReadFromMemory(), llvm::Instruction::mayWriteToMemory(), llvm::PointerMayBeCaptured(), llvm::FastISel::SelectOperator(), X86FastISel::TargetSelectInstruction(), and WriteInstruction().
| BinaryOperator MallocInst LoadInst ZExtInst FPToUIInst UIToFPInst FPTruncInst PtrToIntInst BitCastInst FCmpInst CallInst Instruction VAArgInst InsertElementInst ExtractValue |
Definition at line 213 of file InstCount.cpp.
Referenced by llvm::ExtractValueInst::classof(), llvm::UnaryInstruction::classof(), llvm::ConstantCreator< ConstantExpr, Type, ExprMapKeyType >::create(), llvm::ConstantExpr::hasIndices(), llvm::ConstantExpr::replaceUsesOfWithOnConstant(), X86FastISel::TargetSelectInstruction(), and WriteInstruction().
| BinaryOperator MallocInst LoadInst ZExtInst FPToUIInst UIToFPInst FPTruncInst PtrToIntInst BitCastInst FCmp |
Definition at line 203 of file InstCount.cpp.
Referenced by llvm::FCmpInst::classof(), llvm::ConstantFoldInstOperands(), llvm::CmpInst::Create(), llvm::ConstantCreator< ConstantExpr, Type, ExprMapKeyType >::create(), DominatesMergePoint(), llvm::ConstantExpr::getFCmp(), llvm::ConstantExpr::getPredicate(), llvm::ConstantExpr::getWithOperands(), llvm::ConstantExpr::isCompare(), llvm::ConstantExpr::replaceUsesOfWithOnConstant(), SpeculativelyExecuteBB(), X86FastISel::TargetSelectInstruction(), WriteConstants(), and WriteInstruction().
Definition at line 189 of file InstCount.cpp.
Referenced by llvm::CastInst::castIsValid(), llvm::ComputeMaskedBits(), llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldInstOperands(), llvm::ConvertConstantType< ConstantExpr, Type >::convert(), llvm::IRBuilder< preserveNames, T >::CreateFPToUI(), llvm::AsmPrinter::EmitConstantValueOnly(), evaluateICmpRelation(), llvm::ConstantExpr::getCast(), llvm::ExecutionEngine::getConstantValue(), GetDecodedCastOpcode(), GetEncodedCastOpcode(), llvm::ConstantExpr::getFPToUI(), llvm::ConstantExpr::getWithOperandReplaced(), llvm::ConstantExpr::getWithOperands(), and llvm::CastInst::isNoopCast().
Definition at line 193 of file InstCount.cpp.
Referenced by llvm::CastInst::castIsValid(), llvm::ComputeMaskedBits(), llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldInstOperands(), llvm::ConvertConstantType< ConstantExpr, Type >::convert(), llvm::CastInst::CreateFPCast(), llvm::IRBuilder< preserveNames, T >::CreateFPTrunc(), llvm::AsmPrinter::EmitConstantValueOnly(), evaluateFCmpRelation(), evaluateICmpRelation(), llvm::ConstantExpr::getCast(), llvm::ExecutionEngine::getConstantValue(), GetDecodedCastOpcode(), GetEncodedCastOpcode(), llvm::ConstantExpr::getFPCast(), llvm::ConstantExpr::getFPTrunc(), llvm::ConstantExpr::getWithOperandReplaced(), llvm::ConstantExpr::getWithOperands(), llvm::CastInst::isNoopCast(), and X86FastISel::TargetSelectInstruction().
char ID [static] |
Definition at line 249 of file InstCount.cpp.
| BinaryOperator MallocInst LoadInst ZExtInst FPToUIInst UIToFPInst FPTruncInst PtrToIntInst BitCastInst FCmpInst CallInst Instruction VAArgInst InsertElement |
Definition at line 211 of file InstCount.cpp.
Referenced by CheapToScalarize(), llvm::InsertElementInst::classof(), llvm::ConstantFoldInstOperands(), llvm::ConstantCreator< ConstantExpr, Type, ExprMapKeyType >::create(), llvm::ConstantExpr::getInsertElementTy(), llvm::ConstantExpr::getWithOperandReplaced(), llvm::ConstantExpr::getWithOperands(), llvm::ConstantExpr::replaceUsesOfWithOnConstant(), WriteConstants(), and WriteInstruction().
Definition at line 177 of file InstCount.cpp.
Referenced by AllUsersAreLoads(), CheapToScalarize(), llvm::LoadInst::classof(), llvm::UnaryInstruction::classof(), DominatesMergePoint(), ExpandUnalignedLoad(), ExpandUnalignedStore(), llvm::AliasAnalysis::getModRefInfo(), isUnmovableInstruction(), llvm::Instruction::mayReadFromMemory(), llvm::Instruction::mayWriteToMemory(), llvm::PointerMayBeCaptured(), X86FastISel::TargetSelectInstruction(), and WriteInstruction().
Definition at line 165 of file InstCount.cpp.
Referenced by llvm::ComputeMaskedBits(), llvm::ConstantFoldBinaryInstruction(), DominatesMergePoint(), llvm::ConstantExpr::get(), GetDecodedBinaryOpcode(), GetEncodedBinaryOpcode(), llvm::ConstantExpr::getLShr(), GetSelectFoldableConstant(), GetSelectFoldableOperands(), llvm::PatternMatch::Shr_match< LHS_t, RHS_t, ConcreteTy >::match(), llvm::FastISel::SelectOperator(), SpeculativelyExecuteBB(), X86FastISel::TargetSelectInstruction(), and llvm::SCEVExpander::visitUDivExpr().
Definition at line 174 of file InstCount.cpp.
Referenced by llvm::MallocInst::classof(), llvm::AllocationInst::classof(), llvm::UnaryInstruction::classof(), llvm::ComputeMaskedBits(), isUnmovableInstruction(), and WriteInstruction().
Definition at line 195 of file InstCount.cpp.
Referenced by llvm::CastInst::castIsValid(), llvm::ComputeMaskedBits(), llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldCompareInstOperands(), llvm::ConstantFoldInstOperands(), llvm::ConvertConstantType< ConstantExpr, Type >::convert(), llvm::CastInst::CreatePointerCast(), llvm::TargetFolder::CreatePtrToInt(), llvm::IRBuilder< preserveNames, T >::CreatePtrToInt(), llvm::ConstantFolder::CreatePtrToInt(), llvm::AsmPrinter::EmitConstantValueOnly(), fitsInAddressMode(), llvm::ConstantExpr::getCast(), llvm::ExecutionEngine::getConstantValue(), GetDecodedCastOpcode(), GetEncodedCastOpcode(), llvm::ConstantExpr::getPointerCast(), llvm::ConstantExpr::getPtrToInt(), llvm::ConstantExpr::getSizeOf(), getUnderlyingObjectFromInt(), llvm::ConstantExpr::getWithOperandReplaced(), llvm::ConstantExpr::getWithOperands(), InstCombineStoreToCast(), IsConstantOffsetFromGlobal(), llvm::CastInst::isNoopCast(), MightBeFoldableInst(), and llvm::FastISel::SelectOperator().
Definition at line 191 of file InstCount.cpp.
Referenced by llvm::CastInst::castIsValid(), llvm::ComputeMaskedBits(), llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldInstOperands(), llvm::ConvertConstantType< ConstantExpr, Type >::convert(), llvm::IRBuilder< preserveNames, T >::CreateUIToFP(), llvm::AsmPrinter::EmitConstantValueOnly(), evaluateFCmpRelation(), evaluateICmpRelation(), llvm::ConstantExpr::getCast(), llvm::ExecutionEngine::getConstantValue(), GetDecodedCastOpcode(), GetEncodedCastOpcode(), llvm::ConstantExpr::getUIToFP(), llvm::ConstantExpr::getWithOperandReplaced(), llvm::ConstantExpr::getWithOperands(), and llvm::CastInst::isNoopCast().
| BinaryOperator MallocInst LoadInst ZExtInst FPToUIInst UIToFPInst FPTruncInst PtrToIntInst BitCastInst FCmpInst CallInst Instruction VAArg |
Definition at line 209 of file InstCount.cpp.
Referenced by llvm::UnaryInstruction::classof(), llvm::AliasAnalysis::getModRefInfo(), llvm::Instruction::mayReadFromMemory(), llvm::Instruction::mayWriteToMemory(), and WriteInstruction().
| BinaryOperator MallocInst LoadInst ZExtInst FPToUIInst UIToFPInst FPTruncInst PtrToIntInst BitCastInst FCmpInst CallInst Instruction VAArgInst InsertElementInst ExtractValueInst VICmp |
Definition at line 215 of file InstCount.cpp.
Referenced by llvm::VICmpInst::classof(), llvm::ConstantFoldInstOperands(), llvm::CmpInst::Create(), llvm::ConstantCreator< ConstantExpr, Type, ExprMapKeyType >::create(), llvm::ConstantExpr::getPredicate(), llvm::ConstantExpr::getVICmp(), llvm::ConstantExpr::getWithOperands(), llvm::ConstantExpr::isCompare(), llvm::ConstantExpr::replaceUsesOfWithOnConstant(), WriteConstants(), and WriteInstruction().
RegisterPass<InstCount> X("instcount","Counts the various types of Instructions", false, true) [static] |
Definition at line 187 of file InstCount.cpp.
Referenced by llvm::CastInst::castIsValid(), llvm::ComputeMaskedBits(), llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldInstOperands(), llvm::ConvertConstantType< ConstantExpr, Type >::convert(), llvm::CastInst::CreateIntegerCast(), llvm::IRBuilder< preserveNames, T >::CreateZExt(), llvm::CastInst::CreateZExtOrBitCast(), llvm::AsmPrinter::EmitConstantValueOnly(), evaluateICmpRelation(), llvm::ConstantExpr::getCast(), llvm::ExecutionEngine::getConstantValue(), GetDecodedCastOpcode(), GetEncodedCastOpcode(), llvm::ConstantExpr::getIntegerCast(), llvm::ConstantExpr::getWithOperandReplaced(), llvm::ConstantExpr::getWithOperands(), llvm::ConstantExpr::getZExt(), llvm::ConstantExpr::getZExtOrBitCast(), llvm::CastInst::isEliminableCastPair(), llvm::CastInst::isIntegerCast(), llvm::CastInst::isNoopCast(), llvm::FastISel::SelectOperator(), and X86FastISel::TargetSelectInstruction().