LLVM
8.0.1
|
A set of analyses that are preserved following a run of a transformation pass. More...
#include "llvm/IR/PassManager.h"
Classes | |
class | PreservedAnalysisChecker |
A checker object that makes it easy to query for whether an analysis or some set covering it is preserved. More... | |
Public Member Functions | |
template<typename AnalysisT > | |
void | preserve () |
Mark an analysis as preserved. More... | |
void | preserve (AnalysisKey *ID) |
Given an analysis's ID, mark the analysis as preserved, adding it to the set. More... | |
template<typename AnalysisSetT > | |
void | preserveSet () |
Mark an analysis set as preserved. More... | |
void | preserveSet (AnalysisSetKey *ID) |
Mark an analysis set as preserved using its ID. More... | |
template<typename AnalysisT > | |
void | abandon () |
Mark an analysis as abandoned. More... | |
void | abandon (AnalysisKey *ID) |
Mark an analysis as abandoned using its ID. More... | |
void | intersect (const PreservedAnalyses &Arg) |
Intersect this set with another in place. More... | |
void | intersect (PreservedAnalyses &&Arg) |
Intersect this set with a temporary other set in place. More... | |
template<typename AnalysisT > | |
PreservedAnalysisChecker | getChecker () const |
Build a checker for this PreservedAnalyses and the specified analysis type. More... | |
PreservedAnalysisChecker | getChecker (AnalysisKey *ID) const |
Build a checker for this PreservedAnalyses and the specified analysis ID. More... | |
bool | areAllPreserved () const |
Test whether all analyses are preserved (and none are abandoned). More... | |
template<typename AnalysisSetT > | |
bool | allAnalysesInSetPreserved () const |
Directly test whether a set of analyses is preserved. More... | |
bool | allAnalysesInSetPreserved (AnalysisSetKey *SetID) const |
Directly test whether a set of analyses is preserved. More... | |
Static Public Member Functions | |
static PreservedAnalyses | none () |
Convenience factory function for the empty preserved set. More... | |
static PreservedAnalyses | all () |
Construct a special preserved set that preserves all passes. More... | |
template<typename AnalysisSetT > | |
static PreservedAnalyses | allInSet () |
Construct a preserved analyses object with a single preserved set. More... | |
A set of analyses that are preserved following a run of a transformation pass.
Transformation passes build and return these objects to communicate which analyses are still valid after the transformation. For most passes this is fairly simple: if they don't change anything all analyses are preserved, otherwise only a short list of analyses that have been explicitly updated are preserved.
This class also lets transformation passes mark abstract sets of analyses as preserved. A transformation that (say) does not alter the CFG can indicate such by marking a particular AnalysisSetKey as preserved, and then analyses can query whether that AnalysisSetKey is preserved.
Finally, this class can represent an "abandoned" analysis, which is not preserved even if it would be covered by some abstract set of analyses.
Given a PreservedAnalyses
object, an analysis will typically want to figure out whether it is preserved. In the example below, MyAnalysisType is preserved if it's not abandoned, and (a) it's explicitly marked as preserved, (b), the set AllAnalysesOn<MyIRUnit> is preserved, or (c) both AnalysisSetA and AnalysisSetB are preserved.
Definition at line 154 of file PassManager.h.
|
inline |
Mark an analysis as abandoned.
An abandoned analysis is not preserved, even if it is nominally covered by some other set or was previously explicitly marked as preserved.
Note that you can only abandon a specific analysis, not a set of analyses.
Definition at line 208 of file PassManager.h.
References abandon().
Referenced by abandon(), llvm::FunctionAnalysisManagerCGSCCProxy::Result::invalidate(), llvm::PassManager< Function >::run(), and llvm::InvalidateAnalysisPass< AnalysisT >::run().
|
inline |
Mark an analysis as abandoned using its ID.
An abandoned analysis is not preserved, even if it is nominally covered by some other set or was previously explicitly marked as preserved.
Note that you can only abandon a specific analysis, not a set of analyses.
Definition at line 217 of file PassManager.h.
|
inlinestatic |
Construct a special preserved set that preserves all passes.
Definition at line 160 of file PassManager.h.
References llvm::SmallPtrSetImpl< PtrType >::insert().
Referenced by INITIALIZE_PASS(), isOptimizingForSize(), llvm::SyntheticCountsPropagation::run(), llvm::LoadStoreVectorizerPass::run(), llvm::ExpandReductionsPass::run(), llvm::BoundsCheckingPass::run(), llvm::CorrelatedValuePropagationPass::run(), llvm::CGProfilePass::run(), llvm::LibCallsShrinkWrapPass::run(), llvm::LowerGuardIntrinsicPass::run(), llvm::CrossDSOCFIPass::run(), llvm::GCOVProfilerPass::run(), llvm::PreISelIntrinsicLoweringPass::run(), llvm::ForceFunctionAttrsPass::run(), llvm::HotColdSplittingPass::run(), llvm::LowerInvokePass::run(), llvm::CallSiteSplittingPass::run(), llvm::DCEPass::run(), llvm::IRCEPass::run(), llvm::IVUsersPrinterPass::run(), llvm::LoopAccessInfoPrinterPass::run(), llvm::LowerAtomicPass::run(), llvm::PartiallyInlineLibCallsPass::run(), llvm::SinkingPass::run(), llvm::BreakCriticalEdgesPass::run(), llvm::PromotePass::run(), llvm::DivRemPairsPass::run(), llvm::NewGVNPass::run(), llvm::ScalarizerPass::run(), llvm::AddDiscriminatorsPass::run(), llvm::InferFunctionAttrsPass::run(), llvm::CanonicalizeAliasesPass::run(), llvm::PartialInlinerPass::run(), llvm::StripDeadPrototypesPass::run(), llvm::BDCEPass::run(), llvm::Float2IntPass::run(), llvm::GuardWideningPass::run(), llvm::ControlHeightReductionPass::run(), llvm::LoopRotatePass::run(), llvm::LoopPredicationPass::run(), llvm::EliminateAvailableExternallyPass::run(), llvm::GlobalOptPass::run(), llvm::NameAnonGlobalPass::run(), llvm::IndVarSimplifyPass::run(), llvm::LoopDataPrefetchPass::run(), llvm::LoopDistributePass::run(), llvm::LoopInstSimplifyPass::run(), llvm::LoopDeletionPass::run(), llvm::LoopLoadEliminationPass::run(), llvm::LoopSimplifyCFGPass::run(), llvm::GlobalSplitPass::run(), llvm::LoopUnrollAndJamPass::run(), llvm::WarnMissedTransformationsPass::run(), llvm::AlignmentFromAssumptionsPass::run(), llvm::AggressiveInstCombinePass::run(), llvm::ThreadSanitizerPass::run(), llvm::LoopIdiomRecognizePass::run(), llvm::ArgumentPromotionPass::run(), llvm::RewriteStatepointsForGC::run(), llvm::DSEPass::run(), llvm::CalledValuePropagationPass::run(), llvm::ConstantMergePass::run(), llvm::GlobalDCEPass::run(), llvm::LowerExpectIntrinsicPass::run(), llvm::CFGViewerPass::run(), llvm::SampleProfileLoaderPass::run(), llvm::IPSCCPPass::run(), llvm::ADCEPass::run(), llvm::UnreachableBlockElimPass::run(), llvm::PGOInstrumentationGen::run(), llvm::MergedLoadStoreMotionPass::run(), llvm::EarlyCSEPass::run(), llvm::ThinLTOBitcodeWriterPass::run(), llvm::InstCombinePass::run(), llvm::LoopSinkPass::run(), llvm::LoopStrengthReducePass::run(), llvm::LoopFullUnrollPass::run(), llvm::AlwaysInlinerPass::run(), llvm::InstSimplifyPass::run(), llvm::SCCPPass::run(), llvm::MemorySanitizerPass::run(), llvm::LCSSAPass::run(), llvm::InstrProfiling::run(), llvm::PGOInstrumentationUse::run(), llvm::LICMPass::run(), llvm::SimplifyCFGPass::run(), llvm::MemCpyOptPass::run(), llvm::LoopSimplifyPass::run(), llvm::PostOrderFunctionAttrsPass::run(), llvm::PGOIndirectCallPromotion::run(), llvm::StackSafetyPrinterPass::run(), llvm::AAEvaluator::run(), llvm::TailCallElimPass::run(), llvm::PostDominatorTreePrinterPass::run(), llvm::InternalizePass::run(), llvm::PGOMemOPSizeOpt::run(), llvm::SimpleLoopUnswitchPass::run(), llvm::ReversePostOrderFunctionAttrsPass::run(), llvm::BitcodeWriterPass::run(), llvm::GVN::run(), llvm::SpeculativeExecutionPass::run(), llvm::SLPVectorizerPass::run(), llvm::DeadArgumentEliminationPass::run(), llvm::ReassociatePass::run(), llvm::PrintModulePass::run(), llvm::RequireAnalysisPass< AnalysisT, Loop, LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater & >::run(), llvm::StackSafetyGlobalPrinterPass::run(), llvm::LoopVectorizePass::run(), llvm::InlinerPass::run(), llvm::JumpThreadingPass::run(), llvm::NaryReassociatePass::run(), llvm::SpeculateAroundPHIsPass::run(), llvm::PrintFunctionPass::run(), llvm::LoopUnrollPass::run(), llvm::ConstantHoistingPass::run(), llvm::FunctionImportPass::run(), llvm::DemandedBitsPrinterPass::run(), llvm::RewriteSymbolPass::run(), llvm::BlockFrequencyPrinterPass::run(), llvm::PhiValuesPrinterPass::run(), llvm::VerifierPass::run(), llvm::RequireAnalysisPass< AnalysisT, LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, CGSCCUpdateResult & >::run(), llvm::ProfileSummaryPrinterPass::run(), llvm::AssumptionPrinterPass::run(), llvm::DominanceFrontierPrinterPass::run(), llvm::LowerTypeTestsPass::run(), llvm::BranchProbabilityPrinterPass::run(), llvm::WholeProgramDevirtPass::run(), llvm::DominatorTreePrinterPass::run(), llvm::DominatorTreeVerifierPass::run(), llvm::FunctionToLoopPassAdaptor< LoopPassT >::run(), llvm::PredicateInfoPrinterPass::run(), llvm::PredicateInfoVerifierPass::run(), llvm::GVNHoistPass::run(), llvm::GVNSinkPass::run(), llvm::CallGraphPrinterPass::run(), llvm::ModuleToPostOrderCGSCCPassAdaptor< CGSCCPassT >::run(), llvm::PrintLoopPass::run(), llvm::PassManager< Function >::run(), llvm::CGSCCToFunctionPassAdaptor< FunctionPassT >::run(), llvm::DevirtSCCRepeatedPass< PassT >::run(), llvm::DependenceAnalysisPrinterPass::run(), llvm::MemorySSAPrinterPass::run(), llvm::MemorySSAVerifierPass::run(), llvm::LoopPrinterPass::run(), llvm::LoopVerifierPass::run(), llvm::RegionInfoPrinterPass::run(), llvm::RegionInfoVerifierPass::run(), llvm::LazyCallGraphPrinterPass::run(), llvm::ModuleToFunctionPassAdaptor< FunctionPassT >::run(), llvm::LazyCallGraphDOTPrinterPass::run(), llvm::RequireAnalysisPass< AnalysisT, IRUnitT, AnalysisManagerT, ExtraArgTs >::run(), llvm::InvalidateAnalysisPass< AnalysisT >::run(), llvm::RepeatedPass< PassT >::run(), llvm::ScalarEvolutionPrinterPass::run(), and updateNewSCCFunctionAnalyses().
|
inline |
Directly test whether a set of analyses is preserved.
This is only true when no analyses have been explicitly abandoned.
Definition at line 330 of file PassManager.h.
Referenced by llvm::FunctionAnalysisManagerCGSCCProxy::Result::invalidate(), llvm::AnalysisManager< IRUnitT, ExtraArgTs >::invalidate(), and llvm::PassManager< Function >::run().
|
inline |
Directly test whether a set of analyses is preserved.
This is only true when no analyses have been explicitly abandoned.
Definition at line 337 of file PassManager.h.
|
inlinestatic |
Construct a preserved analyses object with a single preserved set.
Definition at line 168 of file PassManager.h.
References preserveSet().
|
inline |
Test whether all analyses are preserved (and none are abandoned).
This is used primarily to optimize for the common case of a transformation which makes no changes to the IR.
Definition at line 322 of file PassManager.h.
Referenced by intersect(), llvm::FunctionAnalysisManagerCGSCCProxy::Result::invalidate(), llvm::PassManager< Function >::run(), llvm::ReassociatePass::run(), and llvm::sroa::SROALegacyPass::runOnFunction().
|
inline |
Build a checker for this PreservedAnalyses
and the specified analysis type.
You can use the returned object to query whether an analysis was preserved. See the example in the comment on PreservedAnalysis
.
Definition at line 305 of file PassManager.h.
Referenced by llvm::BlockFrequencyInfo::invalidate(), llvm::PhiValues::invalidate(), llvm::LazyValueInfo::invalidate(), llvm::DominanceFrontier::invalidate(), llvm::DominatorTree::invalidate(), llvm::AAResults::invalidate(), llvm::MemoryDependenceResults::invalidate(), llvm::FunctionAnalysisManagerCGSCCProxy::Result::invalidate(), llvm::LoopInfo::invalidate(), llvm::RegionInfo::invalidate(), llvm::ScalarEvolution::invalidate(), llvm::PassManager< Function >::run(), and llvm::CGSCCToFunctionPassAdaptor< FunctionPassT >::run().
|
inline |
Build a checker for this PreservedAnalyses
and the specified analysis ID.
You can use the returned object to query whether an analysis was preserved. See the example in the comment on PreservedAnalysis
.
Definition at line 314 of file PassManager.h.
|
inline |
Intersect this set with another in place.
This is a mutating operation on this preserved set, removing all preserved passes which are not also preserved in the argument.
Definition at line 226 of file PassManager.h.
References areAllPreserved(), Arg, and llvm::SmallPtrSetImpl< PtrType >::count().
Referenced by llvm::PassManager< Function >::run(), llvm::CGSCCToFunctionPassAdaptor< FunctionPassT >::run(), and llvm::DevirtSCCRepeatedPass< PassT >::run().
|
inline |
Intersect this set with a temporary other set in place.
This is a mutating operation on this preserved set, removing all preserved passes which are not also preserved in the argument.
Definition at line 248 of file PassManager.h.
References Arg.
|
inlinestatic |
Convenience factory function for the empty preserved set.
Definition at line 157 of file PassManager.h.
Referenced by INITIALIZE_PASS(), llvm::BoundsCheckingPass::run(), llvm::LowerGuardIntrinsicPass::run(), llvm::GCOVProfilerPass::run(), llvm::CrossDSOCFIPass::run(), llvm::ForceFunctionAttrsPass::run(), llvm::LowerInvokePass::run(), llvm::HotColdSplittingPass::run(), llvm::PreISelIntrinsicLoweringPass::run(), llvm::LowerAtomicPass::run(), llvm::PartiallyInlineLibCallsPass::run(), llvm::ScalarizerPass::run(), llvm::CanonicalizeAliasesPass::run(), llvm::AddDiscriminatorsPass::run(), llvm::InferFunctionAttrsPass::run(), llvm::PartialInlinerPass::run(), llvm::StripDeadPrototypesPass::run(), llvm::EliminateAvailableExternallyPass::run(), llvm::NameAnonGlobalPass::run(), llvm::GlobalOptPass::run(), llvm::GlobalSplitPass::run(), llvm::ThreadSanitizerPass::run(), llvm::ArgumentPromotionPass::run(), llvm::GlobalDCEPass::run(), llvm::ConstantMergePass::run(), llvm::LowerExpectIntrinsicPass::run(), llvm::PGOInstrumentationGen::run(), llvm::SampleProfileLoaderPass::run(), llvm::AlwaysInlinerPass::run(), llvm::MemorySanitizerPass::run(), llvm::InstrProfiling::run(), llvm::PGOInstrumentationUse::run(), llvm::PostOrderFunctionAttrsPass::run(), llvm::PGOIndirectCallPromotion::run(), llvm::DeadArgumentEliminationPass::run(), llvm::FunctionImportPass::run(), llvm::RewriteSymbolPass::run(), llvm::LowerTypeTestsPass::run(), llvm::WholeProgramDevirtPass::run(), and llvm::InvalidateAllAnalysesPass::run().
|
inline |
Mark an analysis as preserved.
Definition at line 175 of file PassManager.h.
References preserve().
Referenced by llvm::getLoopPassPreservedAnalyses(), incorporateNewSCCRange(), preserve(), llvm::CorrelatedValuePropagationPass::run(), llvm::CallSiteSplittingPass::run(), llvm::DivRemPairsPass::run(), llvm::BreakCriticalEdgesPass::run(), llvm::Float2IntPass::run(), llvm::BDCEPass::run(), llvm::NewGVNPass::run(), llvm::LoopDataPrefetchPass::run(), llvm::LoopDistributePass::run(), llvm::AggressiveInstCombinePass::run(), llvm::AlignmentFromAssumptionsPass::run(), llvm::DSEPass::run(), llvm::RewriteStatepointsForGC::run(), llvm::UnreachableBlockElimPass::run(), llvm::IPSCCPPass::run(), llvm::ADCEPass::run(), llvm::MergedLoadStoreMotionPass::run(), llvm::EarlyCSEPass::run(), llvm::InstCombinePass::run(), llvm::LCSSAPass::run(), llvm::SimplifyCFGPass::run(), llvm::MemCpyOptPass::run(), llvm::LoopSimplifyPass::run(), llvm::TailCallElimPass::run(), llvm::InternalizePass::run(), llvm::ReversePostOrderFunctionAttrsPass::run(), llvm::GVN::run(), llvm::SpeculativeExecutionPass::run(), llvm::SLPVectorizerPass::run(), llvm::ReassociatePass::run(), llvm::LoopVectorizePass::run(), llvm::JumpThreadingPass::run(), llvm::InlinerPass::run(), llvm::NaryReassociatePass::run(), llvm::GVNHoistPass::run(), llvm::GVNSinkPass::run(), and llvm::CGSCCToFunctionPassAdaptor< FunctionPassT >::run().
|
inline |
Given an analysis's ID, mark the analysis as preserved, adding it to the set.
Definition at line 179 of file PassManager.h.
|
inline |
Mark an analysis set as preserved.
Definition at line 190 of file PassManager.h.
Referenced by allInSet(), llvm::LoadStoreVectorizerPass::run(), llvm::ExpandReductionsPass::run(), llvm::DCEPass::run(), llvm::SinkingPass::run(), llvm::PromotePass::run(), llvm::DivRemPairsPass::run(), llvm::BDCEPass::run(), llvm::GuardWideningPass::run(), llvm::Float2IntPass::run(), llvm::EntryExitInstrumenterPass::run(), llvm::AlignmentFromAssumptionsPass::run(), llvm::AggressiveInstCombinePass::run(), llvm::DSEPass::run(), llvm::ADCEPass::run(), llvm::MergedLoadStoreMotionPass::run(), llvm::EarlyCSEPass::run(), llvm::LoopSinkPass::run(), llvm::InstCombinePass::run(), llvm::InstSimplifyPass::run(), llvm::LCSSAPass::run(), llvm::MemCpyOptPass::run(), llvm::SpeculativeExecutionPass::run(), llvm::SLPVectorizerPass::run(), llvm::ReassociatePass::run(), llvm::NaryReassociatePass::run(), llvm::ConstantHoistingPass::run(), llvm::PassManager< Function >::run(), and llvm::CGSCCToFunctionPassAdaptor< FunctionPassT >::run().
|
inline |
Mark an analysis set as preserved using its ID.
Definition at line 195 of file PassManager.h.