LLVM  3.7.0
Namespaces | Enumerations | Functions
ValueTracking.h File Reference
#include "llvm/ADT/ArrayRef.h"
#include "llvm/IR/Instruction.h"
#include "llvm/Support/DataTypes.h"
Include dependency graph for ValueTracking.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 llvm
 Compute iterated dominance frontiers using a linear time algorithm.
 

Enumerations

enum  llvm::OverflowResult { llvm::OverflowResult::AlwaysOverflows, llvm::OverflowResult::MayOverflow, llvm::OverflowResult::NeverOverflows }
 
enum  llvm::SelectPatternFlavor {
  llvm::SPF_UNKNOWN = 0, llvm::SPF_SMIN, llvm::SPF_UMIN, llvm::SPF_SMAX,
  llvm::SPF_UMAX, llvm::SPF_ABS, llvm::SPF_NABS
}
 Specific patterns of select instructions we can match. More...
 

Functions

void llvm::computeKnownBits (Value *V, APInt &KnownZero, APInt &KnownOne, const DataLayout &DL, unsigned Depth=0, AssumptionCache *AC=nullptr, const Instruction *CxtI=nullptr, const DominatorTree *DT=nullptr)
 Determine which bits of V are known to be either zero or one and return them in the KnownZero/KnownOne bit sets. More...
 
void llvm::computeKnownBitsFromRangeMetadata (const MDNode &Ranges, APInt &KnownZero)
 Compute known bits from the range metadata. More...
 
bool llvm::haveNoCommonBitsSet (Value *LHS, Value *RHS, const DataLayout &DL, AssumptionCache *AC=nullptr, const Instruction *CxtI=nullptr, const DominatorTree *DT=nullptr)
 Returns true if LHS and RHS have no common bits set. More...
 
void llvm::ComputeSignBit (Value *V, bool &KnownZero, bool &KnownOne, const DataLayout &DL, unsigned Depth=0, AssumptionCache *AC=nullptr, const Instruction *CxtI=nullptr, const DominatorTree *DT=nullptr)
 ComputeSignBit - Determine whether the sign bit is known to be zero or one. More...
 
bool llvm::isKnownToBeAPowerOfTwo (Value *V, const DataLayout &DL, bool OrZero=false, unsigned Depth=0, AssumptionCache *AC=nullptr, const Instruction *CxtI=nullptr, const DominatorTree *DT=nullptr)
 isKnownToBeAPowerOfTwo - Return true if the given value is known to have exactly one bit set when defined. More...
 
bool llvm::isKnownNonZero (Value *V, const DataLayout &DL, unsigned Depth=0, AssumptionCache *AC=nullptr, const Instruction *CxtI=nullptr, const DominatorTree *DT=nullptr)
 isKnownNonZero - Return true if the given value is known to be non-zero when defined. More...
 
bool llvm::MaskedValueIsZero (Value *V, const APInt &Mask, const DataLayout &DL, unsigned Depth=0, AssumptionCache *AC=nullptr, const Instruction *CxtI=nullptr, const DominatorTree *DT=nullptr)
 MaskedValueIsZero - Return true if 'V & Mask' is known to be zero. More...
 
unsigned llvm::ComputeNumSignBits (Value *Op, const DataLayout &DL, unsigned Depth=0, AssumptionCache *AC=nullptr, const Instruction *CxtI=nullptr, const DominatorTree *DT=nullptr)
 ComputeNumSignBits - Return the number of times the sign bit of the register is replicated into the other bits. More...
 
bool llvm::ComputeMultiple (Value *V, unsigned Base, Value *&Multiple, bool LookThroughSExt=false, unsigned Depth=0)
 ComputeMultiple - This function computes the integer multiple of Base that equals V. More...
 
bool llvm::CannotBeNegativeZero (const Value *V, unsigned Depth=0)
 CannotBeNegativeZero - Return true if we can prove that the specified FP value is never equal to -0.0. More...
 
bool llvm::CannotBeOrderedLessThanZero (const Value *V, unsigned Depth=0)
 CannotBeOrderedLessThanZero - Return true if we can prove that the specified FP value is either a NaN or never less than 0.0. More...
 
Valuellvm::isBytewiseValue (Value *V)
 isBytewiseValue - If the specified value can be set by repeating the same byte in memory, return the i8 value that it is represented with. More...
 
Valuellvm::FindInsertedValue (Value *V, ArrayRef< unsigned > idx_range, Instruction *InsertBefore=nullptr)
 FindInsertedValue - Given an aggregrate and an sequence of indices, see if the scalar value indexed is already around as a register, for example if it were inserted directly into the aggregrate. More...
 
Valuellvm::GetPointerBaseWithConstantOffset (Value *Ptr, int64_t &Offset, const DataLayout &DL)
 GetPointerBaseWithConstantOffset - Analyze the specified pointer to see if it can be expressed as a base pointer plus a constant offset. More...
 
static const Value * llvm::GetPointerBaseWithConstantOffset (const Value *Ptr, int64_t &Offset, const DataLayout &DL)
 
bool llvm::getConstantStringInfo (const Value *V, StringRef &Str, uint64_t Offset=0, bool TrimAtNul=true)
 getConstantStringInfo - This function computes the length of a null-terminated C string pointed to by V. More...
 
uint64_t llvm::GetStringLength (Value *V)
 GetStringLength - If we can compute the length of the string pointed to by the specified pointer, return 'len+1'. More...
 
Valuellvm::GetUnderlyingObject (Value *V, const DataLayout &DL, unsigned MaxLookup=6)
 GetUnderlyingObject - This method strips off any GEP address adjustments and pointer casts from the specified value, returning the original object being addressed. More...
 
static const Value * llvm::GetUnderlyingObject (const Value *V, const DataLayout &DL, unsigned MaxLookup=6)
 
void llvm::GetUnderlyingObjects (Value *V, SmallVectorImpl< Value * > &Objects, const DataLayout &DL, LoopInfo *LI=nullptr, unsigned MaxLookup=6)
 This method is similar to GetUnderlyingObject except that it can look through phi and select instructions and return multiple objects. More...
 
bool llvm::onlyUsedByLifetimeMarkers (const Value *V)
 onlyUsedByLifetimeMarkers - Return true if the only users of this pointer are lifetime markers. More...
 
bool llvm::isDereferenceablePointer (const Value *V, const DataLayout &DL, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr, const TargetLibraryInfo *TLI=nullptr)
 isDereferenceablePointer - Return true if this is always a dereferenceable pointer. More...
 
bool llvm::isSafeToSpeculativelyExecute (const Value *V, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr, const TargetLibraryInfo *TLI=nullptr)
 isSafeToSpeculativelyExecute - Return true if the instruction does not have any effects besides calculating the result and does not have undefined behavior. More...
 
bool llvm::isKnownNonNull (const Value *V, const TargetLibraryInfo *TLI=nullptr)
 isKnownNonNull - Return true if this pointer couldn't possibly be null by its definition. More...
 
bool llvm::isKnownNonNullAt (const Value *V, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr, const TargetLibraryInfo *TLI=nullptr)
 isKnownNonNullAt - Return true if this pointer couldn't possibly be null. More...
 
bool llvm::isValidAssumeForContext (const Instruction *I, const Instruction *CxtI, const DominatorTree *DT=nullptr)
 Return true if it is valid to use the assumptions provided by an assume intrinsic, I, at the point in the control-flow identified by the context instruction, CxtI. More...
 
OverflowResult llvm::computeOverflowForUnsignedMul (Value *LHS, Value *RHS, const DataLayout &DL, AssumptionCache *AC, const Instruction *CxtI, const DominatorTree *DT)
 
OverflowResult llvm::computeOverflowForUnsignedAdd (Value *LHS, Value *RHS, const DataLayout &DL, AssumptionCache *AC, const Instruction *CxtI, const DominatorTree *DT)
 
SelectPatternFlavor llvm::matchSelectPattern (Value *V, Value *&LHS, Value *&RHS, Instruction::CastOps *CastOp=nullptr)
 Pattern match integer [SU]MIN, [SU]MAX and ABS idioms, returning the kind and providing the out parameter results if we successfully match. More...