LLVM 19.0.0git
Namespaces | Macros | Functions | Variables
CGSCCPassManager.cpp File Reference
#include "llvm/Analysis/CGSCCPassManager.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/PriorityWorklist.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/Constant.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/PassManager.h"
#include "llvm/IR/PassManagerImpl.h"
#include "llvm/IR/ValueHandle.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <iterator>
#include <optional>

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Macros

#define DEBUG_TYPE   "cgscc"
 

Functions

static void updateNewSCCFunctionAnalyses (LazyCallGraph::SCC &C, LazyCallGraph &G, CGSCCAnalysisManager &AM, FunctionAnalysisManager &FAM)
 When a new SCC is created for the graph we first update the FunctionAnalysisManager in the Proxy's result.
 
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.
 
static LazyCallGraph::SCCupdateCGAndAnalysisManagerForPass (LazyCallGraph &G, LazyCallGraph::SCC &InitialC, LazyCallGraph::Node &N, CGSCCAnalysisManager &AM, CGSCCUpdateResult &UR, FunctionAnalysisManager &FAM, bool FunctionPass)
 

Variables

static cl::opt< boolllvm::AbortOnMaxDevirtIterationsReached ("abort-on-max-devirt-iterations-reached", cl::desc("Abort when the max iterations for devirtualization CGSCC repeat " "pass is reached"))
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "cgscc"

Definition at line 34 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 807 of file CGSCCPassManager.cpp.

References assert(), llvm::CallingConv::C, llvm::CGSCCUpdateResult::CWorklist, llvm::dbgs(), llvm::drop_begin(), FAM, G, llvm::AnalysisManager< IRUnitT, ExtraArgTs >::getCachedResult(), llvm::AnalysisManager< IRUnitT, ExtraArgTs >::invalidate(), LLVM_DEBUG, N, llvm::reverse(), and updateNewSCCFunctionAnalyses().

Referenced by updateCGAndAnalysisManagerForPass().

◆ updateCGAndAnalysisManagerForPass()

static LazyCallGraph::SCC & updateCGAndAnalysisManagerForPass ( LazyCallGraph G,
LazyCallGraph::SCC InitialC,
LazyCallGraph::Node N,
CGSCCAnalysisManager AM,
CGSCCUpdateResult UR,
FunctionAnalysisManager FAM,
bool  FunctionPass 
)
static

◆ updateNewSCCFunctionAnalyses()

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

When a new SCC is created for the graph we first update the FunctionAnalysisManager in the Proxy's result.

As 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 763 of file CGSCCPassManager.cpp.

References llvm::PreservedAnalyses::all(), llvm::CallingConv::C, F, FAM, G, llvm::AnalysisManager< IRUnitT, ExtraArgTs >::getCachedResult(), llvm::AnalysisManager< IRUnitT, ExtraArgTs >::getResult(), llvm::AnalysisManager< IRUnitT, ExtraArgTs >::invalidate(), and N.

Referenced by incorporateNewSCCRange().