LLVM 20.0.0git
Public Member Functions | Friends | List of all members
llvm::AnalysisManager< IRUnitT, ExtraArgTs >::Invalidator Class Reference

API to communicate dependencies between analyses during invalidation. More...

#include "llvm/IR/PassManager.h"

Public Member Functions

template<typename PassT >
bool invalidate (IRUnitT &IR, const PreservedAnalyses &PA)
 Trigger the invalidation of some other analysis pass if not already handled and return whether it was in fact invalidated.
 
bool invalidate (AnalysisKey *ID, IRUnitT &IR, const PreservedAnalyses &PA)
 A type-erased variant of the above invalidate method with the same core API other than passing an analysis ID rather than an analysis type parameter.
 

Friends

class AnalysisManager
 

Detailed Description

template<typename IRUnitT, typename... ExtraArgTs>
class llvm::AnalysisManager< IRUnitT, ExtraArgTs >::Invalidator

API to communicate dependencies between analyses during invalidation.

When an analysis result embeds handles to other analysis results, it needs to be invalidated both when its own information isn't preserved and when any of its embedded analysis results end up invalidated. We pass an Invalidator object as an argument to invalidate() in order to let the analysis results themselves define the dependency graph on the fly. This lets us avoid building an explicit representation of the dependencies between analysis results.

Definition at line 292 of file PassManager.h.

Member Function Documentation

◆ invalidate() [1/2]

template<typename IRUnitT , typename... ExtraArgTs>
bool llvm::AnalysisManager< IRUnitT, ExtraArgTs >::Invalidator::invalidate ( AnalysisKey ID,
IRUnitT &  IR,
const PreservedAnalyses PA 
)
inline

A type-erased variant of the above invalidate method with the same core API other than passing an analysis ID rather than an analysis type parameter.

This is sadly less efficient than the above routine, which leverages the type parameter to avoid the type erasure overhead.

Definition at line 324 of file PassManager.h.

References IR.

◆ invalidate() [2/2]

template<typename IRUnitT , typename... ExtraArgTs>
template<typename PassT >
bool llvm::AnalysisManager< IRUnitT, ExtraArgTs >::Invalidator::invalidate ( IRUnitT &  IR,
const PreservedAnalyses PA 
)
inline

Trigger the invalidation of some other analysis pass if not already handled and return whether it was in fact invalidated.

This is expected to be called from within a given analysis result's invalidate method to trigger a depth-first walk of all inter-analysis dependencies. The same IR unit and PA passed to that result's invalidate method should in turn be provided to this routine.

The first time this is called for a given analysis pass, it will call the corresponding result's invalidate method. Subsequent calls will use a cache of the results of that initial call. It is an error to form cyclic dependencies between analysis results.

This returns true if the given analysis's result is invalid. Any dependecies on it will become invalid as a result.

Definition at line 310 of file PassManager.h.

References IR.

Referenced by llvm::AAResults::invalidate(), llvm::DependenceInfo::invalidate(), llvm::LoopAccessInfoManager::invalidate(), llvm::MemoryDependenceResults::invalidate(), llvm::MemorySSAAnalysis::Result::invalidate(), llvm::OptimizationRemarkEmitter::invalidate(), llvm::ScalarEvolution::invalidate(), llvm::SCEVAAResult::invalidate(), llvm::BasicAAResult::invalidate(), llvm::OuterAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs >::Result::invalidate(), llvm::FunctionAnalysisManagerCGSCCProxy::Result::invalidate(), llvm::MachineOptimizationRemarkEmitter::invalidate(), llvm::SpillPlacement::invalidate(), and llvm::CGSCCAnalysisManagerModuleProxy::Result::invalidate().

Friends And Related Function Documentation

◆ AnalysisManager

template<typename IRUnitT , typename... ExtraArgTs>
friend class AnalysisManager
friend

Definition at line 329 of file PassManager.h.


The documentation for this class was generated from the following file: