|
LLVM 24.0.0git
|
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/ScopeExit.h"#include "llvm/Analysis/InstructionSimplify.h"#include "llvm/Analysis/LoopInfo.h"#include "llvm/Analysis/ScalarEvolutionPatternMatch.h"#include "llvm/Analysis/TargetTransformInfo.h"#include "llvm/Analysis/ValueTracking.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/Dominators.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/PatternMatch.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Transforms/Utils/Local.h"#include "llvm/Transforms/Utils/LoopUtils.h"Go to the source code of this file.
Macros | |
| #define | SCEV_DEBUG_WITH_TYPE(TYPE, X) |
Functions | |
| static const Loop * | PickMostRelevantLoop (const Loop *A, const Loop *B, DominatorTree &DT) |
| PickMostRelevantLoop - Given two loops pick the one that's most relevant for SCEV expansion. | |
| static bool | canBeCheaplyTransformed (ScalarEvolution &SE, const SCEVAddRecExpr *Phi, const SCEVAddRecExpr *Requested, bool &InvertStep) |
| Check whether we can cheaply express the requested SCEV in terms of the available PHI SCEV by truncation and/or inversion of the step. | |
| static bool | IsIncrementNSW (ScalarEvolution &SE, const SCEVAddRecExpr *AR) |
| static bool | IsIncrementNUW (ScalarEvolution &SE, const SCEVAddRecExpr *AR) |
| static bool | canReuseCastForPtrToAddr (const CastInst *CI, Type *Ty, const DataLayout &DL) |
Return true if CI computes the same value as a ptrtoaddr of its pointer operand to Ty. | |
| template<typename T> | |
| static InstructionCost | costAndCollectOperands (const SCEVOperand &WorkItem, const TargetTransformInfo &TTI, TargetTransformInfo::TargetCostKind CostKind, SmallVectorImpl< SCEVOperand > &Worklist) |
| #define SCEV_DEBUG_WITH_TYPE | ( | TYPE, | |
| X ) |
Definition at line 35 of file ScalarEvolutionExpander.cpp.
Referenced by llvm::SCEVExpander::replaceCongruentIVs().
|
static |
Check whether we can cheaply express the requested SCEV in terms of the available PHI SCEV by truncation and/or inversion of the step.
Definition at line 933 of file ScalarEvolutionExpander.cpp.
References llvm::dyn_cast(), llvm::Type::getIntegerBitWidth(), llvm::ScalarEvolution::getMinusSCEV(), llvm::SCEVAddRecExpr::getStart(), llvm::ScalarEvolution::getTruncateOrNoop(), llvm::SCEV::getType(), and llvm::Type::isPointerTy().
Return true if CI computes the same value as a ptrtoaddr of its pointer operand to Ty.
Definition at line 1469 of file ScalarEvolutionExpander.cpp.
References DL, llvm::CastInst::getOpcode(), llvm::Type::getPointerAddressSpace(), llvm::CastInst::getSrcTy(), and llvm::Value::getType().
Referenced by llvm::SCEVExpander::findReusableCastForPtrToAddr().
|
static |
Definition at line 2007 of file ScalarEvolutionExpander.cpp.
References assert(), llvm::CmpInst::BAD_ICMP_PREDICATE, llvm::cast(), CostKind, llvm::dyn_cast(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::enumerate(), llvm::isa(), llvm_unreachable, llvm::CmpInst::makeCmpResultType(), llvm::max(), llvm::min(), llvm::TargetTransformInfo::None, Opc, OpIdx, llvm::scAddExpr, llvm::scAddRecExpr, llvm::scConstant, llvm::scCouldNotCompute, llvm::scMulExpr, llvm::scPtrToAddr, llvm::scSequentialUMinExpr, llvm::scSignExtend, llvm::scSMaxExpr, llvm::scSMinExpr, llvm::scTruncate, llvm::scUDivExpr, llvm::scUMaxExpr, llvm::scUMinExpr, llvm::scUnknown, llvm::scVScale, llvm::scZeroExtend, and T.
|
static |
Definition at line 966 of file ScalarEvolutionExpander.cpp.
References llvm::BitWidth, llvm::cast(), llvm::IntegerType::get(), llvm::ScalarEvolution::getAddExpr(), llvm::Type::getContext(), llvm::ScalarEvolution::getSignExtendExpr(), llvm::SCEVAddRecExpr::getStepRecurrence(), llvm::SCEV::getType(), and llvm::isa().
|
static |
Definition at line 980 of file ScalarEvolutionExpander.cpp.
References llvm::BitWidth, llvm::cast(), llvm::IntegerType::get(), llvm::ScalarEvolution::getAddExpr(), llvm::Type::getContext(), llvm::SCEVAddRecExpr::getStepRecurrence(), llvm::SCEV::getType(), llvm::ScalarEvolution::getZeroExtendExpr(), and llvm::isa().
PickMostRelevantLoop - Given two loops pick the one that's most relevant for SCEV expansion.
If they are nested, this is the most nested. If they are neighboring, pick the later.
Definition at line 436 of file ScalarEvolutionExpander.cpp.
References A(), B(), and llvm::DominatorTree::dominates().