LLVM 20.0.0git
Public Types | Public Member Functions | List of all members
llvm::AnalysisUsage Class Reference

Represent the analysis usage information of a pass. More...

#include "llvm/PassAnalysisSupport.h"

Public Types

using VectorType = SmallVectorImpl< AnalysisID >
 

Public Member Functions

 AnalysisUsage ()=default
 
AnalysisUsageaddPreserved (StringRef Arg)
 Add the Pass with the specified argument string to the set of analyses preserved by this pass.
 
void setPreservesAll ()
 Set by analyses that do not transform their input at all.
 
bool getPreservesAll () const
 Determine whether a pass said it does not transform its input at all.
 
void setPreservesCFG ()
 This function should be called by the pass, iff they do not:
 
const VectorTypegetRequiredSet () const
 
const VectorTypegetRequiredTransitiveSet () const
 
const VectorTypegetPreservedSet () const
 
const VectorTypegetUsedSet () const
 
AnalysisUsageaddRequiredID (const void *ID)
 
AnalysisUsageaddRequiredID (char &ID)
 
template<class PassClass >
AnalysisUsageaddRequired ()
 
AnalysisUsageaddRequiredTransitiveID (char &ID)
 
template<class PassClass >
AnalysisUsageaddRequiredTransitive ()
 
AnalysisUsageaddPreservedID (const void *ID)
 
AnalysisUsageaddPreservedID (char &ID)
 
template<class PassClass >
AnalysisUsageaddPreserved ()
 Add the specified Pass class to the set of analyses preserved by this pass.
 
AnalysisUsageaddUsedIfAvailableID (const void *ID)
 
AnalysisUsageaddUsedIfAvailableID (char &ID)
 
template<class PassClass >
AnalysisUsageaddUsedIfAvailable ()
 Add the specified Pass class to the set of analyses used by this pass.
 

Detailed Description

Represent the analysis usage information of a pass.

This tracks analyses that the pass REQUIRES (must be available when the pass runs), REQUIRES TRANSITIVE (must be available throughout the lifetime of the pass), and analyses that the pass PRESERVES (the pass does not invalidate the results of these analyses). This information is provided by a pass to the Pass infrastructure through the getAnalysisUsage virtual function.

Definition at line 47 of file PassAnalysisSupport.h.

Member Typedef Documentation

◆ VectorType

Definition at line 49 of file PassAnalysisSupport.h.

Constructor & Destructor Documentation

◆ AnalysisUsage()

llvm::AnalysisUsage::AnalysisUsage ( )
default

Member Function Documentation

◆ addPreserved() [1/2]

template<class PassClass >
AnalysisUsage & llvm::AnalysisUsage::addPreserved ( )
inline

◆ addPreserved() [2/2]

AnalysisUsage & AnalysisUsage::addPreserved ( StringRef  Arg)

Add the Pass with the specified argument string to the set of analyses preserved by this pass.

If no such Pass exists, do nothing. This can be useful when a pass is trivially preserved, but may not be linked in. Be careful about spelling!

Definition at line 262 of file Pass.cpp.

References llvm::PassInfo::getTypeInfo(), and llvm::Pass::lookupPassInfo().

◆ addPreservedID() [1/2]

AnalysisUsage & llvm::AnalysisUsage::addPreservedID ( char ID)
inline

Definition at line 92 of file PassAnalysisSupport.h.

◆ addPreservedID() [2/2]

AnalysisUsage & llvm::AnalysisUsage::addPreservedID ( const void *  ID)
inline

Add the specified ID to the set of analyses preserved by this pass.

Definition at line 88 of file PassAnalysisSupport.h.

Referenced by llvm::LiveIntervalsWrapperPass::getAnalysisUsage(), and llvm::getLoopAnalysisUsage().

◆ addRequired()

template<class PassClass >
AnalysisUsage & llvm::AnalysisUsage::addRequired ( )
inline

Definition at line 75 of file PassAnalysisSupport.h.

References addRequiredID().

