LLVM API Documentation
#include <ScalarEvolution.h>
Public Types | |
enum | NoWrapFlags { FlagAnyWrap = 0, FlagNW = (1 << 0), FlagNUW = (1 << 1), FlagNSW = (1 << 2), NoWrapMask = (1 << 3) -1 } |
Public Member Functions | |
SCEV (const FoldingSetNodeIDRef ID, unsigned SCEVTy) | |
unsigned | getSCEVType () const |
Type * | getType () const |
bool | isZero () const |
bool | isOne () const |
bool | isAllOnesValue () const |
bool | isNonConstantNegative () const |
void | print (raw_ostream &OS) const |
void | dump () const |
![]() | |
Node () | |
void * | getNextInBucket () const |
void | SetNextInBucket (void *N) |
Protected Attributes | |
unsigned short | SubclassData |
Friends | |
struct | FoldingSetTrait< SCEV > |
SCEV - This class represents an analyzed expression in the program. These are opaque objects that the client is not allowed to do much with directly.
Definition at line 57 of file ScalarEvolution.h.
NoWrapFlags are bitfield indices into SubclassData.
Add and Mul expressions may have no-unsigned-wrap <NUW> or no-signed-wrap <NSW> properties, which are derived from the IR operator. NSW is a misnomer that we use to mean no signed overflow or underflow.
AddRec expression may have a no-self-wraparound <NW> property if the result can never reach the start value. This property is independent of the actual start value and step direction. Self-wraparound is defined purely in terms of the recurrence's loop, step size, and bitwidth. Formally, a recurrence with no self-wraparound satisfies: abs(step) * max-iteration(loop) <= unsigned-max(bitwidth).
Note that NUW and NSW are also valid properties of a recurrence, and either implies NW. For convenience, NW will be set for a recurrence whenever either NUW or NSW are set.
Enumerator | |
---|---|
FlagAnyWrap | |
FlagNW | |
FlagNUW | |
FlagNSW | |
NoWrapMask |
Definition at line 94 of file ScalarEvolution.h.
|
inlineexplicit |
Definition at line 100 of file ScalarEvolution.h.
void SCEV::dump | ( | ) | const |
dump - This method is used for debugging.
Definition at line 132 of file ScalarEvolution.cpp.
References llvm::dbgs(), and print().
|
inline |
Definition at line 103 of file ScalarEvolution.h.
Referenced by BuildConstantFromSCEV(), llvm::SCEVConstant::classof(), llvm::SCEVCastExpr::classof(), llvm::SCEVTruncateExpr::classof(), llvm::SCEVZeroExtendExpr::classof(), llvm::SCEVSignExtendExpr::classof(), llvm::SCEVNAryExpr::classof(), llvm::SCEVCouldNotCompute::classof(), llvm::SCEVCommutativeExpr::classof(), llvm::SCEVAddExpr::classof(), llvm::SCEVMulExpr::classof(), llvm::SCEVUDivExpr::classof(), llvm::SCEVAddRecExpr::classof(), llvm::SCEVSMaxExpr::classof(), llvm::SCEVUMaxExpr::classof(), llvm::SCEVUnknown::classof(), getExprBase(), getType(), GroupByComplexity(), isHighCostExpansion(), print(), llvm::SCEVVisitor< SCEVExpander, Value * >::visit(), and llvm::SCEVTraversal< SV >::visitAll().
Type * SCEV::getType | ( | ) | const |
getType - Return the LLVM type of this SCEV expression.
Definition at line 249 of file ScalarEvolution.cpp.
References getSCEVType(), llvm_unreachable, llvm::scAddExpr, llvm::scAddRecExpr, llvm::scConstant, llvm::scCouldNotCompute, llvm::scMulExpr, llvm::scSignExtend, llvm::scSMaxExpr, llvm::scTruncate, llvm::scUDivExpr, llvm::scUMaxExpr, llvm::scUnknown, and llvm::scZeroExtend.
Referenced by BinomialCoefficient(), FactorOutConstant(), FindLoopCounter(), genLoopLimit(), llvm::ScalarEvolution::getAddExpr(), llvm::ScalarEvolution::getAnyExtendExpr(), getExactSDiv(), llvm::ScalarEvolution::getMinusSCEV(), llvm::ScalarEvolution::getNegativeSCEV(), llvm::ScalarEvolution::getNoopOrAnyExtend(), llvm::ScalarEvolution::getNoopOrSignExtend(), llvm::ScalarEvolution::getNoopOrZeroExtend(), llvm::ScalarEvolution::getNotSCEV(), getOverflowLimitForStep(), llvm::ScalarEvolution::getPointerBase(), llvm::ScalarEvolution::getSignedRange(), llvm::ScalarEvolution::getSignExtendExpr(), llvm::ScalarEvolution::getSmallConstantTripMultiple(), llvm::ScalarEvolution::getTruncateExpr(), llvm::ScalarEvolution::getTruncateOrNoop(), llvm::ScalarEvolution::getTruncateOrSignExtend(), llvm::ScalarEvolution::getTruncateOrZeroExtend(), llvm::SCEVNAryExpr::getType(), llvm::SCEVAddExpr::getType(), llvm::SCEVUDivExpr::getType(), llvm::ScalarEvolution::getUDivExpr(), llvm::ScalarEvolution::getUMaxFromMismatchedTypes(), llvm::ScalarEvolution::getUMinFromMismatchedTypes(), llvm::ScalarEvolution::getUnsignedRange(), llvm::ScalarEvolution::getZeroExtendExpr(), isHighCostExpansion(), llvm::SCEVExpander::replaceCongruentIVs(), llvm::ScalarEvolution::SimplifyICmpOperands(), and llvm::UnrollRuntimeLoopProlog().
bool SCEV::isAllOnesValue | ( | ) | const |
isAllOnesValue - Return true if the expression is a constant all-ones value.
Definition at line 287 of file ScalarEvolution.cpp.
References llvm::PPCISD::SC.
bool SCEV::isNonConstantNegative | ( | ) | const |
isNonConstantNegative - Return true if the specified scev is negated, but not a constant.
Definition at line 295 of file ScalarEvolution.cpp.
References llvm::dyn_cast(), llvm::SCEVNAryExpr::getOperand(), llvm::SCEVConstant::getValue(), llvm::ConstantInt::getValue(), llvm::APInt::isNegative(), and llvm::PPCISD::SC.
bool SCEV::isOne | ( | ) | const |
isOne - Return true if the expression is a constant one.
Definition at line 281 of file ScalarEvolution.cpp.
References llvm::PPCISD::SC.
Referenced by FactorOutConstant(), FindLoopCounter(), and genLoopLimit().
bool SCEV::isZero | ( | ) | const |
isZero - Return true if the expression is a constant zero.
Definition at line 275 of file ScalarEvolution.cpp.
References llvm::PPCISD::SC.
Referenced by canExpandBackedgeTakenCount(), CollectSubexprs(), FactorOutConstant(), FindLoopCounter(), genLoopLimit(), llvm::ScalarEvolution::getAddRecExpr(), isAlwaysFoldable(), and SplitAddRecs().
void SCEV::print | ( | raw_ostream & | OS | ) | const |
print - Print out the internal representation of this scalar to the specified stream. This should really only be used for debugging purposes.
Definition at line 138 of file ScalarEvolution.cpp.
References FlagNSW, FlagNUW, FlagNW, llvm::LoopBase< N, M >::getHeader(), llvm::SCEVUDivExpr::getLHS(), llvm::SCEVAddRecExpr::getLoop(), llvm::SCEVNAryExpr::getNoWrapFlags(), llvm::SCEVNAryExpr::getNumOperands(), llvm::SCEVCastExpr::getOperand(), llvm::SCEVNAryExpr::getOperand(), llvm::SCEVUDivExpr::getRHS(), getSCEVType(), llvm::SCEVCastExpr::getType(), llvm::SCEVUnknown::getValue(), I, llvm::SCEVUnknown::isAlignOf(), llvm::SCEVUnknown::isOffsetOf(), llvm::SCEVUnknown::isSizeOf(), llvm_unreachable, llvm::next(), llvm::SCEVNAryExpr::op_begin(), llvm::SCEVNAryExpr::op_end(), llvm::scAddExpr, llvm::scAddRecExpr, llvm::scConstant, llvm::scCouldNotCompute, llvm::scMulExpr, llvm::scSignExtend, llvm::scSMaxExpr, llvm::scTruncate, llvm::scUDivExpr, llvm::scUMaxExpr, llvm::scUnknown, llvm::scZeroExtend, and llvm::WriteAsOperand().
Referenced by dump(), getLoopBackedgeTakenCounts(), llvm::operator<<(), and llvm::ScalarEvolution::print().
|
friend |
Definition at line 58 of file ScalarEvolution.h.
|
protected |
SubclassData - This field is initialized to zero and may be used in subclasses to store miscellaneous information.
Definition at line 70 of file ScalarEvolution.h.
Referenced by llvm::SCEVNAryExpr::getNoWrapFlags(), llvm::SCEVCommutativeExpr::setNoWrapFlags(), and llvm::SCEVAddRecExpr::setNoWrapFlags().