LLVM  14.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. More...
 
void setPreservesAll ()
 Set by analyses that do not transform their input at all. More...
 
bool getPreservesAll () const
 Determine whether a pass said it does not transform its input at all. More...
 
void setPreservesCFG ()
 This function should be called by the pass, iff they do not: More...
 
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. More...
 
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. More...
 

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 259 of file Pass.cpp.

References Arg, 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::UnifyFunctionExitNodesLegacyPass::getAnalysisUsage(), llvm::LiveIntervals::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::getAAResultsAnalysisUsage(), llvm::ReplaceWithVeclibLegacy::getAnalysisUsage(), llvm::InjectTLIMappingsLegacy::getAnalysisUsage(), llvm::InstructionSelect::getAnalysisUsage(), llvm::LegacyInlinerBase::getAnalysisUsage(), llvm::MachineBlockFrequencyInfo::getAnalysisUsage(), llvm::ARMBlockPlacement::getAnalysisUsage(), llvm::InstructionCombiningPass::getAnalysisUsage(), llvm::Legalizer::getAnalysisUsage(), llvm::MachineFunctionPass::getAnalysisUsage(), llvm::BreakFalseDeps::getAnalysisUsage(), llvm::AMDGPUResourceUsageAnalysis::getAnalysisUsage(), llvm::DOTGraphTraitsViewer< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::SCEVAAWrapperPass::getAnalysisUsage(), llvm::LazyMachineBlockFrequencyInfoPass::getAnalysisUsage(), llvm::SelectionDAGISel::getAnalysisUsage(), llvm::ModuleSummaryIndexWrapperPass::getAnalysisUsage(), llvm::CallGraphSCCPass::getAnalysisUsage(), llvm::Localizer::getAnalysisUsage(), llvm::MachinePipeliner::getAnalysisUsage(), llvm::MachineRegionInfoPass::getAnalysisUsage(), llvm::MachineDominanceFrontier::getAnalysisUsage(), llvm::MachineTraceMetrics::getAnalysisUsage(), llvm::StackProtector::getAnalysisUsage(), llvm::DemandedBitsWrapperPass::getAnalysisUsage(), llvm::DOTGraphTraitsPrinter< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::CFLAndersAAWrapperPass::getAnalysisUsage(), llvm::AMDGPUAsmPrinter::getAnalysisUsage(), llvm::CFLSteensAAWrapperPass::getAnalysisUsage(), llvm::DOTGraphTraitsModuleViewer< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::ExecutionDomainFix::getAnalysisUsage(), FunctionSpecializationLegacyPass::getAnalysisUsage(), llvm::WebAssemblyExceptionInfo::getAnalysisUsage(), llvm::BlockFrequencyInfoWrapperPass::getAnalysisUsage(), llvm::MachineLoopInfo::getAnalysisUsage(), llvm::LazyValueInfoWrapperPass::getAnalysisUsage(), llvm::OptimizationRemarkEmitterWrapperPass::getAnalysisUsage(), llvm::StackSafetyGlobalInfoWrapperPass::getAnalysisUsage(), llvm::GlobalsAAWrapperPass::getAnalysisUsage(), llvm::DominanceFrontierWrapperPass::getAnalysisUsage(), llvm::DOTGraphTraitsModulePrinter< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::IVUsersWrapperPass::getAnalysisUsage(), llvm::MachineOptimizationRemarkEmitterPass::getAnalysisUsage(), llvm::PredicateInfoPrinterLegacyPass::getAnalysisUsage(), llvm::LiveIntervals::getAnalysisUsage(), llvm::NVPTXAsmPrinter::getAnalysisUsage(), llvm::AsmPrinter::getAnalysisUsage(), llvm::AAEvalLegacyPass::getAnalysisUsage(), llvm::BranchProbabilityInfoWrapperPass::getAnalysisUsage(), llvm::MemoryDependenceWrapperPass::getAnalysisUsage(), llvm::GVNHoistLegacyPass::getAnalysisUsage(), llvm::RegBankSelect::getAnalysisUsage(), X86LowerAMXIntrinsicsLegacyPass::getAnalysisUsage(), llvm::IRTranslator::getAnalysisUsage(), LintLegacyPass::getAnalysisUsage(), llvm::MemorySSAPrinterLegacyPass::getAnalysisUsage(), llvm::RegionInfoPass::getAnalysisUsage(), IROutlinerLegacyPass::getAnalysisUsage(), LoopInterchangeLegacyPass::getAnalysisUsage(), llvm::gvn::GVNLegacyPass::getAnalysisUsage(), llvm::sroa::SROALegacyPass::getAnalysisUsage(), and llvm::getLoopAnalysisUsage().

◆ addRequiredID() [1/2]

AnalysisUsage & AnalysisUsage::addRequiredID ( char &  ID)

Definition at line 272 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 267 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)

Definition at line 277 of file Pass.cpp.

Referenced by addRequiredTransitive(), and llvm::LiveIntervals::getAnalysisUsage().

