LLVM  8.0.1
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 43 of file PassAnalysisSupport.h.

Member Typedef Documentation

◆ VectorType

Definition at line 45 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

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

Definition at line 89 of file PassAnalysisSupport.h.

References llvm::SmallVectorTemplateBase< T, bool >::push_back().

Referenced by addUsedIfAvailable(), llvm::LoopVersioning::annotateInstWithNoAlias(), collectSupportedLoops(), llvm::slpvectorizer::BoUpSLP::computeMinimumValueSizes(), llvm::createAArch64ConditionalCompares(), llvm::createAArch64ConditionOptimizerPass(), llvm::createGreedyRegisterAllocator(), llvm::createPrologEpilogInserterPass(), llvm::MachineModuleInfo::deleteMachineFunctionFor(), doCallSiteSplitting(), llvm::GVNExpression::Expression::dump(), eliminateLoadsAcrossLoops(), eliminateTailRecursion(), eliminateUnreachableBlock(), formLCSSAOnAllLoops(), llvm::MipsDAGToDAGISel::getAnalysisUsage(), llvm::Legalizer::getAnalysisUsage(), llvm::MachineFunctionPass::getAnalysisUsage(), llvm::InstructionCombiningPass::getAnalysisUsage(), llvm::SelectionDAGISel::getAnalysisUsage(), llvm::CallGraphSCCPass::getAnalysisUsage(), llvm::MachinePipeliner::getAnalysisUsage(), llvm::StackProtector::getAnalysisUsage(), llvm::LiveIntervals::getAnalysisUsage(), llvm::GVNHoistLegacyPass::getAnalysisUsage(), llvm::gvn::GVNLegacyPass::getAnalysisUsage(), llvm::sroa::SROALegacyPass::getAnalysisUsage(), llvm::getLoopAnalysisUsage(), llvm::getSelectionDAGFallbackAnalysisUsage(), INITIALIZE_PASS_BEGIN(), llvm::CoalescerPair::isCoalescable(), isDebug(), isImplicitlyDef(), mayUsePostIncMode(), optimizeDivRem(), parseCHRFilterFiles(), patchAndReplaceAllUsesWith(), false::LibCallsShrinkWrap::perform(), llvm::SinkingPass::run(), llvm::GuardWideningPass::run(), llvm::LoopRotatePass::run(), llvm::BDCEPass::run(), llvm::LoopSimplifyCFGPass::run(), llvm::DSEPass::run(), llvm::UnreachableBlockElimPass::run(), llvm::ADCEPass::run(), llvm::EarlyCSEPass::run(), llvm::SCCPPass::run(), llvm::SimplifyCFGPass::run(), llvm::InternalizePass::run(), llvm::SimpleLoopUnswitchPass::run(), llvm::ReassociatePass::run(), runImpl(), runOnFunction(), llvm::simplifyLoop(), simplifyLoopInst(), and llvm::AntiDepBreaker::~AntiDepBreaker().

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

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

◆ addPreservedID() [1/2]

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

◆ addPreservedID() [2/2]

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

◆ addRequired()

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

Definition at line 66 of file PassAnalysisSupport.h.

References addRequiredID(), and addRequiredTransitiveID().

