LLVM 20.0.0git
|
#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/raw_ostream.h"
#include <cassert>
#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::SCC * | incorporateNewSCCRange (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::SCC & | updateCGAndAnalysisManagerForPass (LazyCallGraph &G, LazyCallGraph::SCC &InitialC, LazyCallGraph::Node &N, CGSCCAnalysisManager &AM, CGSCCUpdateResult &UR, FunctionAnalysisManager &FAM, bool FunctionPass) |
Variables | |
static cl::opt< bool > | llvm::AbortOnMaxDevirtIterationsReached ("abort-on-max-devirt-iterations-reached", cl::desc("Abort when the max iterations for devirtualization CGSCC repeat " "pass is reached")) |
#define DEBUG_TYPE "cgscc" |
Definition at line 32 of file CGSCCPassManager.cpp.
|
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 813 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().
|
static |
Definition at line 874 of file CGSCCPassManager.cpp.
References assert(), llvm::CallingConv::C, llvm::SmallPtrSetImpl< PtrType >::count(), llvm::CGSCCUpdateResult::CWorklist, llvm::dbgs(), llvm::erase_if(), F, FAM, G, llvm::AnalysisManager< IRUnitT, ExtraArgTs >::getCachedResult(), llvm::LazyCallGraph::SCC::getOuterRefSCC(), llvm::AnalysisManager< IRUnitT, ExtraArgTs >::getResult(), I, incorporateNewSCCRange(), llvm::CGSCCUpdateResult::IndirectVHs, llvm::SetVector< T, Vector, Set, N >::insert(), llvm::SmallPtrSetImpl< PtrType >::insert(), instructions, llvm::AnalysisManager< IRUnitT, ExtraArgTs >::invalidate(), llvm::CGSCCUpdateResult::InvalidatedSCCs, LLVM_DEBUG, llvm::make_range(), N, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::reverse(), llvm::CGSCCUpdateResult::UpdatedC, and llvm::LazyCallGraph::visitReferences().
Referenced by llvm::updateCGAndAnalysisManagerForCGSCCPass(), and llvm::updateCGAndAnalysisManagerForFunctionPass().
|
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 769 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().