class AnalysisManager::Invalidator

Declaration

class AnalysisManager::Invalidator { /* full declaration omitted */ };

Description

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\c Invalidator object as an argument to \c 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.

Declared at: llvm/include/llvm/IR/PassManager.h:667

Member Variables

private SmallDenseMap<llvm::AnalysisKey*, bool, 8>& IsResultInvalidated
private const llvm::AnalysisManager::AnalysisResultMapT& Results

Method Overview

  • private Invalidator(SmallDenseMap<llvm::AnalysisKey *, bool, 8> & IsResultInvalidated, const llvm::AnalysisManager::AnalysisResultMapT & Results)
  • public bool invalidate(llvm::AnalysisKey * ID, IRUnitT & IR, const llvm::PreservedAnalyses & PA)
  • public template <typename PassT>bool invalidate(IRUnitT & IR, const llvm::PreservedAnalyses & PA)
  • private template <typename ResultT = llvm::AnalysisManager::ResultConceptT>bool invalidateImpl(llvm::AnalysisKey * ID, IRUnitT & IR, const llvm::PreservedAnalyses & PA)

Methods

Invalidator(
    SmallDenseMap<llvm::AnalysisKey*, bool, 8>&
        IsResultInvalidated,
    const llvm::AnalysisManager::
        AnalysisResultMapT& Results)

Declared at: llvm/include/llvm/IR/PassManager.h:737

Parameters

SmallDenseMap<llvm::AnalysisKey*, bool, 8>& IsResultInvalidated
const llvm::AnalysisManager::AnalysisResultMapT& Results

bool invalidate(llvm::AnalysisKey* ID,
                IRUnitT& IR,
                const llvm::PreservedAnalyses& PA)

Description

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.

Declared at: llvm/include/llvm/IR/PassManager.h:699

Parameters

llvm::AnalysisKey* ID
IRUnitT& IR
const llvm::PreservedAnalyses& PA

template <typename PassT>
bool invalidate(IRUnitT& IR,
                const llvm::PreservedAnalyses& PA)

Description

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 \c invalidate method to trigger a depth-first walk of all inter-analysis dependencies. The same \p IR unit and \p PA passed to that result's \c 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 \c 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.

Declared at: llvm/include/llvm/IR/PassManager.h:685

Templates

PassT

Parameters

IRUnitT& IR
const llvm::PreservedAnalyses& PA

template <
    typename ResultT =
        llvm::AnalysisManager::ResultConceptT>
bool invalidateImpl(
    llvm::AnalysisKey* ID,
    IRUnitT& IR,
    const llvm::PreservedAnalyses& PA)

Declared at: llvm/include/llvm/IR/PassManager.h:707

Templates

ResultT = llvm::AnalysisManager::ResultConceptT

Parameters

llvm::AnalysisKey* ID
IRUnitT& IR
const llvm::PreservedAnalyses& PA