LLVM API Documentation

llvm::EquivClassGraphs Struct Reference

#include <DataStructure.h>

Inheritance diagram for llvm::EquivClassGraphs:

Inheritance graph
[legend]
Collaboration diagram for llvm::EquivClassGraphs:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::set< std::pair<
Instruction *, Function * > > 
ActualCalleesTy
typedef ActualCalleesTy::const_iterator callee_iterator

Public Member Functions

virtual bool runOnModule (Module &M)
void print (std::ostream &O, const Module *M) const
EquivalenceClasses< GlobalValue * > & getGlobalECs ()
DSGraphgetDSGraph (const Function &F) const
bool hasGraph (const Function &F) const
bool ContainsDSGraphFor (const Function &F) const
FunctiongetSomeCalleeForCallSite (const CallSite &CS) const
DSGraphgetGlobalsGraph () const
const ActualCalleesTygetActualCallees () const
callee_iterator callee_begin (Instruction *I) const
callee_iterator callee_end (Instruction *I) const
virtual void getAnalysisUsage (AnalysisUsage &AU) const

Public Attributes

CompleteBUDataStructuresCBU
DSGraphGlobalsGraph
hash_map< const Function *,
DSGraph * > 
DSInfo
std::set< std::pair< Instruction *,
Function * > > 
ActualCallees
EquivalenceClasses< Function * > FuncECs
std::map< DSNode *, Function * > OneCalledFunction
EquivalenceClasses< GlobalValue * > GlobalECs

Detailed Description

EquivClassGraphs - This is the same as the complete bottom-up graphs, but with functions partitioned into equivalence classes and a single merged DS graph for all functions in an equivalence class. After this merging, graphs are inlined bottom-up on the SCCs of the final (CBU) call graph.

Definition at line 341 of file DataStructure.h.


Member Typedef Documentation

typedef std::set<std::pair<Instruction*, Function*> > llvm::EquivClassGraphs::ActualCalleesTy

Definition at line 408 of file DataStructure.h.

typedef ActualCalleesTy::const_iterator llvm::EquivClassGraphs::callee_iterator

Definition at line 413 of file DataStructure.h.


Member Function Documentation

bool EquivClassGraphs::runOnModule ( Module M  )  [virtual]

EquivClassGraphs - Computes the equivalence classes and then the folded DS graphs for each class.

Implements llvm::ModulePass.

Definition at line 71 of file EquivClassGraphs.cpp.

References ActualCallees, llvm::Module::begin(), CBU, CheckAllGraphs(), DEBUG, llvm::DSGraph::DontCloneAuxCallNodes, llvm::DSGraph::DontCloneCallNodes, E, llvm::Module::end(), llvm::BUDataStructures::getActualCallees(), llvm::ReachabilityCloner::getClonedNH(), llvm::BUDataStructures::getGlobalECs(), llvm::DSGraph::getGlobalsGraph(), getGlobalsGraph(), llvm::BUDataStructures::getGlobalsGraph(), llvm::Module::getMainFunction(), llvm::DSGraph::getNodeForValue(), llvm::DSGraph::getScalarMap(), GI, llvm::Module::global_begin(), llvm::Module::global_end(), GlobalECs, GlobalsGraph, llvm::DSGraph::IgnoreGlobals, llvm::Function::isExternal(), M, llvm::DSGraph::MarkFormalArgs, llvm::DSGraph::markIncompleteNodes(), RC, llvm::DSGraph::removeTriviallyDeadNodes(), llvm::DSGraph::setPrintAuxCalls(), and Stack.

void EquivClassGraphs::print ( std::ostream &  O,
const Module M 
) const [virtual]

print - Print out the analysis results...

Reimplemented from llvm::Pass.

Definition at line 350 of file Printer.cpp.

References DontPrintAnything, M, and printCollection().

EquivalenceClasses<GlobalValue*>& llvm::EquivClassGraphs::getGlobalECs (  )  [inline]

Definition at line 376 of file DataStructure.h.

References GlobalECs.