Referenced by llvm::MachineTraceMetrics::getAnalysisUsage(), llvm::BlockFrequencyInfoWrapperPass::getAnalysisUsage(), llvm::BranchProbabilityInfoWrapperPass::getAnalysisUsage(), llvm::DominanceFrontierWrapperPass::getAnalysisUsage(), llvm::DOTGraphTraitsViewerWrapperPass< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::DOTGraphTraitsPrinterWrapperPass< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::DOTGraphTraitsModuleViewerWrapperPass< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::DOTGraphTraitsModulePrinterWrapperPass< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::GlobalsAAWrapperPass::getAnalysisUsage(), llvm::IVUsersWrapperPass::getAnalysisUsage(), llvm::LazyValueInfoWrapperPass::getAnalysisUsage(), llvm::MemoryDependenceWrapperPass::getAnalysisUsage(), llvm::ModuleSummaryIndexWrapperPass::getAnalysisUsage(), llvm::OptimizationRemarkEmitterWrapperPass::getAnalysisUsage(), llvm::RegionInfoPass::getAnalysisUsage(), llvm::SCEVAAWrapperPass::getAnalysisUsage(), llvm::StackSafetyGlobalInfoWrapperPass::getAnalysisUsage(), llvm::AsmPrinter::getAnalysisUsage(), llvm::ExecutionDomainFix::getAnalysisUsage(), llvm::InstructionSelect::getAnalysisUsage(), llvm::IRTranslator::getAnalysisUsage(), llvm::Legalizer::getAnalysisUsage(), llvm::LoadStoreOpt::getAnalysisUsage(), llvm::Localizer::getAnalysisUsage(), llvm::RegBankSelect::getAnalysisUsage(), llvm::LazyMachineBlockFrequencyInfoPass::getAnalysisUsage(), llvm::MachineBlockFrequencyInfoWrapperPass::getAnalysisUsage(), llvm::MachineDominanceFrontier::getAnalysisUsage(), llvm::MachineFunctionPass::getAnalysisUsage(), llvm::MachineLoopInfoWrapperPass::getAnalysisUsage(), llvm::MachineOptimizationRemarkEmitterPass::getAnalysisUsage(), llvm::MachinePipeliner::getAnalysisUsage(), llvm::MachineRegionInfoPass::getAnalysisUsage(), llvm::ReplaceWithVeclibLegacy::getAnalysisUsage(), llvm::SelectionDAGISelLegacy::getAnalysisUsage(), llvm::StackProtector::getAnalysisUsage(), llvm::InstructionCombiningPass::getAnalysisUsage(), llvm::BreakFalseDeps::getAnalysisUsage(), llvm::RegAllocScoring::getAnalysisUsage(), llvm::RAGreedy::getAnalysisUsage(), AMDGPUAnnotateUniformValuesLegacy::getAnalysisUsage(), llvm::AMDGPUAsmPrinter::getAnalysisUsage(), llvm::AMDGPUDAGToDAGISelLegacy::getAnalysisUsage(), AMDGPULateCodeGenPrepareLegacy::getAnalysisUsage(), llvm::AMDGPURegBankSelect::getAnalysisUsage(), llvm::AMDGPUResourceUsageAnalysis::getAnalysisUsage(), llvm::GCNRegPressurePrinter::getAnalysisUsage(), SIAnnotateControlFlowLegacy::getAnalysisUsage(), SILowerI1CopiesLegacy::getAnalysisUsage(), llvm::ARMBlockPlacement::getAnalysisUsage(), llvm::MipsSEDAGToDAGISelLegacy::getAnalysisUsage(), llvm::NVPTXAsmPrinter::getAnalysisUsage(), llvm::SPIRVConvergenceRegionAnalysisWrapperPass::getAnalysisUsage(), llvm::SPIRVMergeRegionExitTargets::getAnalysisUsage(), llvm::WebAssemblyExceptionInfo::getAnalysisUsage(), llvm::gvn::GVNLegacyPass::getAnalysisUsage(), llvm::CallGraphSCCPass::getAnalysisUsage(), llvm::getLoopAnalysisUsage(), and INITIALIZE_PASS().

◆ addRequiredID() [1/2]

AnalysisUsage & AnalysisUsage::addRequiredID ( char ID)

Definition at line 275 of file Pass.cpp.

◆ addRequiredID() [2/2]

AnalysisUsage & AnalysisUsage::addRequiredID ( const void *  ID)

Add the specified ID to the required set of the usage info for a pass.

Definition at line 270 of file Pass.cpp.

Referenced by addRequired(), and llvm::getLoopAnalysisUsage().

