class LoopNest
Declaration
class LoopNest { /* full declaration omitted */ };
Description
This class represents a loop nest and can be used to query its properties.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:28
Member Variables
- protected const unsigned int MaxPerfectDepth
- protected llvm::LoopVectorTy Loops
Method Overview
- public LoopNest()
- public LoopNest(llvm::Loop & Root, llvm::ScalarEvolution & SE)
- private static llvm::LoopNest::LoopNestEnum analyzeLoopNestForPerfectNest(const llvm::Loop & OuterLoop, const llvm::Loop & InnerLoop, llvm::ScalarEvolution & SE)
- public bool areAllLoopsRotatedForm() const
- public bool areAllLoopsSimplifyForm() const
- public static bool arePerfectlyNested(const llvm::Loop & OuterLoop, const llvm::Loop & InnerLoop, llvm::ScalarEvolution & SE)
- public llvm::Loop * getInnermostLoop() const
- public static llvm::LoopNest::InstrVectorTy getInterveningInstructions(const llvm::Loop & OuterLoop, const llvm::Loop & InnerLoop, llvm::ScalarEvolution & SE)
- public llvm::Loop * getLoop(unsigned int Index) const
- public unsigned int getLoopIndex(const llvm::Loop & L) const
- public static std::unique_ptr<LoopNest> getLoopNest(llvm::Loop & Root, llvm::ScalarEvolution & SE)
- public ArrayRef<llvm::Loop *> getLoops() const
- public llvm::LoopVectorTy getLoopsAtDepth(unsigned int Depth) const
- public unsigned int getMaxPerfectDepth() const
- public static unsigned int getMaxPerfectDepth(const llvm::Loop & Root, llvm::ScalarEvolution & SE)
- public llvm::StringRef getName() const
- public unsigned int getNestDepth() const
- public size_t getNumLoops() const
- public llvm::Loop & getOutermostLoop() const
- public llvm::Function * getParent() const
- public SmallVector<llvm::LoopVectorTy, 4> getPerfectLoops(llvm::ScalarEvolution & SE) const
- public static const llvm::BasicBlock & skipEmptyBlockUntil(const llvm::BasicBlock * From, const llvm::BasicBlock * End, bool CheckUniquePred = false)
Methods
¶LoopNest()
LoopNest()
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:35
¶LoopNest(llvm::Loop& Root,
llvm::ScalarEvolution& SE)
LoopNest(llvm::Loop& Root,
llvm::ScalarEvolution& SE)
Description
Construct a loop nest rooted by loop \p Root.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:33
Parameters
- llvm::Loop& Root
- llvm::ScalarEvolution& SE
¶static llvm::LoopNest::LoopNestEnum
analyzeLoopNestForPerfectNest(
const llvm::Loop& OuterLoop,
const llvm::Loop& InnerLoop,
llvm::ScalarEvolution& SE)
static llvm::LoopNest::LoopNestEnum
analyzeLoopNestForPerfectNest(
const llvm::Loop& OuterLoop,
const llvm::Loop& InnerLoop,
llvm::ScalarEvolution& SE)
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:193
Parameters
- const llvm::Loop& OuterLoop
- const llvm::Loop& InnerLoop
- llvm::ScalarEvolution& SE
¶bool areAllLoopsRotatedForm() const
bool areAllLoopsRotatedForm() const
Description
Return true if all loops in the loop nest are in rotated form.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:171
¶bool areAllLoopsSimplifyForm() const
bool areAllLoopsSimplifyForm() const
Description
Return true if all loops in the loop nest are in simplify form.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:166
¶static bool arePerfectlyNested(
const llvm::Loop& OuterLoop,
const llvm::Loop& InnerLoop,
llvm::ScalarEvolution& SE)
static bool arePerfectlyNested(
const llvm::Loop& OuterLoop,
const llvm::Loop& InnerLoop,
llvm::ScalarEvolution& SE)
Description
Return true if the given loops \p OuterLoop and \p InnerLoop are perfectly nested with respect to each other, and false otherwise. Example: arePerfectlyNested(loop_i, loop_j, SE) would return true. arePerfectlyNested(loop_j, loop_k, SE) would return true. arePerfectlyNested(loop_i, loop_k, SE) would return false.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:51
Parameters
- const llvm::Loop& OuterLoop
- const llvm::Loop& InnerLoop
- llvm::ScalarEvolution& SE
¶llvm::Loop* getInnermostLoop() const
llvm::Loop* getInnermostLoop() const
Description
Return the innermost loop in the loop nest if the nest has only one innermost loop, and a nullptr otherwise. Note: the innermost loop returned is not necessarily perfectly nested.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:85
¶static llvm::LoopNest::InstrVectorTy
getInterveningInstructions(
const llvm::Loop& OuterLoop,
const llvm::Loop& InnerLoop,
llvm::ScalarEvolution& SE)
static llvm::LoopNest::InstrVectorTy
getInterveningInstructions(
const llvm::Loop& OuterLoop,
const llvm::Loop& InnerLoop,
llvm::ScalarEvolution& SE)
Description
Return a vector of instructions that prevent the LoopNest given by loops \p OuterLoop and \p InnerLoop from being perfect.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:56
Parameters
- const llvm::Loop& OuterLoop
- const llvm::Loop& InnerLoop
- llvm::ScalarEvolution& SE
¶llvm::Loop* getLoop(unsigned int Index) const
llvm::Loop* getLoop(unsigned int Index) const
Description
Return the loop at the given \p Index.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:100
Parameters
- unsigned int Index
¶unsigned int getLoopIndex(
const llvm::Loop& L) const
unsigned int getLoopIndex(
const llvm::Loop& L) const
Description
Get the loop index of the given loop \p L.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:106
Parameters
- const llvm::Loop& L
¶static std::unique_ptr<LoopNest> getLoopNest(
llvm::Loop& Root,
llvm::ScalarEvolution& SE)
static std::unique_ptr<LoopNest> getLoopNest(
llvm::Loop& Root,
llvm::ScalarEvolution& SE)
Description
Construct a LoopNest object.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:38
Parameters
- llvm::Loop& Root
- llvm::ScalarEvolution& SE
¶ArrayRef<llvm::Loop*> getLoops() const
ArrayRef<llvm::Loop*> getLoops() const
Description
Get the loops in the nest.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:117
¶llvm::LoopVectorTy getLoopsAtDepth(
unsigned int Depth) const
llvm::LoopVectorTy getLoopsAtDepth(
unsigned int Depth) const
Description
Get the loops in the nest at the given \p Depth.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:120
Parameters
- unsigned int Depth
¶unsigned int getMaxPerfectDepth() const
unsigned int getMaxPerfectDepth() const
Description
Return the maximum perfect nesting depth.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:163
¶static unsigned int getMaxPerfectDepth(
const llvm::Loop& Root,
llvm::ScalarEvolution& SE)
static unsigned int getMaxPerfectDepth(
const llvm::Loop& Root,
llvm::ScalarEvolution& SE)
Description
Return the maximum nesting depth of the loop nest rooted by loop \p Root. For example given the loop nest: getMaxPerfectDepth(Loop_i) would return 2.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:69
Parameters
- const llvm::Loop& Root
- llvm::ScalarEvolution& SE
¶llvm::StringRef getName() const
llvm::StringRef getName() const
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:180
¶unsigned int getNestDepth() const
unsigned int getNestDepth() const
Description
Return the loop nest depth (i.e. the loop depth of the 'deepest' loop) For example given the loop nest: getNestDepth() would return 3.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:155
¶size_t getNumLoops() const
size_t getNumLoops() const
Description
Return the number of loops in the nest.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:114
¶llvm::Loop& getOutermostLoop() const
llvm::Loop& getOutermostLoop() const
Description
Return the outermost loop in the loop nest.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:80
¶llvm::Function* getParent() const
llvm::Function* getParent() const
Description
Return the function to which the loop-nest belongs.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:176
¶SmallVector<llvm::LoopVectorTy, 4>
getPerfectLoops(llvm::ScalarEvolution& SE) const
SmallVector<llvm::LoopVectorTy, 4>
getPerfectLoops(llvm::ScalarEvolution& SE) const
Description
Retrieve a vector of perfect loop nests contained in the current loop nest. For example, given the following nest containing 4 loops, this member function would return {{L1,L2},{L3,L4}}.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:144
Parameters
¶static const llvm::BasicBlock&
skipEmptyBlockUntil(const llvm::BasicBlock* From,
const llvm::BasicBlock* End,
bool CheckUniquePred = false)
static const llvm::BasicBlock&
skipEmptyBlockUntil(const llvm::BasicBlock* From,
const llvm::BasicBlock* End,
bool CheckUniquePred = false)
Description
Recursivelly traverse all empty 'single successor' basic blocks of \p From (if there are any). When \p CheckUniquePred is set to true, check if each of the empty single successors has a unique predecessor. Return the last basic block found or \p End if it was reached during the search.
Declared at: llvm/include/llvm/Analysis/LoopNestAnalysis.h:75
Parameters
- const llvm::BasicBlock* From
- const llvm::BasicBlock* End
- bool CheckUniquePred = false