LLVM  13.0.0git
Macros | Functions | Variables
LoopNestAnalysis.cpp File Reference
#include "llvm/Analysis/LoopNestAnalysis.h"
#include "llvm/ADT/BreadthFirstIterator.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/Analysis/ValueTracking.h"
Include dependency graph for LoopNestAnalysis.cpp:

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: More...
 

Variables

static const char * VerboseDebug = DEBUG_TYPE "-verbose"
 

Detailed Description

The implementation for the loop nest analysis.

Definition in file LoopNestAnalysis.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "loopnest"

Definition at line 22 of file LoopNestAnalysis.cpp.

Function Documentation

◆ checkLoopsStructure()

static bool checkLoopsStructure ( const Loop OuterLoop,
const Loop InnerLoop,
ScalarEvolution SE 
)
static

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 235 of file LoopNestAnalysis.cpp.

References llvm::all_of(), llvm::any_of(), BB, 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().

Referenced by llvm::LoopNest::arePerfectlyNested().

Variable Documentation

◆ VerboseDebug

const char* VerboseDebug = DEBUG_TYPE "-verbose"
static

Definition at line 24 of file LoopNestAnalysis.cpp.

Referenced by llvm::LoopNest::arePerfectlyNested().