37 #ifndef LLVM_TRANSFORMS_SCALAR_LOOPPASSMANAGER_H
38 #define LLVM_TRANSFORMS_SCALAR_LOOPPASSMANAGER_H
67 LoopStandardAnalysisResults &AnalysisResults,
70 LoopStandardAnalysisResults &, LPMUpdater &>;
84 template <
typename AnalysisT>
92 (void)AM.template getResult<AnalysisT>(L, AR);
98 template <
typename AnalysisT>
111 template <
typename RangeT>
121 assert(PreOrderLoops.
empty() &&
"Must start with an empty preorder walk.");
123 "Must start with an empty preorder walk worklist.");
129 }
while (!PreOrderWorklist.
empty());
131 Worklist.
insert(std::move(PreOrderLoops));
132 PreOrderLoops.
clear();
167 assert(CurrentL->
contains(&L) &&
"Cannot delete a loop outside of the "
168 "subloop tree currently being processed.");
170 SkipCurrentLoop =
true;
182 Worklist.insert(CurrentL);
185 for (
Loop *NewL : NewChildLoops)
186 assert(NewL->getParentLoop() == CurrentL &&
"All of the new loops must "
187 "be immediate children of "
188 "the current loop!");
195 SkipCurrentLoop =
true;
206 for (
Loop *NewL : NewSibLoops)
207 assert(NewL->getParentLoop() == ParentL &&
208 "All of the new loops must be siblings of the current loop!");
227 bool SkipCurrentLoop;
237 : Worklist(Worklist), LAM(LAM) {}
247 template <
typename LoopPassT>
248 class FunctionToLoopPassAdaptor
249 :
public PassInfoMixin<FunctionToLoopPassAdaptor<LoopPassT>> {
295 Updater.CurrentL =
L;
296 Updater.SkipCurrentLoop =
false;
314 PA.intersect(std::move(PassPA));
315 }
while (!Worklist.
empty());
343 template <
typename LoopPassT>
363 #endif // LLVM_TRANSFORMS_SCALAR_LOOPPASSMANAGER_H
Pass interface - Implemented by all 'passes'.
This file provides a priority worklist.
void push_back(const T &Elt)
bool insert(const T &X)
Insert a new element into the PriorityWorklist.
LLVM_NODISCARD T pop_back_val()
This is the interface for a simple mod/ref and alias analysis over globals.
Analysis pass providing the TargetTransformInfo.
LoopT * getParentLoop() const
RequireAnalysisPass< AnalysisT, Loop, LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater & > RequireAnalysisLoopPass
An alias template to easily name a require analysis loop pass.
The adaptor from a function pass to a loop pass computes these analyses and makes them available to t...
Analysis pass which computes a DominatorTree.
PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &)
A utility pass template to force an analysis result to be available.
This is the interface for a SCEV-based alias analysis.
Analysis pass that exposes the LoopInfo for a function.
LLVM_NODISCARD bool empty() const
auto reverse(ContainerTy &&C, typename std::enable_if< has_rbegin< ContainerTy >::value >::type *=nullptr) -> decltype(make_range(C.rbegin(), C.rend()))
A CRTP mix-in to automatically provide informational APIs needed for passes.
Adaptor that maps from a function to its loops.
This header provides classes for managing per-loop analyses.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
AnalysisManager< Loop, LoopStandardAnalysisResults & > LoopAnalysisManager
The loop analysis manager.
A set of analyses that are preserved following a run of a transformation pass.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs...ExtraArgs)
Get the result of an analysis pass for a given IR unit.
FunctionToLoopPassAdaptor(LoopPassT Pass)
void addChildLoops(ArrayRef< Loop * > NewChildLoops)
Loop passes should use this method to indicate they have added new child loops of the current loop...
A manager for alias analyses.
bool contains(const LoopT *L) const
Return true if the specified loop is contained within in this loop.
Analysis pass providing a never-invalidated alias analysis result.
Analysis pass providing a never-invalidated alias analysis result.
A version of PriorityWorklist that selects small size optimized data structures for the vector and ma...
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
void addSiblingLoops(ArrayRef< Loop * > NewSibLoops)
Loop passes should use this method to indicate they have added new sibling loops to the current loop...
FunctionToLoopPassAdaptor< LoopPassT > createFunctionToLoopPassAdaptor(LoopPassT Pass)
A function to deduce a loop pass type and wrap it in the templated adaptor.
void clear(IRUnitT &IR)
Clear any cached analysis results for a single unit of IR.
A function analysis which provides an AssumptionCache.
This class provides an interface for updating the loop pass manager based on mutations to the loop ne...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Pass for printing a loop's contents as textual IR.
LLVM_NODISCARD T pop_back_val()
void invalidate(IRUnitT &IR)
Invalidate a specific analysis pass for an IR module.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Runs the loop passes across every loop in the function.
Analysis pass that exposes the ScalarEvolution for a function.
Analysis pass providing a never-invalidated alias analysis result.
PassManager< Loop, LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater & > LoopPassManager
The Loop pass manager.
Represents a single loop in the control flow graph.
void appendLoopsToWorklist(RangeT &&Loops, SmallPriorityWorklist< Loop *, 4 > &Worklist)
Helper to implement appending of loops onto a worklist.
bool skipCurrentLoop() const
This can be queried by loop passes which run other loop passes (like pass managers) to know whether t...
Analysis pass providing the TargetLibraryInfo.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This templated class represents "all analyses that operate over \<a particular IR unit\>" (e...
This class implements an extremely fast bulk output stream that can only output to a stream...
This is the interface for LLVM's primary stateless and local alias analysis.
A container for analyses that lazily runs them and caches their results.
This header defines various interfaces for pass management in LLVM.
void markLoopAsDeleted(Loop &L)
Loop passes should use this method to indicate they have deleted a loop from the nest.
bool empty() const
Determine if the PriorityWorklist is empty or not.
An analysis over an "outer" IR unit that provides access to an analysis manager over an "inner" IR un...