LLVM 20.0.0git
|
#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 SCEV * | getNarrowestLatchMaxTakenCountEstimate (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 char * | ClonedLoopTag = "loop_constrainer.loop.clone" |
#define DEBUG_TYPE "loop-constrainer" |
Definition at line 15 of file LoopConstrainer.cpp.
|
static |
Definition at line 434 of file LoopConstrainer.cpp.
References llvm::ConstantAsMetadata::get(), llvm::MDNode::get(), llvm::MDString::get(), llvm::Type::getInt1Ty(), and llvm::MDNode::replaceOperandWith().
Referenced by llvm::LoopConstrainer::run().
|
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().
|
static |
Given a loop with an deccreasing induction variable, is it possible to safely calculate the bounds of a new loop using the given Predicate.
Definition at line 19 of file LoopConstrainer.cpp.
References llvm::ScalarEvolution::applyLoopGuards(), assert(), llvm::BitWidth, llvm::dbgs(), llvm::ScalarEvolution::getAddExpr(), llvm::ScalarEvolution::getConstant(), llvm::ScalarEvolution::getMinusSCEV(), llvm::APInt::getMinValue(), llvm::ScalarEvolution::getOne(), llvm::APInt::getSignedMinValue(), llvm::SCEV::getType(), llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_UGT, llvm::ScalarEvolution::isAvailableAtLoopEntry(), llvm::ScalarEvolution::isKnownNegative(), llvm::ScalarEvolution::isLoopEntryGuardedByCond(), and LLVM_DEBUG.
Referenced by llvm::LoopStructure::parseLoopStructure().
|
static |
Given a loop with an increasing induction variable, is it possible to safely calculate the bounds of a new loop using the given Predicate.
Definition at line 68 of file LoopConstrainer.cpp.
References llvm::ScalarEvolution::applyLoopGuards(), assert(), llvm::BitWidth, llvm::dbgs(), llvm::ScalarEvolution::getAddExpr(), llvm::ScalarEvolution::getConstant(), llvm::APInt::getMaxValue(), llvm::ScalarEvolution::getMinusSCEV(), llvm::ScalarEvolution::getOne(), llvm::APInt::getSignedMaxValue(), llvm::SCEV::getType(), llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_ULT, llvm::ScalarEvolution::isAvailableAtLoopEntry(), llvm::ScalarEvolution::isLoopEntryGuardedByCond(), and LLVM_DEBUG.
Referenced by llvm::LoopStructure::parseLoopStructure().
Definition at line 13 of file LoopConstrainer.cpp.
Referenced by llvm::LoopStructure::parseLoopStructure().