LLVM API Documentation
#include "llvm/Analysis/DataStructure/DataStructure.h"
#include "llvm/Analysis/DataStructure/DSGraph.h"
#include "llvm/Module.h"
#include "llvm/DerivedTypes.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/CommandLine.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.
Defines | |
#define | DEBUG_TYPE "bu_dsa" |
Functions | |
static bool | GetAllCallees (const DSCallSite &CS, std::vector< Function * > &Callees) |
static void | BuildGlobalECs (DSGraph &GG, std::set< GlobalValue * > &ECGlobals) |
static void | EliminateUsesOfECGlobals (DSGraph &G, const std::set< GlobalValue * > &ECGlobals) |
static void | AddGlobalToNode (BUDataStructures *B, DSCallSite D, Function *F) |
static bool | isVAHackFn (const Function *F) |
static bool | isResolvableFunc (const Function *callee) |
static void | GetAllAuxCallees (DSGraph &G, std::vector< Function * > &Callees) |
static const Function * | getFnForValue (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") |
cl::opt< bool > | AddGlobals ("budatastructures-annotate-calls", cl::desc("Annotate call sites with functions as they are resolved")) |
cl::opt< bool > | UpdateGlobals ("budatastructures-update-from-globals", cl::desc("Update local graph from global graph when processing function")) |
RegisterAnalysis< BUDataStructures > | X ("budatastructure","Bottom-up Data Structure Analysis") |
#define DEBUG_TYPE "bu_dsa" |
Definition at line 16 of file BottomUpClosure.cpp.
static void AddGlobalToNode | ( | BUDataStructures * | B, | |
DSCallSite | D, | |||
Function * | F | |||
) | [static] |
Definition at line 129 of file BottomUpClosure.cpp.
References AddGlobals, B, D, DEBUG, F, llvm::DSCallSite::getCalleeNode(), llvm::DSNodeHandle::getNode(), GI, llvm::DSNodeHandle::isNull(), llvm::DSNode::mergeWith(), and llvm::DSNodeHandle::setTo().
Referenced by llvm::BUDataStructures::runOnModule().
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 52 of file BottomUpClosure.cpp.
References llvm::DSGraph::AssertGraphOK(), DEBUG, E, llvm::DSScalarMap::erase(), llvm::DSScalarMap::find(), llvm::DSScalarMap::getGlobalECs(), llvm::DSGraph::getScalarMap(), GlobalECs, 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 87 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().
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 316 of file BottomUpClosure.cpp.
References llvm::DSGraph::afc_begin(), llvm::DSGraph::afc_end(), E, G, and GetAllCallees().
static bool GetAllCallees | ( | const DSCallSite & | CS, | |
std::vector< Function * > & | Callees | |||
) | [static] |
Definition at line 288 of file BottomUpClosure.cpp.
References llvm::DSNode::addFullFunctionList(), llvm::DSCallSite::getCalleeFunc(), llvm::DSCallSite::getCalleeNode(), llvm::DSNode::isComplete(), llvm::DSCallSite::isDirectCall(), and isResolvableFunc().
Referenced by GetAllAuxCallees(), and llvm::BUDataStructures::runOnModule().
Definition at line 728 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 283 of file BottomUpClosure.cpp.
References llvm::Function::isExternal(), and isVAHackFn().
Referenced by GetAllCallees().
static bool isVAHackFn | ( | const Function * | F | ) | [static] |
cl::opt<bool> AddGlobals("budatastructures-annotate-calls", cl::desc("Annotate call sites with functions as they are resolved")) [static] |
Referenced by AddGlobalToNode().
Statistic NumBUInlines("budatastructures","Number of graphs inlined") [static] |
Statistic NumCallEdges("budatastructures","Number of 'actual' call edges") [static] |
Referenced by llvm::BUDataStructures::runOnModule().
cl::opt<bool> UpdateGlobals("budatastructures-update-from-globals", cl::desc("Update local graph from global graph when processing function")) [static] |
RegisterAnalysis<BUDataStructures> X("budatastructure","Bottom-up Data Structure Analysis") [static] |