LLVM 24.0.0git
LoopPredication.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "loop-predication"

Functions

 STATISTIC (TotalConsidered, "Number of guards considered")
 STATISTIC (TotalWidened, "Number of checks widened")
static bool isSafeToTruncateWideIVType (const ScalarOptions &Opts, const DataLayout &DL, ScalarEvolution &SE, const LoopICmp LatchCheck, Type *RangeCheckType)
static std::optional< LoopICmp > generateLoopLatchCheck (const ScalarOptions &Opts, const DataLayout &DL, ScalarEvolution &SE, const LoopICmp LatchCheck, Type *RangeCheckType)
static void normalizePredicate (ScalarEvolution *SE, Loop *L, LoopICmp &RC)
static CondBrInst * FindWidenableTerminatorAboveLoop (Loop *L, LoopInfo &LI)
 If we can (cheaply) find a widenable branch which controls entry into the loop, return it.
static const SCEV * getMinAnalyzeableBackedgeTakenCount (ScalarEvolution &SE, DominatorTree &DT, Loop *L)
 Return the minimum of all analyzeable exit counts.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "loop-predication"

Definition at line 205 of file LoopPredication.cpp.

Function Documentation

◆ FindWidenableTerminatorAboveLoop()

CondBrInst * FindWidenableTerminatorAboveLoop ( Loop * L,
LoopInfo & LI )
static

If we can (cheaply) find a widenable branch which controls entry into the loop, return it.

Definition at line 947 of file LoopPredication.cpp.

References llvm::dyn_cast(), llvm::BasicBlock::getSinglePredecessor(), llvm::BasicBlock::getSingleSuccessor(), llvm::CondBrInst::getSuccessor(), and llvm::isWidenableBranch().

◆ generateLoopLatchCheck()

std::optional< LoopICmp > generateLoopLatchCheck ( const ScalarOptions & Opts,
const DataLayout & DL,
ScalarEvolution & SE,
const LoopICmp LatchCheck,
Type * RangeCheckType )
static

◆ getMinAnalyzeableBackedgeTakenCount()

const SCEV * getMinAnalyzeableBackedgeTakenCount ( ScalarEvolution & SE,
DominatorTree & DT,
Loop * L )
static

Return the minimum of all analyzeable exit counts.

This is an upper bound on the actual exit count. If there are not at least two analyzeable exits, returns SCEVCouldNotCompute.

Definition at line 977 of file LoopPredication.cpp.

References assert(), llvm::DominatorTree::dominates(), llvm::ScalarEvolution::getCouldNotCompute(), llvm::ScalarEvolution::getExitCount(), llvm::ScalarEvolution::getUMinFromMismatchedTypes(), llvm::isa(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SmallVectorTemplateCommon< T, typename >::size().

◆ isSafeToTruncateWideIVType()

bool isSafeToTruncateWideIVType ( const ScalarOptions & Opts,
const DataLayout & DL,
ScalarEvolution & SE,
const LoopICmp LatchCheck,
Type * RangeCheckType )
static

◆ normalizePredicate()

◆ STATISTIC() [1/2]

STATISTIC ( TotalConsidered ,
"Number of guards considered"  )

◆ STATISTIC() [2/2]

STATISTIC ( TotalWidened ,
"Number of checks widened"  )

References IV.