Referenced by llvm::LoopVersioning::annotateInstWithNoAlias(), collectSupportedLoops(), computeBranchTargetAndInversion(), llvm::slpvectorizer::BoUpSLP::computeMinimumValueSizes(), llvm::createAArch64ConditionalCompares(), llvm::createAArch64ConditionOptimizerPass(), llvm::createAMDGPUFunctionInliningPass(), createBBSelectReg(), llvm::createDwarfEHPass(), llvm::createFalkorMarkStridedAccessesPass(), llvm::createFunctionInliningPass(), llvm::createGCInfoPrinter(), llvm::createGreedyRegisterAllocator(), llvm::createObjCARCOptPass(), llvm::createPrologEpilogInserterPass(), llvm::createSystemZLDCleanupPass(), llvm::createX86FlagsCopyLoweringPass(), llvm::MachineModuleInfo::deleteMachineFunctionFor(), doCallSiteSplitting(), llvm::ICFLoopSafetyInfo::doesNotWriteMemoryBefore(), llvm::AliasSetTracker::dump(), eliminateLoadsAcrossLoops(), eliminateTailRecursion(), llvm::LazyValueInfo::enableDT(), formLCSSAOnAllLoops(), llvm::getAAResultsAnalysisUsage(), llvm::InstructionSelect::getAnalysisUsage(), llvm::LegacyDivergenceAnalysis::getAnalysisUsage(), llvm::LegacyInlinerBase::getAnalysisUsage(), llvm::MachineBlockFrequencyInfo::getAnalysisUsage(), llvm::Legalizer::getAnalysisUsage(), llvm::InstructionCombiningPass::getAnalysisUsage(), llvm::MachineFunctionPass::getAnalysisUsage(), llvm::BreakFalseDeps::getAnalysisUsage(), llvm::SCEVAAWrapperPass::getAnalysisUsage(), llvm::DOTGraphTraitsViewer< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::ModuleSummaryIndexWrapperPass::getAnalysisUsage(), llvm::LazyMachineBlockFrequencyInfoPass::getAnalysisUsage(), llvm::StackSafetyInfoWrapperPass::getAnalysisUsage(), llvm::SelectionDAGISel::getAnalysisUsage(), llvm::CallGraphSCCPass::getAnalysisUsage(), llvm::MachinePipeliner::getAnalysisUsage(), llvm::DemandedBitsWrapperPass::getAnalysisUsage(), llvm::LazyBranchProbabilityInfoPass::getAnalysisUsage(), llvm::MachineRegionInfoPass::getAnalysisUsage(), llvm::MachineDominanceFrontier::getAnalysisUsage(), llvm::MachineTraceMetrics::getAnalysisUsage(), llvm::RGPassManager::getAnalysisUsage(), llvm::LPPassManager::getAnalysisUsage(), llvm::StackProtector::getAnalysisUsage(), llvm::StackSafetyGlobalInfoWrapperPass::getAnalysisUsage(), llvm::DOTGraphTraitsPrinter< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::CFLAndersAAWrapperPass::getAnalysisUsage(), llvm::LazyBlockFrequencyInfoPass::getAnalysisUsage(), llvm::CFLSteensAAWrapperPass::getAnalysisUsage(), llvm::ExecutionDomainFix::getAnalysisUsage(), llvm::MachineLoopInfo::getAnalysisUsage(), llvm::WebAssemblyExceptionInfo::getAnalysisUsage(), llvm::DOTGraphTraitsModuleViewer< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::GlobalsAAWrapperPass::getAnalysisUsage(), llvm::BlockFrequencyInfoWrapperPass::getAnalysisUsage(), llvm::LazyValueInfoWrapperPass::getAnalysisUsage(), llvm::DominanceFrontierWrapperPass::getAnalysisUsage(), llvm::DOTGraphTraitsModulePrinter< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::IVUsersWrapperPass::getAnalysisUsage(), llvm::MachineOptimizationRemarkEmitterPass::getAnalysisUsage(), llvm::BranchProbabilityInfoWrapperPass::getAnalysisUsage(), llvm::BasicAAWrapperPass::getAnalysisUsage(), llvm::PredicateInfoPrinterLegacyPass::getAnalysisUsage(), llvm::AsmPrinter::getAnalysisUsage(), llvm::LiveIntervals::getAnalysisUsage(), llvm::NVPTXAsmPrinter::getAnalysisUsage(), llvm::AAEvalLegacyPass::getAnalysisUsage(), llvm::IRTranslator::getAnalysisUsage(), llvm::MemoryDependenceWrapperPass::getAnalysisUsage(), llvm::RegBankSelect::getAnalysisUsage(), llvm::LoopAccessLegacyAnalysis::getAnalysisUsage(), llvm::MemorySSAPrinterLegacyPass::getAnalysisUsage(), llvm::RegionInfoPass::getAnalysisUsage(), llvm::LoopInfoWrapperPass::getAnalysisUsage(), llvm::AAResultsWrapperPass::getAnalysisUsage(), llvm::GVNHoistLegacyPass::getAnalysisUsage(), llvm::gvn::GVNLegacyPass::getAnalysisUsage(), llvm::sroa::SROALegacyPass::getAnalysisUsage(), llvm::GCOVOptions::getDefault(), getInductionVariable(), getLayoutSuccessorProbThreshold(), llvm::LazyBlockFrequencyInfoPass::getLazyBFIAnalysisUsage(), llvm::LazyBranchProbabilityInfoPass::getLazyBPIAnalysisUsage(), llvm::getLoopAnalysisUsage(), INITIALIZE_PASS(), INITIALIZE_PASS_BEGIN(), llvm::CoalescerPair::isCoalescable(), isDebug(), llvm::DenseMapInfo< VTableSlot >::isEqual(), isImplicitlyDef(), mayUsePostIncMode(), optimizeDivRem(), parseCHRFilterFiles(), patchAndReplaceAllUsesWith(), false::LibCallsShrinkWrap::perform(), RedzoneSizeForScale(), llvm::AMDGPULibCalls::replaceCall(), replaceDevirtTrigger(), llvm::BoundsCheckingPass::run(), llvm::PromotePass::run(), llvm::PartiallyInlineLibCallsPass::run(), llvm::SinkingPass::run(), llvm::LoopRotatePass::run(), llvm::InferFunctionAttrsPass::run(), llvm::GuardWideningPass::run(), llvm::BDCEPass::run(), llvm::GlobalOptPass::run(), llvm::LoopSimplifyCFGPass::run(), llvm::WarnMissedTransformationsPass::run(), llvm::ArgumentPromotionPass::run(), llvm::DSEPass::run(), llvm::RewriteStatepointsForGC::run(), llvm::IPSCCPPass::run(), llvm::ADCEPass::run(), llvm::EarlyCSEPass::run(), llvm::LoopSinkPass::run(), llvm::SCCPPass::run(), llvm::SimplifyCFGPass::run(), llvm::PostOrderFunctionAttrsPass::run(), llvm::SimpleLoopUnswitchPass::run(), llvm::BitcodeWriterPass::run(), runImpl(), llvm::simplifyLoop(), simplifyLoopInst(), tryToUnrollAndJamLoop(), tryToUnrollLoop(), and llvm::AntiDepBreaker::~AntiDepBreaker().

