LLVM 22.0.0git
llvm::LastRunTrackingInfo Class Reference

This class is used to track the last run of a set of module/function passes. More...

#include "llvm/Analysis/LastRunTrackingAnalysis.h"

Public Types

using PassID = const void *
using OptionPtr = const void *
using CompatibilityCheckFn = std::function<bool(OptionPtr)>

Public Member Functions

template<typename OptionT>
bool shouldSkip (PassID ID, const OptionT &Opt) const
 Check if we should skip a pass.
bool shouldSkip (PassID ID) const
template<typename OptionT>
void update (PassID ID, bool Changed, const OptionT &Opt)
 Update the tracking info.
void update (PassID ID, bool Changed)

Detailed Description

This class is used to track the last run of a set of module/function passes.

Invalidation are conservatively handled by the pass manager if a pass doesn't explicitly preserve the result. If we want to skip a pass, we should define a unique ID PassID to identify the pass, which is usually a pointer to a static member. If a pass has parameters, they should be stored in a struct OptionT with a method bool isCompatibleWith(const OptionT& LastOpt) const to check compatibility.

Definition at line 47 of file LastRunTrackingAnalysis.h.

Member Typedef Documentation

◆ CompatibilityCheckFn

Definition at line 52 of file LastRunTrackingAnalysis.h.

◆ OptionPtr

Definition at line 50 of file LastRunTrackingAnalysis.h.

◆ PassID

Definition at line 49 of file LastRunTrackingAnalysis.h.

Member Function Documentation

◆ shouldSkip() [1/2]

bool llvm::LastRunTrackingInfo::shouldSkip ( PassID ID) const
inline

Definition at line 64 of file LastRunTrackingAnalysis.h.

◆ shouldSkip() [2/2]

template<typename OptionT>
bool llvm::LastRunTrackingInfo::shouldSkip ( PassID ID,
const OptionT & Opt ) const
inline

Check if we should skip a pass.

Parameters
IDThe unique ID of the pass.
OptThe parameters of the pass. If the pass has no parameters, use shouldSkip(PassID ID) instead.
Returns
True if we should skip the pass.
See also
shouldSkip(PassID ID)

Definition at line 61 of file LastRunTrackingAnalysis.h.

◆ update() [1/2]

void llvm::LastRunTrackingInfo::update ( PassID ID,
bool Changed )
inline

Definition at line 79 of file LastRunTrackingAnalysis.h.

References Changed.

◆ update() [2/2]

template<typename OptionT>
void llvm::LastRunTrackingInfo::update ( PassID ID,
bool Changed,
const OptionT & Opt )
inline

Update the tracking info.

Parameters
IDThe unique ID of the pass.
ChangedWhether the pass makes changes.
OptThe parameters of the pass. It must have the same type as the parameters of the last run. If the pass has no parameters, use update(PassID ID, bool Changed) instead.
See also
update(PassID ID, bool Changed)

Definition at line 74 of file LastRunTrackingAnalysis.h.

References Changed, and Ptr.


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