LLVM API Documentation

InstCount.cpp File Reference

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

Include dependency graph for InstCount.cpp:

Go to the source code of this file.

Defines

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

Functions

 HANDLE_MEMORY_INST (21, Malloc, MallocInst) HANDLE_MEMORY_INST(23
AllocaInst PHINode HANDLE_OTHER_INST (28, Cast, CastInst) HANDLE_OTHER_INST(29
AllocaInst PHINode CallInst HANDLE_OTHER_INST (30, Shl, ShiftInst) HANDLE_OTHER_INST(34
AllocaInst PHINode CallInst
SelectInst 
HANDLE_OTHER_INST (35, UserOp1, Instruction) HANDLE_OTHER_INST(37
AllocaInst PHINode CallInst
SelectInst VAArgInst 
HANDLE_OTHER_INST (38, ExtractElement, ExtractElementInst) HANDLE_OTHER_INST(39
AllocaInst PHINode CallInst
SelectInst VAArgInst InsertElementInst 
HANDLE_OTHER_INST (40, ShuffleVector, ShuffleVectorInst) class InstCount
FunctionPassllvm::createInstCountPass ()

Variables

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")
 Alloca
AllocaInst HANDLE_MEMORY_INST (24, Load, LoadInst) HANDLE_OTHER_INST(27
AllocaInst PHI
AllocaInst PHINode Call
AllocaInst PHINode CallInst Select
AllocaInst PHINode CallInst
SelectInst 
VAArg
AllocaInst PHINode CallInst
SelectInst VAArgInst 
InsertElement
RegisterAnalysis< InstCount > X ("instcount","Counts the various types of Instructions")


Define Documentation

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

Definition at line 28 of file InstCount.cpp.

#define HANDLE_INST ( N,
OPCODE,
CLASS   )     Statistic<> Num##OPCODE##Inst("instcount", "Number of " #OPCODE " insts");

Definition at line 28 of file InstCount.cpp.


Function Documentation

@61::HANDLE_MEMORY_INST ( 21  ,
Malloc  ,
MallocInst   
) [static]

AllocaInst PHINode CallInst SelectInst VAArgInst InsertElementInst @61::HANDLE_OTHER_INST ( 40  ,
ShuffleVector  ,
ShuffleVectorInst   
) [static]

Definition at line 170 of file InstCount.cpp.

AllocaInst PHINode CallInst SelectInst VAArgInst @61::HANDLE_OTHER_INST ( 38  ,
ExtractElement  ,
ExtractElementInst   
) [static]

AllocaInst PHINode CallInst SelectInst @61::HANDLE_OTHER_INST ( 35  ,
UserOp1  ,
Instruction   
) [static]

AllocaInst PHINode CallInst @61::HANDLE_OTHER_INST ( 30  ,
Shl  ,
ShiftInst   
) [static]

AllocaInst PHINode @61::HANDLE_OTHER_INST ( 28  ,
Cast  ,
CastInst   
) [static]


Variable Documentation

Alloca [static]

Definition at line 147 of file InstCount.cpp.

AllocaInst PHINode Call [static]

Definition at line 157 of file InstCount.cpp.

AllocaInst HANDLE_MEMORY_INST(24, Load, LoadInst)HANDLE_OTHER_INST(27 [static]

AllocaInst PHINode CallInst SelectInst VAArgInst InsertElement [static]

Definition at line 169 of file InstCount.cpp.

AllocaInst PHI [static]

Definition at line 155 of file InstCount.cpp.

AllocaInst PHINode CallInst Select [static]

Definition at line 163 of file InstCount.cpp.

Statistic TotalBlocks("instcount","Number of basic blocks") [static]

Statistic TotalFuncs("instcount","Number of non-external functions") [static]

Statistic TotalInsts("instcount","Number of instructions (of all types)") [static]

Statistic TotalMemInst("instcount","Number of memory instructions") [static]

AllocaInst PHINode CallInst SelectInst VAArg [static]

Definition at line 167 of file InstCount.cpp.

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