◆ addRequiredID() [1/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 299 of file Pass.cpp.

References llvm::cl::Required.

Referenced by addRequired(), eliminateLoadsAcrossLoops(), llvm::getLoopAnalysisUsage(), INITIALIZE_PASS(), and mayUsePostIncMode().

◆ addRequiredID() [2/2]

AnalysisUsage & AnalysisUsage::addRequiredID ( char ID)

Definition at line 304 of file Pass.cpp.

References llvm::cl::Required.

◆ addRequiredTransitive()

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

◆ addRequiredTransitiveID()

AnalysisUsage & AnalysisUsage::addRequiredTransitiveID ( char ID)

◆ addUsedIfAvailable()

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

◆ addUsedIfAvailableID() [1/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 98 of file PassAnalysisSupport.h.

References llvm::SmallVectorTemplateBase< T, bool >::push_back().

◆ addUsedIfAvailableID() [2/2]

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

◆ 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 124 of file PassAnalysisSupport.h.

References setPreservesCFG().

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

◆ 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 121 of file PassAnalysisSupport.h.

Referenced by llvm::createCostModelAnalysisPass(), llvm::createGCInfoPrinter(), llvm::ICFLoopSafetyInfo::doesNotWriteMemoryBefore(), llvm::CallGraphWrapperPass::dump(), llvm::AliasSetTracker::dump(), llvm::RGPassManager::dumpPassStructure(), llvm::LazyValueInfo::enableDT(), llvm::AMDGPUPerfHintAnalysis::getAnalysisUsage(), llvm::LegacyDivergenceAnalysis::getAnalysisUsage(), llvm::MachineBlockFrequencyInfo::getAnalysisUsage(), llvm::MachineBranchProbabilityInfo::getAnalysisUsage(), llvm::BreakFalseDeps::getAnalysisUsage(), llvm::DOTGraphTraitsViewer< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::SCEVAAWrapperPass::getAnalysisUsage(), llvm::LazyMachineBlockFrequencyInfoPass::getAnalysisUsage(), llvm::ModuleSummaryIndexWrapperPass::getAnalysisUsage(), llvm::StackSafetyInfoWrapperPass::getAnalysisUsage(), llvm::ScopedNoAliasAAWrapperPass::getAnalysisUsage(), llvm::VirtRegMap::getAnalysisUsage(), llvm::CallGraphSCCPass::getAnalysisUsage(), llvm::MachinePostDominatorTree::getAnalysisUsage(), llvm::ReachingDefAnalysis::getAnalysisUsage(), llvm::TypeBasedAAWrapperPass::getAnalysisUsage(), llvm::PostDominatorTreeWrapperPass::getAnalysisUsage(), llvm::IntervalPartition::getAnalysisUsage(), llvm::objcarc::ObjCARCAAWrapperPass::getAnalysisUsage(), llvm::DemandedBitsWrapperPass::getAnalysisUsage(), llvm::AMDGPUAAWrapperPass::getAnalysisUsage(), llvm::LazyBranchProbabilityInfoPass::getAnalysisUsage(), llvm::MachineRegionInfoPass::getAnalysisUsage(), llvm::MachineDominanceFrontier::getAnalysisUsage(), llvm::MachineTraceMetrics::getAnalysisUsage(), llvm::RGPassManager::getAnalysisUsage(), llvm::LPPassManager::getAnalysisUsage(), llvm::DOTGraphTraitsPrinter< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::CFLAndersAAWrapperPass::getAnalysisUsage(), llvm::LazyBlockFrequencyInfoPass::getAnalysisUsage(), llvm::DummyCGSCCPass::getAnalysisUsage(), llvm::ExecutionDomainFix::getAnalysisUsage(), llvm::CFLSteensAAWrapperPass::getAnalysisUsage(), llvm::MachineLoopInfo::getAnalysisUsage(), llvm::ProfileSummaryInfoWrapperPass::getAnalysisUsage(), llvm::WebAssemblyExceptionInfo::getAnalysisUsage(), llvm::DOTGraphTraitsModuleViewer< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::GlobalsAAWrapperPass::getAnalysisUsage(), llvm::OptimizationRemarkEmitterWrapperPass::getAnalysisUsage(), llvm::BlockFrequencyInfoWrapperPass::getAnalysisUsage(), llvm::AMDGPUArgumentUsageInfo::getAnalysisUsage(), llvm::PhiValuesWrapperPass::getAnalysisUsage(), llvm::LazyValueInfoWrapperPass::getAnalysisUsage(), llvm::DominanceFrontierWrapperPass::getAnalysisUsage(), llvm::LCSSAVerificationPass::getAnalysisUsage(), llvm::DOTGraphTraitsModulePrinter< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::IVUsersWrapperPass::getAnalysisUsage(), llvm::MachineOptimizationRemarkEmitterPass::getAnalysisUsage(), llvm::GISelCSEAnalysisWrapperPass::getAnalysisUsage(), llvm::BranchProbabilityInfoWrapperPass::getAnalysisUsage(), llvm::BasicAAWrapperPass::getAnalysisUsage(), llvm::DominatorTreeWrapperPass::getAnalysisUsage(), llvm::PredicateInfoPrinterLegacyPass::getAnalysisUsage(), llvm::AsmPrinter::getAnalysisUsage(), llvm::CallGraphWrapperPass::getAnalysisUsage(), llvm::AAEvalLegacyPass::getAnalysisUsage(), llvm::legacy::FunctionPassManagerImpl::getAnalysisUsage(), llvm::FPPassManager::getAnalysisUsage(), llvm::MemoryDependenceWrapperPass::getAnalysisUsage(), llvm::legacy::PassManagerImpl::getAnalysisUsage(), llvm::LoopAccessLegacyAnalysis::getAnalysisUsage(), llvm::MemorySSAPrinterLegacyPass::getAnalysisUsage(), llvm::DependenceAnalysisWrapperPass::getAnalysisUsage(), llvm::RegionInfoPass::getAnalysisUsage(), llvm::MemorySSAWrapperPass::getAnalysisUsage(), llvm::LoopInfoWrapperPass::getAnalysisUsage(), llvm::AAResultsWrapperPass::getAnalysisUsage(), llvm::ExternalAAWrapperPass::getAnalysisUsage(), llvm::ScalarEvolutionWrapperPass::getAnalysisUsage(), llvm::legacy::FunctionPassManagerImpl::getContainedManager(), getLayoutSuccessorProbThreshold(), INITIALIZE_PASS(), llvm::LiveRegMatrix::LiveRegMatrix(), lowerSubFn(), llvm::PassManagerPrettyStackEntry::print(), llvm::WarnMissedTransformationsPass::run(), llvm::CalledValuePropagationPass::run(), llvm::CFGViewerPass::run(), llvm::BitcodeWriterPass::run(), llvm::PrintFunctionPass::run(), llvm::verifyModule(), and writeCFGToDotFile().

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

Referenced by BlockData::BlockData(), llvm::slpvectorizer::BoUpSLP::computeMinimumValueSizes(), llvm::createFalkorMarkStridedAccessesPass(), llvm::createGreedyRegisterAllocator(), llvm::createObjCARCOptPass(), llvm::createPrologEpilogInserterPass(), llvm::createSystemZLDCleanupPass(), formLCSSAOnAllLoops(), llvm::InstructionCombiningPass::getAnalysisUsage(), llvm::DemandedBitsWrapperPass::getAnalysisUsage(), llvm::LiveIntervals::getAnalysisUsage(), llvm::sroa::SROALegacyPass::getAnalysisUsage(), getPreservesAll(), llvm::X86InstrInfo::getSerializableDirectMachineOperandTargetFlags(), INITIALIZE_PASS(), llvm::CoalescerPair::isCoalescable(), isImplicitlyDef(), isSecondInstructionInSequence(), optimizeDivRem(), performSink(), llvm::DCEPass::run(), llvm::SinkingPass::run(), llvm::PromotePass::run(), llvm::BDCEPass::run(), llvm::GuardWideningPass::run(), llvm::IndVarSimplifyPass::run(), llvm::DSEPass::run(), llvm::ADCEPass::run(), llvm::EarlyCSEPass::run(), llvm::LoopSinkPass::run(), llvm::SCCPPass::run(), llvm::PostOrderFunctionAttrsPass::run(), llvm::InternalizePass::run(), llvm::ReassociatePass::run(), runImpl(), setCannotDuplicate(), simplifyLoopInst(), and llvm::AntiDepBreaker::~AntiDepBreaker().


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