class PassInstrumentation

Declaration

class PassInstrumentation { /* full declaration omitted */ };

Description

This class provides instrumentation entry points for the Pass Manager, doing calls to callbacks registered in PassInstrumentationCallbacks.

Declared at: llvm/include/llvm/IR/PassInstrumentation.h:180

Member Variables

private llvm::PassInstrumentationCallbacks* Callbacks

Method Overview

  • public PassInstrumentation(llvm::PassInstrumentationCallbacks * CB = nullptr)
  • public template <typename IRUnitT, typename... ExtraArgsT>bool invalidate(IRUnitT &, const class llvm::PreservedAnalyses &, ExtraArgsT...)
  • private template <typename PassT>static std::enable_if_t<is_detected<llvm::PassInstrumentation::has_required_t, PassT>::value, bool> isRequired(const PassT & Pass)
  • private template <typename PassT>static std::enable_if_t<!is_detected<llvm::PassInstrumentation::has_required_t, PassT>::value, bool> isRequired(const PassT & Pass)
  • public void popBeforeNonSkippedPassCallback()
  • public template <typename CallableT>void pushBeforeNonSkippedPassCallback(CallableT C)
  • public template <typename IRUnitT, typename PassT>void runAfterAnalysis(const PassT & Analysis, const IRUnitT & IR) const
  • public template <typename IRUnitT, typename PassT>void runAfterPass(const PassT & Pass, const IRUnitT & IR, const llvm::PreservedAnalyses & PA) const
  • public template <typename IRUnitT, typename PassT>void runAfterPassInvalidated(const PassT & Pass, const llvm::PreservedAnalyses & PA) const
  • public void runAnalysesCleared(llvm::StringRef Name) const
  • public template <typename IRUnitT, typename PassT>void runAnalysisInvalidated(const PassT & Analysis, const IRUnitT & IR) const
  • public template <typename IRUnitT, typename PassT>void runBeforeAnalysis(const PassT & Analysis, const IRUnitT & IR) const
  • public template <typename IRUnitT, typename PassT>bool runBeforePass(const PassT & Pass, const IRUnitT & IR) const

Methods

PassInstrumentation(
    llvm::PassInstrumentationCallbacks* CB =
        nullptr)

Description

Callbacks object is not owned by PassInstrumentation, its life-time should at least match the life-time of corresponding PassInstrumentationAnalysis (which usually is till the end of current compilation).

Declared at: llvm/include/llvm/IR/PassInstrumentation.h:208

Parameters

llvm::PassInstrumentationCallbacks* CB = nullptr

template <typename IRUnitT,
          typename... ExtraArgsT>
bool invalidate(
    IRUnitT&,
    const class llvm::PreservedAnalyses&,
    ExtraArgsT...)

Description

Handle invalidation from the pass manager when PassInstrumentation is used as the result of PassInstrumentationAnalysis. On attempt to invalidate just return false. There is nothing to become invalid here.

Declared at: llvm/include/llvm/IR/PassInstrumentation.h:302

Templates

IRUnitT
ExtraArgsT

Parameters

IRUnitT&
const class llvm::PreservedAnalyses&
ExtraArgsT...

template <typename PassT>
static std::enable_if_t<
    is_detected<
        llvm::PassInstrumentation::has_required_t,
        PassT>::value,
    bool>
isRequired(const PassT& Pass)

Declared at: llvm/include/llvm/IR/PassInstrumentation.h:194

Templates

PassT

Parameters

const PassT& Pass

template <typename PassT>
static std::enable_if_t<
    !is_detected<
        llvm::PassInstrumentation::has_required_t,
        PassT>::value,
    bool>
isRequired(const PassT& Pass)

Declared at: llvm/include/llvm/IR/PassInstrumentation.h:199

Templates

PassT

Parameters

const PassT& Pass

void popBeforeNonSkippedPassCallback()

Declared at: llvm/include/llvm/IR/PassInstrumentation.h:312

template <typename CallableT>
void pushBeforeNonSkippedPassCallback(CallableT C)

Declared at: llvm/include/llvm/IR/PassInstrumentation.h:308

Templates

CallableT

Parameters

CallableT C

template <typename IRUnitT, typename PassT>
void runAfterAnalysis(const PassT& Analysis,
                      const IRUnitT& IR) const

Description

AfterAnalysis instrumentation point - takes \p Analysis instance that has just been executed and constant reference to IR it operated on.

Declared at: llvm/include/llvm/IR/PassInstrumentation.h:272

Templates

IRUnitT
PassT

Parameters

const PassT& Analysis
const IRUnitT& IR

template <typename IRUnitT, typename PassT>
void runAfterPass(
    const PassT& Pass,
    const IRUnitT& IR,
    const llvm::PreservedAnalyses& PA) const

Description

AfterPass instrumentation point - takes \p Pass instance that has just been executed and constant reference to \p IR it operates on.\p IR is guaranteed to be valid at this point.

Declared at: llvm/include/llvm/IR/PassInstrumentation.h:242

Templates

IRUnitT
PassT

Parameters

const PassT& Pass
const IRUnitT& IR
const llvm::PreservedAnalyses& PA

template <typename IRUnitT, typename PassT>
void runAfterPassInvalidated(
    const PassT& Pass,
    const llvm::PreservedAnalyses& PA) const

Description

AfterPassInvalidated instrumentation point - takes \p Pass instance that has just been executed. For use when IR has been invalidated by \p Pass execution.

Declared at: llvm/include/llvm/IR/PassInstrumentation.h:253

Templates

IRUnitT
PassT

Parameters

const PassT& Pass
const llvm::PreservedAnalyses& PA

void runAnalysesCleared(
    llvm::StringRef Name) const

Description

AnalysesCleared instrumentation point - takes name of IR that analyses operated on.

Declared at: llvm/include/llvm/IR/PassInstrumentation.h:290

Parameters

llvm::StringRef Name

template <typename IRUnitT, typename PassT>
void runAnalysisInvalidated(
    const PassT& Analysis,
    const IRUnitT& IR) const

Description

AnalysisInvalidated instrumentation point - takes \p Analysis instance that has just been invalidated and constant reference to IR it operated on.

Declared at: llvm/include/llvm/IR/PassInstrumentation.h:282

Templates

IRUnitT
PassT

Parameters

const PassT& Analysis
const IRUnitT& IR

template <typename IRUnitT, typename PassT>
void runBeforeAnalysis(const PassT& Analysis,
                       const IRUnitT& IR) const

Description

BeforeAnalysis instrumentation point - takes \p Analysis instance to be executed and constant reference to IR it operates on.

Declared at: llvm/include/llvm/IR/PassInstrumentation.h:263

Templates

IRUnitT
PassT

Parameters

const PassT& Analysis
const IRUnitT& IR

template <typename IRUnitT, typename PassT>
bool runBeforePass(const PassT& Pass,
                   const IRUnitT& IR) const

Description

BeforePass instrumentation point - takes \p Pass instance to be executed and constant reference to IR it operates on.

Declared at: llvm/include/llvm/IR/PassInstrumentation.h:217

Templates

IRUnitT
PassT

Parameters

const PassT& Pass
const IRUnitT& IR

Returns

true if pass is allowed to be executed. These are only run on optional pass since required passes must always be run. This allows these callbacks to print info when they want to skip a pass.