37 #ifndef LLVM_TRANSFORMS_SCALAR_LOOPPASSMANAGER_H
38 #define LLVM_TRANSFORMS_SCALAR_LOOPPASSMANAGER_H
69 LoopStandardAnalysisResults &AnalysisResults,
72 LoopStandardAnalysisResults &, LPMUpdater &>;
86 template <
typename AnalysisT>
94 (void)AM.template getResult<AnalysisT>(L, AR);
100 template <
typename AnalysisT>
113 template <
typename RangeT>
123 assert(PreOrderLoops.
empty() &&
"Must start with an empty preorder walk.");
125 "Must start with an empty preorder walk worklist.");
131 }
while (!PreOrderWorklist.
empty());
133 Worklist.
insert(std::move(PreOrderLoops));
134 PreOrderLoops.
clear();
169 assert(CurrentL->
contains(&L) &&
"Cannot delete a loop outside of the "
170 "subloop tree currently being processed.");
172 SkipCurrentLoop =
true;
184 Worklist.insert(CurrentL);
187 for (
Loop *NewL : NewChildLoops)
188 assert(NewL->getParentLoop() == CurrentL &&
"All of the new loops must "
189 "be immediate children of "
190 "the current loop!");
197 SkipCurrentLoop =
true;
208 for (
Loop *NewL : NewSibLoops)
209 assert(NewL->getParentLoop() == ParentL &&
210 "All of the new loops must be siblings of the current loop!");
229 bool SkipCurrentLoop;
239 : Worklist(Worklist), LAM(LAM) {}
249 template <
typename LoopPassT>
250 class FunctionToLoopPassAdaptor
251 :
public PassInfoMixin<FunctionToLoopPassAdaptor<LoopPassT>> {
309 Updater.CurrentL =
L;
310 Updater.SkipCurrentLoop =
false;
319 "Loops must remain in LCSSA form!");
331 LAM.invalidate(*L, PassPA);
336 }
while (!Worklist.
empty());
365 template <
typename LoopPassT>
385 #endif // LLVM_TRANSFORMS_SCALAR_LOOPPASSMANAGER_H
Pass interface - Implemented by all 'passes'.
This file provides a priority worklist.
Converts loops into loop-closed SSA form.
void push_back(const T &Elt)
PreservedAnalyses run(IRUnitT &IR, AnalysisManagerT &AM, ExtraArgTs...ExtraArgs)
Run all of the passes in this manager over the given unit of IR.
bool insert(const T &X)
Insert a new element into the PriorityWorklist.
LLVM_NODISCARD T pop_back_val()
void intersect(const PreservedAnalyses &Arg)
Intersect this set with another in place.
This is the interface for a simple mod/ref and alias analysis over globals.
This pass is responsible for loop canonicalization.
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.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs...ExtraArgs)
Get the result of an analysis pass for a given IR unit.
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)...
void verifyLoop() const
Verify loop structure.
AnalysisManager< Loop, LoopStandardAnalysisResults & > LoopAnalysisManager
The loop analysis manager.
A set of analyses that are preserved following a run of a transformation pass.
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 isRecursivelyLCSSAForm(DominatorTree &DT, const LoopInfo &LI) const
Return true if this Loop and all inner subloops are in LCSSA form.
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...
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.
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 append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
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.
void clear(IRUnitT &IR)
Clear any cached analysis results for a single unit of IR.
Represents a single loop in the control flow graph.
void preserveSet()
Mark an analysis set as preserved.
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...
void preserve()
Mark an analysis as preserved.
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...