LLVM: lib/Analysis/LoopNestAnalysis.cpp File Reference (original) (raw)
The implementation for the loop nest analysis. More...
Go to the source code of this file.
| Macros | |
|---|---|
| #define | DEBUG_TYPE "loopnest" |
| Functions | |
|---|---|
| static bool | checkLoopsStructure (const Loop &OuterLoop, const Loop &InnerLoop, ScalarEvolution &SE) |
| Determine whether the loops structure violates basic requirements for perfect nesting: | |
| static CmpInst * | getOuterLoopLatchCmp (const Loop &OuterLoop) |
| static CmpInst * | getInnerLoopGuardCmp (const Loop &InnerLoop) |
| static bool | checkSafeInstruction (const Instruction &I, const CmpInst *InnerLoopGuardCmp, const CmpInst *OuterLoopLatchCmp, std::optional< Loop::LoopBounds > OuterLoopLB) |
The implementation for the loop nest analysis.
Definition in file LoopNestAnalysis.cpp.
◆ DEBUG_TYPE
#define DEBUG_TYPE "loopnest"
◆ checkLoopsStructure()
Determine whether the loops structure violates basic requirements for perfect nesting:
- the inner loop should be the outer loop's only child
- the outer loop header should 'flow' into the inner loop preheader or jump around the inner loop to the outer loop latch
- if the inner loop latch exits the inner loop, it should 'flow' into the outer loop latch. Returns true if the loop structure satisfies the basic requirements and false otherwise.
Definition at line 315 of file LoopNestAnalysis.cpp.
References llvm::all_of(), llvm::any_of(), llvm::LoopBase< BlockT, LoopT >::getExitBlock(), llvm::LoopBase< BlockT, LoopT >::getExitingBlock(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::LoopBase< BlockT, LoopT >::getLoopLatch(), llvm::LoopBase< BlockT, LoopT >::getLoopPreheader(), llvm::LoopBase< BlockT, LoopT >::getParentLoop(), llvm::LoopBase< BlockT, LoopT >::getSubLoops(), and llvm::Loop::isLoopSimplifyForm().