◆ addRequiredTransitive()

template<class PassClass >
AnalysisUsage & llvm::AnalysisUsage::addRequiredTransitive ( )
inline

◆ addRequiredTransitiveID()

AnalysisUsage & AnalysisUsage::addRequiredTransitiveID ( char ID)

◆ addUsedIfAvailable()

template<class PassClass >
AnalysisUsage & llvm::AnalysisUsage::addUsedIfAvailable ( )
inline

Add the specified Pass class to the set of analyses used by this pass.

Definition at line 117 of file PassAnalysisSupport.h.

Referenced by llvm::AAResultsWrapperPass::getAnalysisUsage().

◆ addUsedIfAvailableID() [1/2]

AnalysisUsage & llvm::AnalysisUsage::addUsedIfAvailableID ( char ID)
inline

Definition at line 111 of file PassAnalysisSupport.h.

◆ addUsedIfAvailableID() [2/2]

AnalysisUsage & llvm::AnalysisUsage::addUsedIfAvailableID ( const void *  ID)
inline

Add the specified ID to the set of analyses used by this pass if they are available..

Definition at line 107 of file PassAnalysisSupport.h.

◆ getPreservedSet()

const VectorType & llvm::AnalysisUsage::getPreservedSet ( ) const
inline

◆ getPreservesAll()

bool llvm::AnalysisUsage::getPreservesAll ( ) const
inline

Determine whether a pass said it does not transform its input at all.

Definition at line 133 of file PassAnalysisSupport.h.

Referenced by llvm::PMDataManager::preserveHigherLevelAnalysis(), and llvm::PMDataManager::removeNotPreservedAnalysis().

◆ getRequiredSet()

const VectorType & llvm::AnalysisUsage::getRequiredSet ( ) const
inline

◆ getRequiredTransitiveSet()

const VectorType & llvm::AnalysisUsage::getRequiredTransitiveSet ( ) const
inline

Definition at line 145 of file PassAnalysisSupport.h.

Referenced by llvm::PMTopLevelManager::setLastUser().

◆ getUsedSet()

const VectorType & llvm::AnalysisUsage::getUsedSet ( ) const
inline

◆ setPreservesAll()

void llvm::AnalysisUsage::setPreservesAll ( )
inline

Set by analyses that do not transform their input at all.

Definition at line 130 of file PassAnalysisSupport.h.

Referenced by llvm::DependenceAnalysisWrapperPass::getAnalysisUsage(), llvm::MachineTraceMetrics::getAnalysisUsage(), llvm::AAResultsWrapperPass::getAnalysisUsage(), llvm::ExternalAAWrapperPass::getAnalysisUsage(), llvm::BasicAAWrapperPass::getAnalysisUsage(), llvm::BlockFrequencyInfoWrapperPass::getAnalysisUsage(), llvm::BranchProbabilityInfoWrapperPass::getAnalysisUsage(), llvm::CallGraphWrapperPass::getAnalysisUsage(), llvm::DummyCGSCCPass::getAnalysisUsage(), llvm::DominanceFrontierWrapperPass::getAnalysisUsage(), llvm::DOTGraphTraitsViewerWrapperPass< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::DOTGraphTraitsPrinterWrapperPass< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::DOTGraphTraitsModuleViewerWrapperPass< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::DOTGraphTraitsModulePrinterWrapperPass< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::DXILMetadataAnalysisWrapperPass::getAnalysisUsage(), llvm::DXILResourceWrapperPass::getAnalysisUsage(), llvm::GlobalsAAWrapperPass::getAnalysisUsage(), llvm::IRSimilarityIdentifierWrapperPass::getAnalysisUsage(), llvm::IVUsersWrapperPass::getAnalysisUsage(), llvm::LazyBlockFrequencyInfoPass::getAnalysisUsage(), llvm::LazyBranchProbabilityInfoPass::getAnalysisUsage(), llvm::LazyValueInfoWrapperPass::getAnalysisUsage(), llvm::LoopInfoWrapperPass::getAnalysisUsage(), llvm::LCSSAVerificationPass::getAnalysisUsage(), llvm::MemoryDependenceWrapperPass::getAnalysisUsage(), llvm::MemorySSAWrapperPass::getAnalysisUsage(), llvm::ModuleSummaryIndexWrapperPass::getAnalysisUsage(), llvm::ImmutableModuleSummaryIndexWrapperPass::getAnalysisUsage(), llvm::OptimizationRemarkEmitterWrapperPass::getAnalysisUsage(), llvm::PhiValuesWrapperPass::getAnalysisUsage(), llvm::PostDominatorTreeWrapperPass::getAnalysisUsage(), llvm::ProfileSummaryInfoWrapperPass::getAnalysisUsage(), llvm::RegionInfoPass::getAnalysisUsage(), llvm::ScalarEvolutionWrapperPass::getAnalysisUsage(), llvm::SCEVAAWrapperPass::getAnalysisUsage(), llvm::ScopedNoAliasAAWrapperPass::getAnalysisUsage(), llvm::StackSafetyInfoWrapperPass::getAnalysisUsage(), llvm::StackSafetyGlobalInfoWrapperPass::getAnalysisUsage(), llvm::TypeBasedAAWrapperPass::getAnalysisUsage(), llvm::AsmPrinter::getAnalysisUsage(), llvm::AssignmentTrackingAnalysis::getAnalysisUsage(), llvm::CFIFixup::getAnalysisUsage(), llvm::ExecutionDomainFix::getAnalysisUsage(), llvm::GISelCSEAnalysisWrapperPass::getAnalysisUsage(), llvm::GISelKnownBitsAnalysis::getAnalysisUsage(), llvm::LoadStoreOpt::getAnalysisUsage(), llvm::LazyMachineBlockFrequencyInfoPass::getAnalysisUsage(), llvm::MachineBlockFrequencyInfoWrapperPass::getAnalysisUsage(), llvm::MachineBranchProbabilityInfoWrapperPass::getAnalysisUsage(), llvm::MachineDominanceFrontier::getAnalysisUsage(), llvm::MachineDominatorTreeWrapperPass::getAnalysisUsage(), llvm::MachineLoopInfoWrapperPass::getAnalysisUsage(), llvm::MachineOptimizationRemarkEmitterPass::getAnalysisUsage(), llvm::MachinePostDominatorTreeWrapperPass::getAnalysisUsage(), llvm::MachineRegionInfoPass::getAnalysisUsage(), llvm::ReachingDefAnalysis::getAnalysisUsage(), llvm::VirtRegMap::getAnalysisUsage(), llvm::DominatorTreeWrapperPass::getAnalysisUsage(), llvm::BreakFalseDeps::getAnalysisUsage(), llvm::RegAllocScoring::getAnalysisUsage(), llvm::RegAllocEvictionAdvisorAnalysis::getAnalysisUsage(), llvm::RegAllocPriorityAdvisorAnalysis::getAnalysisUsage(), llvm::AMDGPUAAWrapperPass::getAnalysisUsage(), AMDGPUAnnotateUniformValuesLegacy::getAnalysisUsage(), llvm::AMDGPUArgumentUsageInfo::getAnalysisUsage(), AMDGPULateCodeGenPrepareLegacy::getAnalysisUsage(), llvm::AMDGPUResourceUsageAnalysis::getAnalysisUsage(), llvm::GCNRegPressurePrinter::getAnalysisUsage(), llvm::dxil::ShaderFlagsAnalysisWrapper::getAnalysisUsage(), llvm::NVPTXAAWrapperPass::getAnalysisUsage(), llvm::SPIRVConvergenceRegionAnalysisWrapperPass::getAnalysisUsage(), and llvm::WebAssemblyExceptionInfo::getAnalysisUsage().

◆ setPreservesCFG()

void AnalysisUsage::setPreservesCFG ( )

This function should be called by the pass, iff they do not:

  1. Add or remove basic blocks from the function
  2. Modify terminator instructions in any way.

This function annotates the AnalysisUsage info object to say that analyses that only depend on the CFG are preserved by this pass.

Definition at line 256 of file Pass.cpp.

Referenced by llvm::LiveIntervalsWrapperPass::getAnalysisUsage(), llvm::ReplaceWithVeclibLegacy::getAnalysisUsage(), llvm::InstructionCombiningPass::getAnalysisUsage(), llvm::RAGreedy::getAnalysisUsage(), and SILowerI1CopiesLegacy::getAnalysisUsage().


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