LLVM 20.0.0git
Public Types | Public Member Functions | List of all members
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 46 of file LastRunTrackingAnalysis.h.

Member Typedef Documentation

◆ CompatibilityCheckFn

Definition at line 51 of file LastRunTrackingAnalysis.h.

◆ OptionPtr

Definition at line 49 of file LastRunTrackingAnalysis.h.

◆ PassID

Definition at line 48 of file LastRunTrackingAnalysis.h.

Member Function Documentation

◆ shouldSkip() [1/2]

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

Definition at line 63 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 60 of file LastRunTrackingAnalysis.h.

◆ update() [1/2]

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

Definition at line 78 of file LastRunTrackingAnalysis.h.

◆ 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 73 of file LastRunTrackingAnalysis.h.

References Ptr.


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