LLVM
8.0.1
|
A container for analyses that lazily runs them and caches their results. More...
#include "llvm/Analysis/InstructionSimplify.h"
Classes | |
class | Invalidator |
API to communicate dependencies between analyses during invalidation. More... | |
Public Member Functions | |
AnalysisManager (bool DebugLogging=false) | |
Construct an empty analysis manager. More... | |
AnalysisManager (AnalysisManager &&)=default | |
AnalysisManager & | operator= (AnalysisManager &&)=default |
bool | empty () const |
Returns true if the analysis manager has an empty results cache. More... | |
void | clear (IRUnitT &IR, llvm::StringRef Name) |
Clear any cached analysis results for a single unit of IR. More... | |
void | clear () |
Clear all analysis results cached by this AnalysisManager. More... | |
template<typename PassT > | |
PassT::Result & | getResult (IRUnitT &IR, ExtraArgTs... ExtraArgs) |
Get the result of an analysis pass for a given IR unit. More... | |
template<typename PassT > | |
PassT::Result * | getCachedResult (IRUnitT &IR) const |
Get the cached result of an analysis pass for a given IR unit. More... | |
template<typename PassBuilderT > | |
bool | registerPass (PassBuilderT &&PassBuilder) |
Register an analysis pass with the manager. More... | |
template<typename PassT > | |
void | invalidate (IRUnitT &IR) |
Invalidate a specific analysis pass for an IR module. More... | |
void | invalidate (IRUnitT &IR, const PreservedAnalyses &PA) |
Invalidate cached analyses for an IR unit. More... | |
A container for analyses that lazily runs them and caches their results.
This class can manage analyses for any IR unit where the address of the IR unit sufficies as its identity.
Definition at line 41 of file InstructionSimplify.h.
|
inline |
Construct an empty analysis manager.
If DebugLogging
is true, we'll log our progress to llvm::dbgs().
Definition at line 723 of file PassManager.h.
|
default |
|
inline |
Clear any cached analysis results for a single unit of IR.
This doesn't invalidate, but instead simply deletes, the relevant results. It is useful when the IR is being removed and we want to clear out all the memory pinned for it.
Definition at line 740 of file PassManager.h.
References llvm::dbgs(), and llvm::StringRef::find().
Referenced by llvm::InlinerPass::run().
|
inline |
Clear all analysis results cached by this AnalysisManager.
Like clear(IRUnitT&)
, this doesn't invalidate the results; it simply deletes them. This lets you clean up the AnalysisManager when the set of IR units itself has potentially changed, and thus we can't even look up a a result and invalidate/clear it directly.
Definition at line 761 of file PassManager.h.
|
inline |
Returns true if the analysis manager has an empty results cache.
Definition at line 728 of file PassManager.h.
References assert().
|
inline |
Get the cached result of an analysis pass for a given IR unit.
This method never runs the analysis.
Definition at line 789 of file PassManager.h.
References assert().
Referenced by incorporateNewSCCRange(), llvm::LibCallsShrinkWrapPass::run(), llvm::DCEPass::run(), llvm::BreakCriticalEdgesPass::run(), llvm::GuardWideningPass::run(), llvm::ADCEPass::run(), llvm::InstCombinePass::run(), llvm::LCSSAPass::run(), llvm::LoopSimplifyPass::run(), llvm::TailCallElimPass::run(), llvm::InternalizePass::run(), llvm::PGOMemOPSizeOpt::run(), llvm::GVN::run(), llvm::SLPVectorizerPass::run(), llvm::InlinerPass::run(), llvm::LoopUnrollPass::run(), llvm::LazyValueAnalysis::run(), and llvm::BasicAA::run().
|
inline |
Get the result of an analysis pass for a given IR unit.
Runs the analysis if a cached result is not available.
Definition at line 770 of file PassManager.h.
References assert().
Referenced by llvm::createSampleProfileLoaderPass(), llvm::SyntheticCountsPropagation::run(), llvm::LoadStoreVectorizerPass::run(), llvm::ExpandReductionsPass::run(), llvm::BoundsCheckingPass::run(), llvm::CorrelatedValuePropagationPass::run(), llvm::CGProfilePass::run(), llvm::LibCallsShrinkWrapPass::run(), llvm::GCOVProfilerPass::run(), llvm::HotColdSplittingPass::run(), llvm::CallSiteSplittingPass::run(), llvm::IRCEPass::run(), llvm::IVUsersPrinterPass::run(), llvm::LoopAccessInfoPrinterPass::run(), llvm::PromotePass::run(), llvm::DivRemPairsPass::run(), llvm::PartiallyInlineLibCallsPass::run(), llvm::SinkingPass::run(), llvm::InferFunctionAttrsPass::run(), llvm::PartialInlinerPass::run(), llvm::BDCEPass::run(), llvm::GuardWideningPass::run(), llvm::LoopPredicationPass::run(), llvm::NewGVNPass::run(), llvm::ControlHeightReductionPass::run(), llvm::GlobalOptPass::run(), llvm::LoopDataPrefetchPass::run(), llvm::LoopDistributePass::run(), llvm::LoopLoadEliminationPass::run(), llvm::LoopUnrollAndJamPass::run(), llvm::ArgumentPromotionPass::run(), llvm::ThreadSanitizerPass::run(), llvm::AlignmentFromAssumptionsPass::run(), llvm::WarnMissedTransformationsPass::run(), llvm::AggressiveInstCombinePass::run(), llvm::DSEPass::run(), llvm::RewriteStatepointsForGC::run(), llvm::PGOInstrumentationGen::run(), llvm::IPSCCPPass::run(), llvm::SampleProfileLoaderPass::run(), llvm::ADCEPass::run(), llvm::EarlyCSEPass::run(), llvm::ThinLTOBitcodeWriterPass::run(), llvm::LoopStrengthReducePass::run(), llvm::LoopSinkPass::run(), llvm::InstCombinePass::run(), llvm::LoopFullUnrollPass::run(), llvm::InstSimplifyPass::run(), llvm::MemorySanitizerPass::run(), llvm::SCCPPass::run(), llvm::LCSSAPass::run(), llvm::InstrProfiling::run(), llvm::PGOInstrumentationUse::run(), llvm::LICMPass::run(), llvm::StackSafetyAnalysis::run(), llvm::SCEVAA::run(), llvm::MemCpyOptPass::run(), llvm::SimplifyCFGPass::run(), llvm::ModuleSummaryIndexAnalysis::run(), llvm::PostOrderFunctionAttrsPass::run(), llvm::LoopSimplifyPass::run(), llvm::PassManager< Function >::run(), llvm::PGOIndirectCallPromotion::run(), llvm::StackSafetyPrinterPass::run(), llvm::AAEvaluator::run(), llvm::TailCallElimPass::run(), llvm::PostDominatorTreePrinterPass::run(), llvm::PGOMemOPSizeOpt::run(), llvm::ReversePostOrderFunctionAttrsPass::run(), llvm::GVN::run(), llvm::BitcodeWriterPass::run(), llvm::SpeculativeExecutionPass::run(), llvm::SLPVectorizerPass::run(), llvm::StackSafetyGlobalAnalysis::run(), llvm::StackSafetyGlobalPrinterPass::run(), llvm::LoopVectorizePass::run(), llvm::CFLAndersAA::run(), llvm::InlinerPass::run(), llvm::JumpThreadingPass::run(), llvm::NaryReassociatePass::run(), llvm::SpeculateAroundPHIsPass::run(), llvm::LoopUnrollPass::run(), llvm::SROA::run(), llvm::CFLSteensAA::run(), llvm::DemandedBitsAnalysis::run(), llvm::BlockFrequencyAnalysis::run(), llvm::ConstantHoistingPass::run(), llvm::GlobalsAA::run(), llvm::DemandedBitsPrinterPass::run(), llvm::BlockFrequencyPrinterPass::run(), llvm::LazyValueAnalysis::run(), llvm::PhiValuesPrinterPass::run(), llvm::VerifierPass::run(), llvm::OptimizationRemarkEmitterAnalysis::run(), llvm::ProfileSummaryPrinterPass::run(), llvm::AssumptionPrinterPass::run(), llvm::DominanceFrontierAnalysis::run(), llvm::DominanceFrontierPrinterPass::run(), llvm::BranchProbabilityAnalysis::run(), llvm::BranchProbabilityPrinterPass::run(), llvm::WholeProgramDevirtPass::run(), llvm::BasicAA::run(), llvm::DominatorTreePrinterPass::run(), llvm::DominatorTreeVerifierPass::run(), llvm::FunctionToLoopPassAdaptor< LoopPassT >::run(), llvm::PredicateInfoPrinterPass::run(), llvm::PredicateInfoVerifierPass::run(), llvm::GVNHoistPass::run(), llvm::CallGraphPrinterPass::run(), llvm::ModuleToPostOrderCGSCCPassAdaptor< CGSCCPassT >::run(), llvm::MemoryDependenceAnalysis::run(), llvm::FunctionAnalysisManagerCGSCCProxy::run(), llvm::CGSCCToFunctionPassAdaptor< FunctionPassT >::run(), llvm::DevirtSCCRepeatedPass< PassT >::run(), llvm::DependenceAnalysis::run(), llvm::MemorySSAAnalysis::run(), llvm::DependenceAnalysisPrinterPass::run(), llvm::MemorySSAPrinterPass::run(), llvm::MemorySSAVerifierPass::run(), llvm::LoopAnalysis::run(), llvm::LoopPrinterPass::run(), llvm::LoopVerifierPass::run(), llvm::RegionInfoAnalysis::run(), llvm::RegionInfoPrinterPass::run(), llvm::RegionInfoVerifierPass::run(), llvm::AAManager::run(), llvm::LazyCallGraphAnalysis::run(), llvm::LazyCallGraphPrinterPass::run(), llvm::ModuleToFunctionPassAdaptor< FunctionPassT >::run(), llvm::LazyCallGraphDOTPrinterPass::run(), llvm::ScalarEvolutionAnalysis::run(), llvm::ScalarEvolutionPrinterPass::run(), and updateNewSCCFunctionAnalyses().
|
inline |
Invalidate a specific analysis pass for an IR module.
Note that the analysis result can disregard invalidation, if it determines it is in fact still valid.
Definition at line 842 of file PassManager.h.
References assert().
Referenced by incorporateNewSCCRange(), llvm::PassManager< Function >::run(), llvm::ModuleToPostOrderCGSCCPassAdaptor< CGSCCPassT >::run(), llvm::CGSCCToFunctionPassAdaptor< FunctionPassT >::run(), llvm::DevirtSCCRepeatedPass< PassT >::run(), and llvm::ModuleToFunctionPassAdaptor< FunctionPassT >::run().
|
inline |
Invalidate cached analyses for an IR unit.
Walk through all of the analyses pertaining to this unit of IR and invalidate them, unless they are preserved by the PreservedAnalyses set.
Definition at line 852 of file PassManager.h.
References llvm::PreservedAnalyses::allAnalysesInSetPreserved(), assert(), llvm::dbgs(), E, llvm::DenseMapBase< SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::empty(), llvm::DenseMapBase< SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::find(), I, llvm::AnalysisInfoMixin< PassInstrumentationAnalysis >::ID(), llvm::DenseMapBase< SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::insert(), IR, llvm::DenseMapBase< SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::lookup(), P, llvm::PassInstrumentation::runAfterAnalysis(), llvm::PassInstrumentation::runBeforeAnalysis(), and second.
|
default |
|
inline |
Register an analysis pass with the manager.
The parameter is a callable whose result is an analysis pass. This allows passing in a lambda to construct the analysis.
The analysis type to register is the type returned by calling the PassBuilder
argument. If that type has already been registered, then the argument will not be called and this function will return false. Otherwise, we register the analysis returned by calling PassBuilder()
, and this function returns true.
(Note: Although the return value of this function indicates whether or not an analysis was previously registered, there intentionally isn't a way to query this directly. Instead, you should just register all the analyses you might want and let this class run them lazily. This idiom lets us minimize the number of times we have to look up analyses in our hashtable.)
Definition at line 822 of file PassManager.h.
Referenced by llvm::PassBuilder::crossRegisterProxies(), and eliminateDeadCode().