DSGraph& llvm::EquivClassGraphs::getDSGraph ( const Function F  )  const [inline]

getDSGraph - Return the data structure graph for the specified function. This returns the folded graph. The folded graph is the same as the CBU graph iff the function is in a singleton equivalence class AND all its callees also have the same folded graph as the CBU graph.

Definition at line 383 of file DataStructure.h.

References DSInfo, and F.

Referenced by getSomeCalleeForCallSite().

bool llvm::EquivClassGraphs::hasGraph ( const Function F  )  const [inline]

Definition at line 389 of file DataStructure.h.

References DSInfo, and F.

bool llvm::EquivClassGraphs::ContainsDSGraphFor ( const Function F  )  const [inline]

ContainsDSGraphFor - Return true if we have a graph for the specified function.

Definition at line 395 of file DataStructure.h.

References DSInfo, and F.

Function * EquivClassGraphs::getSomeCalleeForCallSite ( const CallSite CS  )  const

getSomeCalleeForCallSite - Return any one callee function at a call site.

Definition at line 58 of file EquivClassGraphs.cpp.

References llvm::CallSite::getCalledValue(), llvm::CallSite::getCaller(), getDSGraph(), llvm::DSGraph::getNodeForValue(), and OneCalledFunction.

DSGraph& llvm::EquivClassGraphs::getGlobalsGraph (  )  const [inline]

Definition at line 404 of file DataStructure.h.

References GlobalsGraph.

Referenced by runOnModule().

const ActualCalleesTy& llvm::EquivClassGraphs::getActualCallees (  )  const [inline]

Definition at line 409 of file DataStructure.h.

References ActualCallees.

callee_iterator llvm::EquivClassGraphs::callee_begin ( Instruction I  )  const [inline]

Definition at line 414 of file DataStructure.h.

References ActualCallees.

callee_iterator llvm::EquivClassGraphs::callee_end ( Instruction I  )  const [inline]

Definition at line 418 of file DataStructure.h.

References ActualCallees.

virtual void llvm::EquivClassGraphs::getAnalysisUsage ( AnalysisUsage AU  )  const [inline, virtual]

getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job. If a pass specifies that it uses a particular analysis result to this function, it can then use the getAnalysis<AnalysisType>() function, below.

Reimplemented from llvm::Pass.

Definition at line 423 of file DataStructure.h.

References llvm::AnalysisUsage::addRequired(), and llvm::AnalysisUsage::setPreservesAll().


Member Data Documentation

CompleteBUDataStructures* llvm::EquivClassGraphs::CBU

Definition at line 342 of file DataStructure.h.

Referenced by runOnModule().

DSGraph* llvm::EquivClassGraphs::GlobalsGraph

Definition at line 344 of file DataStructure.h.

Referenced by getGlobalsGraph(), and runOnModule().

hash_map<const Function*, DSGraph*> llvm::EquivClassGraphs::DSInfo

Definition at line 347 of file DataStructure.h.

Referenced by ContainsDSGraphFor(), getDSGraph(), and hasGraph().

std::set<std::pair<Instruction*, Function*> > llvm::EquivClassGraphs::ActualCallees

ActualCallees - The actual functions callable from indirect call sites.

Definition at line 351 of file DataStructure.h.

Referenced by callee_begin(), callee_end(), getActualCallees(), and runOnModule().

EquivalenceClasses<Function*> llvm::EquivClassGraphs::FuncECs

Definition at line 355 of file DataStructure.h.

std::map<DSNode*, Function *> llvm::EquivClassGraphs::OneCalledFunction

OneCalledFunction - For each indirect call, we keep track of one target of the call. This is used to find equivalence class called by a call site.

Definition at line 360 of file DataStructure.h.

Referenced by getSomeCalleeForCallSite().

EquivalenceClasses<GlobalValue*> llvm::EquivClassGraphs::GlobalECs

GlobalECs - The equivalence classes for each global value that is merged with other global values in the DSGraphs.

Definition at line 364 of file DataStructure.h.

Referenced by getGlobalECs(), and runOnModule().


The documentation for this struct was generated from the following files: