LLVM 19.0.0git
Macros | Functions | Variables
LoopConstrainer.cpp File Reference
#include "llvm/Transforms/Utils/LoopConstrainer.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
#include "llvm/IR/Dominators.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/Transforms/Utils/LoopSimplify.h"
#include "llvm/Transforms/Utils/LoopUtils.h"
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "loop-constrainer"
 

Functions

static bool isSafeDecreasingBound (const SCEV *Start, const SCEV *BoundSCEV, const SCEV *Step, ICmpInst::Predicate Pred, unsigned LatchBrExitIdx, Loop *L, ScalarEvolution &SE)
 Given a loop with an deccreasing induction variable, is it possible to safely calculate the bounds of a new loop using the given Predicate.
 
static bool isSafeIncreasingBound (const SCEV *Start, const SCEV *BoundSCEV, const SCEV *Step, ICmpInst::Predicate Pred, unsigned LatchBrExitIdx, Loop *L, ScalarEvolution &SE)
 Given a loop with an increasing induction variable, is it possible to safely calculate the bounds of a new loop using the given Predicate.
 
static const SCEVgetNarrowestLatchMaxTakenCountEstimate (ScalarEvolution &SE, const Loop &L)
 Returns estimate for max latch taken count of the loop of the narrowest available type.
 
static void DisableAllLoopOptsOnLoop (Loop &L)
 

Variables

static const charClonedLoopTag = "loop_constrainer.loop.clone"
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "loop-constrainer"

Definition at line 15 of file LoopConstrainer.cpp.

Function Documentation

◆ DisableAllLoopOptsOnLoop()

static void DisableAllLoopOptsOnLoop ( Loop L)
static

◆ getNarrowestLatchMaxTakenCountEstimate()

static const SCEV * getNarrowestLatchMaxTakenCountEstimate ( ScalarEvolution SE,
const Loop L 
)
static

Returns estimate for max latch taken count of the loop of the narrowest available type.

If the latch block has such estimate, it is returned. Otherwise, we use max exit count of whole loop (that is potentially of wider type than latch check itself), which is still better than no estimate.

Definition at line 115 of file LoopConstrainer.cpp.

References llvm::ScalarEvolution::getExitCount(), llvm::ScalarEvolution::getSymbolicMaxBackedgeTakenCount(), and llvm::ScalarEvolution::SymbolicMaximum.

Referenced by llvm::LoopStructure::parseLoopStructure().

◆ isSafeDecreasingBound()

static bool isSafeDecreasingBound ( const SCEV Start,
const SCEV BoundSCEV,
const SCEV Step,
ICmpInst::Predicate  Pred,
unsigned  LatchBrExitIdx,
Loop L,
ScalarEvolution SE 
)
static

◆ isSafeIncreasingBound()

static bool isSafeIncreasingBound ( const SCEV Start,
const SCEV BoundSCEV,
const SCEV Step,
ICmpInst::Predicate  Pred,
unsigned  LatchBrExitIdx,
Loop L,
ScalarEvolution SE 
)
static

Variable Documentation

◆ ClonedLoopTag

const char* ClonedLoopTag = "loop_constrainer.loop.clone"
static

Definition at line 13 of file LoopConstrainer.cpp.

Referenced by llvm::LoopStructure::parseLoopStructure().