|
LLVM 24.0.0git
|
#include "llvm/Transforms/Scalar/LoopPredication.h"#include "ScalarOptions.h"#include "llvm/ADT/Statistic.h"#include "llvm/Analysis/AliasAnalysis.h"#include "llvm/Analysis/BranchProbabilityInfo.h"#include "llvm/Analysis/GuardUtils.h"#include "llvm/Analysis/LoopInfo.h"#include "llvm/Analysis/LoopPass.h"#include "llvm/Analysis/MemorySSA.h"#include "llvm/Analysis/MemorySSAUpdater.h"#include "llvm/Analysis/ScalarEvolution.h"#include "llvm/Analysis/ScalarEvolutionExpressions.h"#include "llvm/IR/Function.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/Module.h"#include "llvm/IR/PatternMatch.h"#include "llvm/IR/ProfDataUtils.h"#include "llvm/Pass.h"#include "llvm/Support/Debug.h"#include "llvm/Transforms/Scalar.h"#include "llvm/Transforms/Utils/GuardUtils.h"#include "llvm/Transforms/Utils/Local.h"#include "llvm/Transforms/Utils/LoopUtils.h"#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"#include <optional>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. | |
| #define DEBUG_TYPE "loop-predication" |
Definition at line 205 of file LoopPredication.cpp.
|
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().
|
static |
Definition at line 417 of file LoopPredication.cpp.
References llvm::dbgs(), DL, llvm::dyn_cast(), llvm::ScalarEvolution::getTruncateExpr(), llvm::SCEV::getType(), isSafeToTruncateWideIVType(), and LLVM_DEBUG.
|
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().
|
static |
Definition at line 382 of file LoopPredication.cpp.
References assert(), DL, llvm::dyn_cast(), llvm::ScalarEvolution::getMonotonicPredicateType(), llvm::SCEVAddRecExpr::getStart(), and llvm::SCEV::getType().
Referenced by generateLoopLatchCheck().
|
static |
Definition at line 611 of file LoopPredication.cpp.
References llvm::SCEVAddRecExpr::getStart(), llvm::SCEVAddRecExpr::getStepRecurrence(), llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_UGE, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, llvm::ICmpInst::isEquality(), llvm::ScalarEvolution::isKnownPredicate(), and llvm::SCEV::isOne().
| STATISTIC | ( | TotalConsidered | , |
| "Number of guards considered" | ) |