LLVM API Documentation

BottomUpClosure.cpp File Reference

#include "llvm/Analysis/DataStructure/DataStructure.h"
#include "llvm/Analysis/DataStructure/DSGraph.h"
#include "llvm/Module.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Timer.h"
#include <iostream>

Include dependency graph for BottomUpClosure.cpp:

Go to the source code of this file.

Functions

static void BuildGlobalECs (DSGraph &GG, std::set< GlobalValue * > &ECGlobals)
static void EliminateUsesOfECGlobals (DSGraph &G, const std::set< GlobalValue * > &ECGlobals)
static bool isVAHackFn (const Function *F)
static bool isResolvableFunc (const Function *callee)
static void GetAllCallees (const DSCallSite &CS, std::vector< Function * > &Callees)
static void GetAllAuxCallees (DSGraph &G, std::vector< Function * > &Callees)
static const FunctiongetFnForValue (const Value *V)

Variables

Statistic MaxSCC ("budatastructure","Maximum SCC Size in Call Graph")
Statistic NumBUInlines ("budatastructures","Number of graphs inlined")
Statistic NumCallEdges ("budatastructures","Number of 'actual' call edges")
RegisterAnalysis< BUDataStructuresX ("budatastructure","Bottom-up Data Structure Analysis")


Function Documentation

static void BuildGlobalECs ( DSGraph GG,
std::set< GlobalValue * > &  ECGlobals 
) [static]

BuildGlobalECs - Look at all of the nodes in the globals graph. If any node contains multiple globals, DSA will never, ever, be able to tell the globals apart. Instead of maintaining this information in all of the graphs throughout the entire program, store only a single global (the "leader") in the graphs, and build equivalence classes for the rest of the globals.

Definition at line 40 of file BottomUpClosure.cpp.

References llvm::DSGraph::AssertGraphOK(), DEBUG, E, llvm::DSScalarMap::erase(), llvm::DSScalarMap::find(), llvm::DSScalarMap::getGlobalECs(), llvm::DSGraph::getScalarMap(), GlobalECs, I, llvm::DSGraph::node_begin(), and llvm::DSGraph::node_end().

Referenced by llvm::LocalDataStructures::runOnModule(), and llvm::BUDataStructures::runOnModule().

static void EliminateUsesOfECGlobals ( DSGraph G,
const std::set< GlobalValue * > &  ECGlobals 
) [static]

EliminateUsesOfECGlobals - Once we have determined that some globals are in really just equivalent to some other globals, remove the globals from the specified DSGraph (if present), and merge any nodes with their leader nodes.

Definition at line 75 of file BottomUpClosure.cpp.

References llvm::DSNode::addGlobal(), llvm::DSGraph::AssertGraphOK(), DEBUG, E, llvm::DSScalarMap::erase(), G, llvm::DSScalarMap::getGlobalECs(), llvm::DSNodeHandle::getNode(), llvm::DSGraph::getScalarMap(), GI, llvm::DSScalarMap::global_begin(), llvm::DSScalarMap::global_count(), llvm::DSScalarMap::global_end(), GlobalECs, GV, llvm::DSNodeHandle::isNull(), MadeChange, llvm::DSNodeHandle::mergeWith(), and llvm::DSNode::removeGlobal().

Referenced by llvm::LocalDataStructures::runOnModule(), and llvm::BUDataStructures::runOnModule().

static void GetAllAuxCallees ( DSGraph G,
std::vector< Function * > &  Callees 
) [static]

GetAllAuxCallees - Return a list containing all of the resolvable callees in the aux list for the specified graph in the Callees vector.

Definition at line 261 of file BottomUpClosure.cpp.

References llvm::DSGraph::afc_begin(), llvm::DSGraph::afc_end(), E, G, GetAllCallees(), and I.

static void GetAllCallees ( const DSCallSite CS,
std::vector< Function * > &  Callees 
) [static]

Definition at line 239 of file BottomUpClosure.cpp.

References llvm::DSNode::addFullFunctionList(), llvm::DSCallSite::getCalleeFunc(), llvm::DSCallSite::getCalleeNode(), llvm::DSCallSite::isDirectCall(), llvm::DSNode::isIncomplete(), and isResolvableFunc().

Referenced by GetAllAuxCallees().

static const Function* getFnForValue ( const Value V  )  [static]

Definition at line 618 of file BottomUpClosure.cpp.

References A, BB, llvm::BasicBlock::getParent(), llvm::GlobalValue::getParent(), and V.

Referenced by llvm::TDDataStructures::copyValue(), llvm::BUDataStructures::copyValue(), llvm::TDDataStructures::deleteValue(), and llvm::BUDataStructures::deleteValue().

static bool isResolvableFunc ( const Function callee  )  [static]

Definition at line 235 of file BottomUpClosure.cpp.

References llvm::Function::isExternal(), and isVAHackFn().

Referenced by GetAllCallees().

static bool isVAHackFn ( const Function F  )  [static]

Definition at line 227 of file BottomUpClosure.cpp.

References F.

Referenced by isResolvableFunc().


Variable Documentation

Statistic MaxSCC("budatastructure","Maximum SCC Size in Call Graph") [static]

Statistic NumBUInlines("budatastructures","Number of graphs inlined") [static]

Statistic NumCallEdges("budatastructures","Number of 'actual' call edges") [static]

Referenced by llvm::BUDataStructures::runOnModule().

RegisterAnalysis<BUDataStructures> X("budatastructure","Bottom-up Data Structure Analysis") [static]