LLVM API Documentation

RSProfiling.cpp File Reference

#include "llvm/Pass.h"
#include "llvm/Module.h"
#include "llvm/Instructions.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Transforms/Instrumentation.h"
#include "RSProfiling.h"
#include <set>
#include <map>
#include <queue>
#include <list>
#include <iostream>

Include dependency graph for RSProfiling.cpp:

Go to the source code of this file.

Enumerations

enum  RandomMeth { GBV, GBVO, HOSTCC }

Functions

static void ReplacePhiPred (BasicBlock *btarget, BasicBlock *bold, BasicBlock *bnew)
static void CollapsePhi (BasicBlock *btarget, BasicBlock *bsrc)
template<class T>
static void recBackEdge (BasicBlock *bb, T &BackEdges, std::map< BasicBlock *, int > &color, std::map< BasicBlock *, int > &depth, std::map< BasicBlock *, int > &finish, int &time)
template<class T>
static void getBackEdges (Function &F, T &BackEdges)
ModulePassllvm::createNullProfilerRSPass ()
FunctionPassllvm::createRSProfilingPass ()

Variables

Statistic NumBackEdges ("bedge","Number of BackEdges")
cl::opt< RandomMethRandomMethod ("profile-randomness", cl::desc("How to randomly choose to profile:"), cl::values(clEnumValN(GBV,"global","global counter"), clEnumValN(GBVO,"ra_global","register allocated global counter"), clEnumValN(HOSTCC,"rdcc","cycle counter"), clEnumValEnd))
static RegisterAnalysisGroup<
RSProfilers
A ("Profiling passes")
static RegisterOpt< NullProfilerRS > NP ("insert-null-profiling-rs","Measure profiling framework overhead")
static RegisterAnalysisGroup<
RSProfilers, NullProfilerRS,
true > 
NPT
RegisterOpt< ProfilerRS > X ("insert-rs-profiling-framework","Insert random sampling instrumentation framework")


Enumeration Type Documentation

enum RandomMeth

Enumerator:
GBV 
GBVO 
HOSTCC 

Definition at line 60 of file RSProfiling.cpp.


Function Documentation

static void CollapsePhi ( BasicBlock btarget,
BasicBlock bsrc 
) [static]

Definition at line 579 of file RSProfiling.cpp.

References llvm::BasicBlock::begin(), and llvm::BasicBlock::end().

template<class T>
static void getBackEdges ( Function F,
T BackEdges 
) [static]

Definition at line 626 of file RSProfiling.cpp.

References DEBUG, F, and recBackEdge().

template<class T>
static void recBackEdge ( BasicBlock bb,
T BackEdges,
std::map< BasicBlock *, int > &  color,
std::map< BasicBlock *, int > &  depth,
std::map< BasicBlock *, int > &  finish,
int &  time 
) [static]

Definition at line 598 of file RSProfiling.cpp.

References llvm::TerminatorInst::getNumSuccessors(), llvm::TerminatorInst::getSuccessor(), and llvm::BasicBlock::getTerminator().

Referenced by getBackEdges().

static void ReplacePhiPred ( BasicBlock btarget,
BasicBlock bold,
BasicBlock bnew 
) [static]

Definition at line 568 of file RSProfiling.cpp.

References llvm::BasicBlock::begin(), and llvm::BasicBlock::end().


Variable Documentation

RegisterAnalysisGroup<RSProfilers> A("Profiling passes") [static]

Referenced by llvm::Annotable::addAnnotation(), llvm::cl::aliasopt::apply(), llvm::X86InstrInfo::commuteInstruction(), llvm::X86InstrInfo::convertToThreeAddress(), llvm::Annotable::deleteAnnotation(), llvm::ilist_traits< Argument >::destroySentinel(), llvm::ETForestBase::dominates(), llvm::DominatorSetBase::dominates(), llvm::Annotable::getAnnotation(), getConstantStringLength(), getFnForValue(), llvm::SCEVAddRecExpr::getNumIterationsInRange(), llvm::Annotable::getOrCreateAnnotation(), llvm::JIT::getOrEmitGlobalVariable(), GT(), llvm::SCEVExpander::InsertCastOfTo(), isFlagDefiner(), isFlagUser(), isOnlyUsedInEntryBlock(), LT(), LTE(), Max(), Min(), llvm::ETForestBase::nearestCommonDominator(), llvm::AnnotationID::operator<(), llvm::AnnotationID::operator==(), llvm::ETForestBase::properlyDominates(), llvm::DominatorSetBase::properlyDominates(), llvm::MemIntrinsic::setAlignment(), llvm::AnchoredDesc::setAnchor(), llvm::Value::setName(), SolveQuadraticEquation(), llvm::Annotable::unlinkAnnotation(), and llvm::Annotable::~Annotable().

AllocaInst* AI

Definition at line 124 of file RSProfiling.cpp.

Referenced by llvm::DSGraph::addObjectToGraph(), llvm::DSGraph::AssertGraphOK(), llvm::Interpreter::callFunction(), CallPassesValueThoughVararg(), CheckForEscapingAllocas(), llvm::CloneBasicBlock(), EvaluateFunction(), llvm::FunctionLoweringInfo::FunctionLoweringInfo(), llvm::DSGraph::getFunctionArgumentsForCall(), llvm::InlineFunction(), llvm::InsertProfilingInitCall(), llvm::isAllocaPromotable(), isDynamicConstant(), and ReleasePtrSeqNumbers().

Chooser* c

Definition at line 149 of file RSProfiling.cpp.

Referenced by GetCurrentX86CPU(), and myfeof().

std::set<BasicBlock*> ChoicePoints

Definition at line 148 of file RSProfiling.cpp.

GlobalVariable* Counter

Definition at line 122 of file RSProfiling.cpp.

GlobalVariable* Counter

Definition at line 110 of file RSProfiling.cpp.

Referenced by llvm::ProfileInfoLoader::getBlockCounts(), llvm::ProfileInfoLoader::getEdgeCounts(), and llvm::ProfileInfoLoader::getFunctionCounts().

Function* F

Definition at line 137 of file RSProfiling.cpp.

RegisterOpt<NullProfilerRS> NP("insert-null-profiling-rs","Measure profiling framework overhead") [static]

Referenced by llvm::AlphaTargetLowering::LowerOperation().

RegisterAnalysisGroup<RSProfilers, NullProfilerRS, true> NPT [static]

Definition at line 92 of file RSProfiling.cpp.

Statistic NumBackEdges("bedge","Number of BackEdges") [static]

Referenced by llvm::Loop::getNumBackEdges().

cl::opt<RandomMeth> RandomMethod("profile-randomness", cl::desc("How to randomly choose to profile:"), cl::values(clEnumValN(GBV,"global","global counter"),clEnumValN(GBVO,"ra_global","register allocated global counter"),clEnumValN(HOSTCC,"rdcc","cycle counter"),clEnumValEnd)) [static]

Value* ResetValue

Definition at line 123 of file RSProfiling.cpp.

Value* ResetValue

Definition at line 111 of file RSProfiling.cpp.

uint64_t rm

Definition at line 136 of file RSProfiling.cpp.

const Type* T

Definition at line 125 of file RSProfiling.cpp.

const Type* T

Definition at line 112 of file RSProfiling.cpp.

Referenced by DIDeserializeVisitor::Apply(), llvm::BitsToDouble(), llvm::BitsToFloat(), llvm::TargetLowering::BuildSDIV(), BuildVSLDOI(), llvm::VariableDesc::classof(), llvm::CompositeTypeDesc::classof(), llvm::DerivedTypeDesc::classof(), llvm::OpaqueType::classof(), llvm::PointerType::classof(), llvm::PackedType::classof(), llvm::ArrayType::classof(), llvm::SequentialType::classof(), llvm::StructType::classof(), llvm::CompositeType::classof(), llvm::FunctionType::classof(), llvm::DerivedType::classof(), llvm::CloneTrace(), llvm::CloneTraceInto(), llvm::ConstantArray::ConstantArray(), llvm::ConstantFoldTerminator(), llvm::ConstantPacked::ConstantPacked(), llvm::ConstantStruct::ConstantStruct(), llvm::DoubleToBits(), llvm::DSNode::DSNode(), Find(), llvm::FloatToBits(), llvm::MachineDebugInfo::getAnchoredDescriptors(), llvm::GraphTraits< const Type * >::getEntryNode(), llvm::GraphTraits< Type * >::getEntryNode(), llvm::SlotCalculator::getGlobalSlot(), llvm::SlotCalculator::getSlot(), llvm::TypeSymbolTable::insert(), llvm::SymbolTable::insert(), LowerBUILD_VECTOR(), llvm::PatternMatch::m_Br(), llvm::make_vector(), llvm::Timer::operator<(), llvm::operator<<(), llvm::Timer::operator=(), llvm::SmallVector< T, N >::operator=(), llvm::PATypeHandle::operator=(), llvm::Timer::operator>(), llvm::BytecodeReader::ParseSymbolTable(), llvm::SmallVector< T, N >::push_back(), llvm::TypeSymbolTable::rename(), llvm::GlobalDesc::setType(), llvm::VariableDesc::setType(), setTypeName(), llvm::SmallVector< T, N >::SmallVector(), llvm::Timer::Timer(), and WriteAsOperandInternal().

std::map<Value*, Value*> TransCache

Definition at line 147 of file RSProfiling.cpp.

RegisterOpt<ProfilerRS> X("insert-rs-profiling-framework","Insert random sampling instrumentation framework") [static]