LLVM  6.0.0svn
Namespaces | Macros | Functions
CGSCCPassManager.cpp File Reference
#include "llvm/Analysis/CGSCCPassManager.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Optional.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_range.h"
#include "llvm/Analysis/LazyCallGraph.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/PassManager.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <iterator>
Include dependency graph for CGSCCPassManager.cpp:

Go to the source code of this file.

Namespaces

 llvm
 Compute iterated dominance frontiers using a linear time algorithm.
 

Macros

#define DEBUG_TYPE   "cgscc"
 

Functions

static void updateNewSCCFunctionAnalyses (LazyCallGraph::SCC &C, LazyCallGraph &G, CGSCCAnalysisManager &AM)
 When a new SCC is created for the graph and there might be function analysis results cached for the functions now in that SCC two forms of updates are required. More...
 
template<typename SCCRangeT >
static LazyCallGraph::SCCincorporateNewSCCRange (const SCCRangeT &NewSCCRange, LazyCallGraph &G, LazyCallGraph::Node &N, LazyCallGraph::SCC *C, CGSCCAnalysisManager &AM, CGSCCUpdateResult &UR)
 Helper function to update both the CGSCCAnalysisManager AM and the CGSCCPassManager's CGSCCUpdateResult UR based on a range of newly added SCCs. More...
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "cgscc"

Definition at line 31 of file CGSCCPassManager.cpp.

Function Documentation

◆ incorporateNewSCCRange()

template<typename SCCRangeT >
static LazyCallGraph::SCC* incorporateNewSCCRange ( const SCCRangeT &  NewSCCRange,
LazyCallGraph G,
LazyCallGraph::Node N,
LazyCallGraph::SCC C,
CGSCCAnalysisManager AM,
CGSCCUpdateResult UR 
)
static

Helper function to update both the CGSCCAnalysisManager AM and the CGSCCPassManager's CGSCCUpdateResult UR based on a range of newly added SCCs.

The range of new SCCs must be in postorder already. The SCC they were split out of must be provided as C. The current node being mutated and triggering updates must be passed as N.

This function returns the SCC containing N. This will be either C if no new SCCs have been split out, or it will be the new SCC containing N.

Definition at line 346 of file CGSCCPassManager.cpp.

References assert(), llvm::LazyCallGraph::SCC::begin(), C, llvm::CGSCCUpdateResult::CWorklist, llvm::dbgs(), DEBUG, llvm::AnalysisManager< IRUnitT, ExtraArgTs >::getCachedResult(), llvm::AnalysisManager< IRUnitT, ExtraArgTs >::invalidate(), llvm::LazyCallGraph::lookupSCC(), llvm::make_range(), llvm::PreservedAnalyses::preserve(), llvm::reverse(), and updateNewSCCFunctionAnalyses().

Referenced by llvm::updateCGAndAnalysisManagerForFunctionPass().

◆ updateNewSCCFunctionAnalyses()

static void updateNewSCCFunctionAnalyses ( LazyCallGraph::SCC C,
LazyCallGraph G,
CGSCCAnalysisManager AM 
)
static

When a new SCC is created for the graph and there might be function analysis results cached for the functions now in that SCC two forms of updates are required.

First, a proxy from the SCC to the FunctionAnalysisManager needs to be created so that any subsequent invalidation events to the SCC are propagated to the function analysis results cached for functions within it.

Second, if any of the functions within the SCC have analysis results with outer analysis dependencies, then those dependencies would point to the wrong SCC's analysis result. We forcibly invalidate the necessary function analyses so that they don't retain stale handles.

Definition at line 301 of file CGSCCPassManager.cpp.

References llvm::PreservedAnalyses::all(), C, F(), G, llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs >::Result::getManager(), llvm::AnalysisManager< IRUnitT, ExtraArgTs >::getResult(), and N.

Referenced by incorporateNewSCCRange().