◆ 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::getAAResultsAnalysisUsage(), llvm::BasicAAWrapperPass::getAnalysisUsage(), and 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::AMDGPUPerfHintAnalysis::getAnalysisUsage(), llvm::LegacyDivergenceAnalysis::getAnalysisUsage(), llvm::MachineBranchProbabilityInfo::getAnalysisUsage(), llvm::MachineBlockFrequencyInfo::getAnalysisUsage(), llvm::BreakFalseDeps::getAnalysisUsage(), llvm::AMDGPUResourceUsageAnalysis::getAnalysisUsage(), llvm::DOTGraphTraitsViewer< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::SCEVAAWrapperPass::getAnalysisUsage(), llvm::LazyMachineBlockFrequencyInfoPass::getAnalysisUsage(), llvm::ModuleSummaryIndexWrapperPass::getAnalysisUsage(), llvm::ScopedNoAliasAAWrapperPass::getAnalysisUsage(), llvm::IntervalPartition::getAnalysisUsage(), llvm::VirtRegMap::getAnalysisUsage(), llvm::TypeBasedAAWrapperPass::getAnalysisUsage(), llvm::PostDominatorTreeWrapperPass::getAnalysisUsage(), llvm::AMDGPUAAWrapperPass::getAnalysisUsage(), llvm::MachinePostDominatorTree::getAnalysisUsage(), llvm::ImmutableModuleSummaryIndexWrapperPass::getAnalysisUsage(), llvm::objcarc::ObjCARCAAWrapperPass::getAnalysisUsage(), llvm::LazyBranchProbabilityInfoPass::getAnalysisUsage(), llvm::MachineRegionInfoPass::getAnalysisUsage(), llvm::MachineDominanceFrontier::getAnalysisUsage(), llvm::MachineTraceMetrics::getAnalysisUsage(), llvm::DemandedBitsWrapperPass::getAnalysisUsage(), llvm::DOTGraphTraitsPrinter< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::StackSafetyInfoWrapperPass::getAnalysisUsage(), llvm::LazyBlockFrequencyInfoPass::getAnalysisUsage(), llvm::ReachingDefAnalysis::getAnalysisUsage(), llvm::CFLAndersAAWrapperPass::getAnalysisUsage(), llvm::GISelKnownBitsAnalysis::getAnalysisUsage(), llvm::LCSSAVerificationPass::getAnalysisUsage(), llvm::DummyCGSCCPass::getAnalysisUsage(), llvm::CFLSteensAAWrapperPass::getAnalysisUsage(), llvm::DOTGraphTraitsModuleViewer< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::ExecutionDomainFix::getAnalysisUsage(), llvm::WebAssemblyExceptionInfo::getAnalysisUsage(), llvm::BlockFrequencyInfoWrapperPass::getAnalysisUsage(), llvm::PhiValuesWrapperPass::getAnalysisUsage(), llvm::MachineLoopInfo::getAnalysisUsage(), llvm::LazyValueInfoWrapperPass::getAnalysisUsage(), llvm::OptimizationRemarkEmitterWrapperPass::getAnalysisUsage(), llvm::StackSafetyGlobalInfoWrapperPass::getAnalysisUsage(), llvm::GlobalsAAWrapperPass::getAnalysisUsage(), llvm::AMDGPUArgumentUsageInfo::getAnalysisUsage(), llvm::DominanceFrontierWrapperPass::getAnalysisUsage(), llvm::DOTGraphTraitsModulePrinter< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::IVUsersWrapperPass::getAnalysisUsage(), llvm::ProfileSummaryInfoWrapperPass::getAnalysisUsage(), llvm::MachineOptimizationRemarkEmitterPass::getAnalysisUsage(), llvm::PredicateInfoPrinterLegacyPass::getAnalysisUsage(), llvm::GISelCSEAnalysisWrapperPass::getAnalysisUsage(), llvm::BasicAAWrapperPass::getAnalysisUsage(), llvm::DominatorTreeWrapperPass::getAnalysisUsage(), llvm::AsmPrinter::getAnalysisUsage(), llvm::CallGraphWrapperPass::getAnalysisUsage(), llvm::AAEvalLegacyPass::getAnalysisUsage(), llvm::BranchProbabilityInfoWrapperPass::getAnalysisUsage(), llvm::MemoryDependenceWrapperPass::getAnalysisUsage(), LintLegacyPass::getAnalysisUsage(), llvm::LoopAccessLegacyAnalysis::getAnalysisUsage(), llvm::IRSimilarityIdentifierWrapperPass::getAnalysisUsage(), llvm::MemorySSAPrinterLegacyPass::getAnalysisUsage(), llvm::RegionInfoPass::getAnalysisUsage(), llvm::MemorySSAWrapperPass::getAnalysisUsage(), llvm::DependenceAnalysisWrapperPass::getAnalysisUsage(), llvm::LoopInfoWrapperPass::getAnalysisUsage(), llvm::AAResultsWrapperPass::getAnalysisUsage(), llvm::ExternalAAWrapperPass::getAnalysisUsage(), and llvm::ScalarEvolutionWrapperPass::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 253 of file Pass.cpp.

Referenced by llvm::ReplaceWithVeclibLegacy::getAnalysisUsage(), llvm::InjectTLIMappingsLegacy::getAnalysisUsage(), llvm::InstructionCombiningPass::getAnalysisUsage(), LiveDebugValues::getAnalysisUsage(), llvm::DemandedBitsWrapperPass::getAnalysisUsage(), llvm::LiveIntervals::getAnalysisUsage(), and llvm::sroa::SROALegacyPass::getAnalysisUsage().


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