Go to the documentation of this file.
88 #ifndef LLVM_ANALYSIS_CGSCCPASSMANAGER_H
89 #define LLVM_ANALYSIS_CGSCCPASSMANAGER_H
103 template <
typename T,
unsigned int N>
class SmallPriorityWorklist;
104 struct CGSCCUpdateResult;
109 #define DEBUG_TYPE "cgscc"
112 extern template class AllAnalysesOn<LazyCallGraph::SCC>;
114 extern template class AnalysisManager<LazyCallGraph::SCC, LazyCallGraph &>;
147 template <
typename AnalysisT>
150 :
PassInfoMixin<RequireAnalysisPass<AnalysisT, LazyCallGraph::SCC,
151 CGSCCAnalysisManager, LazyCallGraph &,
152 CGSCCUpdateResult &>> {
155 (void)AM.template getResult<AnalysisT>(
C, CG);
161 auto PassName = MapClassName2PassName(ClassName);
162 OS <<
"require<" <<
PassName <<
">";
176 : InnerAM(&InnerAM),
G(&
G) {}
359 Pass->printPipeline(OS, MapClassName2PassName);
366 std::unique_ptr<PassConceptT>
Pass;
371 template <
typename CGSCCPassT>
372 ModuleToPostOrderCGSCCPassAdaptor
380 std::unique_ptr<ModuleToPostOrderCGSCCPassAdaptor::PassConceptT>(
381 new PassModelT(std::forward<CGSCCPassT>(
Pass))));
423 extern template class OuterAnalysisManagerProxy<CGSCCAnalysisManager, Function>;
465 bool EagerlyInvalidate,
bool NoRerun)
471 NoRerun(
Arg.NoRerun) {}
490 if (EagerlyInvalidate)
493 Pass->printPipeline(OS, MapClassName2PassName);
500 std::unique_ptr<PassConceptT>
Pass;
501 bool EagerlyInvalidate;
507 template <
typename FunctionPassT>
508 CGSCCToFunctionPassAdaptor
510 bool EagerlyInvalidate =
false,
511 bool NoRerun =
false) {
518 std::unique_ptr<CGSCCToFunctionPassAdaptor::PassConceptT>(
519 new PassModelT(std::forward<FunctionPassT>(
Pass))),
520 EagerlyInvalidate, NoRerun);
568 OS <<
"devirt<" << MaxIterations <<
">(";
569 Pass->printPipeline(OS, MapClassName2PassName);
574 std::unique_ptr<PassConceptT>
Pass;
580 template <
typename CGSCCPassT>
589 std::unique_ptr<DevirtSCCRepeatedPass::PassConceptT>(
590 new PassModelT(std::forward<CGSCCPassT>(
Pass))),
599 #endif // LLVM_ANALYSIS_CGSCCPASSMANAGER_H
A set of analyses that are preserved following a run of a transformation pass.
An analysis over an "inner" IR unit that provides access to an analysis manager over a "outer" IR uni...
This is an optimization pass for GlobalISel generic memory operations.
print lazy value Lazy Value Info Printer Pass
SmallPtrSetImpl< LazyCallGraph::SCC * > & InvalidatedSCCs
The set of invalidated SCCs which should be skipped if they are found in CWorklist.
A CRTP mix-in to automatically provide informational APIs needed for passes.
A helper that repeats an SCC pass each time an indirect call is refined to a direct call by that pass...
Implements a dense probed hash-table based set with some number of buckets stored inline.
Result run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM, LazyCallGraph &)
Computes the FunctionAnalysisManager and stores it in the result proxy.
FunctionAnalysisManager FAM
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
CGSCCToFunctionPassAdaptor createCGSCCToFunctionPassAdaptor(FunctionPassT &&Pass, bool EagerlyInvalidate=false, bool NoRerun=false)
A function to deduce a function pass type and wrap it in the templated adaptor.
Result(CGSCCAnalysisManager &InnerAM, LazyCallGraph &G)
friend void swap(CGSCCToFunctionPassAdaptor &LHS, CGSCCToFunctionPassAdaptor &RHS)
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
Result(FunctionAnalysisManager &FAM)
CGSCCToFunctionPassAdaptor(std::unique_ptr< PassConceptT > Pass, bool EagerlyInvalidate, bool NoRerun)
Adaptor that maps from a SCC to its functions.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
friend void swap(ModuleToPostOrderCGSCCPassAdaptor &LHS, ModuleToPostOrderCGSCCPassAdaptor &RHS)
ModuleToPostOrderCGSCCPassAdaptor(ModuleToPostOrderCGSCCPassAdaptor &&Arg)
SmallMapVector< Value *, WeakTrackingVH, 16 > IndirectVHs
Weak VHs to keep track of indirect calls for the purposes of detecting devirtualization.
An SCC of the call graph.
(vector float) vec_cmpeq(*A, *B) C
InnerAnalysisManagerProxy< CGSCCAnalysisManager, Module > CGSCCAnalysisManagerModuleProxy
A proxy from a CGSCCAnalysisManager to a Module.
This class implements an extremely fast bulk output stream that can only output to a stream.
DevirtSCCRepeatedPass createDevirtSCCRepeatedPass(CGSCCPassT &&Pass, int MaxIterations)
A function to deduce a function pass type and wrap it in the templated adaptor.
API to communicate dependencies between analyses during invalidation.
The core module pass which does a post-order walk of the SCCs and runs a CGSCC pass over each one.
ModuleToPostOrderCGSCCPassAdaptor & operator=(ModuleToPostOrderCGSCCPassAdaptor RHS)
PointerTypeMap run(const Module &M)
Compute the PointerTypeMap for the module M.
bool invalidate(LazyCallGraph::SCC &C, const PreservedAnalyses &PA, CGSCCAnalysisManager::Invalidator &Inv)
An efficient, type-erasing, non-owning reference to a callable.
CGSCCToFunctionPassAdaptor & operator=(CGSCCToFunctionPassAdaptor RHS)
A MapVector that performs no allocations if smaller than a certain size.
LazyCallGraph::SCC * UpdatedC
If non-null, the updated current SCC being processed.
LazyCallGraph::SCC & updateCGAndAnalysisManagerForFunctionPass(LazyCallGraph &G, LazyCallGraph::SCC &C, LazyCallGraph::Node &N, CGSCCAnalysisManager &AM, CGSCCUpdateResult &UR, FunctionAnalysisManager &FAM)
Helper to update the call graph after running a function pass.
Result run(Function &F, FunctionAnalysisManager &FAM)
SmallDenseSet< std::pair< LazyCallGraph::Node *, LazyCallGraph::SCC * >, 4 > & InlinedInternalEdges
A hacky area where the inliner can retain history about inlining decisions that mutated the call grap...
A version of PriorityWorklist that selects small size optimized data structures for the vector and ma...
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
A special type used by analysis passes to provide an address that identifies that particular analysis...
ModuleToPostOrderCGSCCPassAdaptor(std::unique_ptr< PassConceptT > Pass)
SmallPriorityWorklist< LazyCallGraph::SCC *, 1 > & CWorklist
Worklist of the SCCs queued for processing.
Template for the abstract base class used to dispatch polymorphically over pass objects.
bool invalidate(IRUnitT &IR, const PreservedAnalyses &PA, typename AnalysisManager< IRUnitT, ExtraArgTs... >::Invalidator &Inv)
Handler for invalidation of the outer IR unit, IRUnitT.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
AnalysisManager< LazyCallGraph::SCC, LazyCallGraph & > CGSCCAnalysisManager
The CGSCC analysis manager.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
void updateFAM(FunctionAnalysisManager &FAM)
A Module instance is used to store all the information related to an LLVM module.
A CRTP mix-in that provides informational APIs needed for analysis passes.
A node in the call graph.
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
PreservedAnalyses CrossSCCPA
Preserved analyses across SCCs.
CGSCCAnalysisManager & getManager()
Accessor for the analysis manager.
StringRef - Represent a constant reference to a string, i.e.
PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM, LazyCallGraph &CG, CGSCCUpdateResult &)
PreservedAnalyses run(LazyCallGraph::SCC &InitialC, CGSCCAnalysisManager &AM, LazyCallGraph &CG, CGSCCUpdateResult &UR)
Runs the wrapped pass up to MaxIterations on the SCC, iterating whenever an indirect call is refined.
Machine Check Debug Module
CGSCCToFunctionPassAdaptor(CGSCCToFunctionPassAdaptor &&Arg)
Manages a sequence of passes over a particular unit of IR.
Support structure for SCC passes to communicate updates the call graph back to the CGSCC pass manager...
OuterAnalysisManagerProxy< CGSCCAnalysisManager, Function > CGSCCAnalysisManagerFunctionProxy
A proxy from a CGSCCAnalysisManager to a Function.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
DevirtSCCRepeatedPass(std::unique_ptr< PassConceptT > Pass, int MaxIterations)
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Runs the CGSCC pass across every SCC in the module.
LazyCallGraph::SCC & updateCGAndAnalysisManagerForCGSCCPass(LazyCallGraph &G, LazyCallGraph::SCC &C, LazyCallGraph::Node &N, CGSCCAnalysisManager &AM, CGSCCUpdateResult &UR, FunctionAnalysisManager &FAM)
Helper to update the call graph after running a CGSCC pass.
Pass interface - Implemented by all 'passes'.
A template wrapper used to implement the polymorphic API.
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
A container for analyses that lazily runs them and caches their results.
An analysis over an "outer" IR unit that provides access to an analysis manager over an "inner" IR un...
A utility pass template to force an analysis result to be available.
A lazily constructed view of the call graph of a module.
FunctionAnalysisManager & getManager()
Accessor for the analysis manager.
A proxy from a FunctionAnalysisManager to an SCC.
SmallPtrSetImpl< LazyCallGraph::RefSCC * > & InvalidatedRefSCCs
The set of invalidated RefSCCs which should be skipped if they are found in RCWorklist.
Result run(IRUnitT &IR, AnalysisManager< IRUnitT, ExtraArgTs... > &AM, ExtraArgTs...)
Run the analysis pass and create our proxy result object.
ModuleToPostOrderCGSCCPassAdaptor createModuleToPostOrderCGSCCPassAdaptor(CGSCCPassT &&Pass)
A function to deduce a function pass type and wrap it in the templated adaptor.
static const char PassName[]
SmallPriorityWorklist< LazyCallGraph::RefSCC *, 1 > & RCWorklist
Worklist of the RefSCCs queued for processing.