LLVM API Documentation

Classes | Namespaces
LazyCallGraph.h File Reference
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/PointerUnion.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/iterator.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/Allocator.h"
#include <iterator>
Include dependency graph for LazyCallGraph.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  llvm::LazyCallGraph
 A lazily constructed view of the call graph of a module. More...
class  llvm::LazyCallGraph::iterator
 A lazy iterator used for both the entry nodes and child nodes. More...
class  llvm::LazyCallGraph::Node
 A node in the call graph. More...
class  llvm::LazyCallGraph::SCC
 An SCC of the call graph. More...
class  llvm::LazyCallGraph::postorder_scc_iterator
 A post-order depth-first SCC iterator over the call graph. More...
struct  llvm::LazyCallGraph::postorder_scc_iterator::IsAtEndT
 Nonce type to select the constructor for the end iterator.
struct  llvm::GraphTraits< LazyCallGraph::Node * >
struct  llvm::GraphTraits< LazyCallGraph * >
class  llvm::LazyCallGraphAnalysis
 An analysis pass which computes the call graph for a module. More...
class  llvm::LazyCallGraphPrinterPass
 A pass which prints the call graph to a raw_ostream. More...

Namespaces

namespace  llvm
 

List of target independent CodeGen pass IDs.



Detailed Description

Implements a lazy call graph analysis and related passes for the new pass manager.

NB: This is *not* a traditional call graph! It is a graph which models both the current calls and potential calls. As a consequence there are many edges in this call graph that do not correspond to a 'call' or 'invoke' instruction.

The primary use cases of this graph analysis is to facilitate iterating across the functions of a module in ways that ensure all callees are visited prior to a caller (given any SCC constraints), or vice versa. As such is it particularly well suited to organizing CGSCC optimizations such as inlining, outlining, argument promotion, etc. That is its primary use case and motivates the design. It may not be appropriate for other purposes. The use graph of functions or some other conservative analysis of call instructions may be interesting for optimizations and subsequent analyses which don't work in the context of an overly specified potential-call-edge graph.

To understand the specific rules and nature of this call graph analysis, see the documentation of the LazyCallGraph below.

Definition in file LazyCallGraph.h.