diff options
Diffstat (limited to 'include/llvm/Analysis/ValueTracking.h')
-rw-r--r-- | include/llvm/Analysis/ValueTracking.h | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/include/llvm/Analysis/ValueTracking.h b/include/llvm/Analysis/ValueTracking.h index aaf6f888e06f..e3c2f3bed227 100644 --- a/include/llvm/Analysis/ValueTracking.h +++ b/include/llvm/Analysis/ValueTracking.h @@ -31,6 +31,7 @@ template <typename T> class ArrayRef; class Instruction; class Loop; class LoopInfo; + class OptimizationRemarkEmitter; class MDNode; class StringRef; class TargetLibraryInfo; @@ -52,7 +53,8 @@ template <typename T> class ArrayRef; const DataLayout &DL, unsigned Depth = 0, AssumptionCache *AC = nullptr, const Instruction *CxtI = nullptr, - const DominatorTree *DT = nullptr); + const DominatorTree *DT = nullptr, + OptimizationRemarkEmitter *ORE = nullptr); /// Compute known bits from the range metadata. /// \p KnownZero the set of bits that are known to be zero /// \p KnownOne the set of bits that are known to be one @@ -86,8 +88,10 @@ template <typename T> class ArrayRef; /// Return true if the given value is known to be non-zero when defined. For /// vectors, return true if every element is known to be non-zero when - /// defined. Supports values with integer or pointer type and vectors of - /// integers. + /// defined. For pointers, if the context instruction and dominator tree are + /// specified, perform context-sensitive analysis and return true if the + /// pointer couldn't possibly be null at the specified instruction. + /// Supports values with integer or pointer type and vectors of integers. bool isKnownNonZero(const Value *V, const DataLayout &DL, unsigned Depth = 0, AssumptionCache *AC = nullptr, const Instruction *CxtI = nullptr, @@ -167,13 +171,25 @@ template <typename T> class ArrayRef; bool CannotBeNegativeZero(const Value *V, const TargetLibraryInfo *TLI, unsigned Depth = 0); - /// Return true if we can prove that the specified FP value is either a NaN or - /// never less than 0.0. - /// If \p IncludeNeg0 is false, -0.0 is considered less than 0.0. + /// Return true if we can prove that the specified FP value is either NaN or + /// never less than -0.0. + /// + /// NaN --> true + /// +0 --> true + /// -0 --> true + /// x > +0 --> true + /// x < -0 --> false + /// bool CannotBeOrderedLessThanZero(const Value *V, const TargetLibraryInfo *TLI); - /// \returns true if we can prove that the specified FP value has a 0 sign - /// bit. + /// Return true if we can prove that the specified FP value's sign bit is 0. + /// + /// NaN --> true/false (depending on the NaN's sign bit) + /// +0 --> true + /// -0 --> false + /// x > +0 --> true + /// x < -0 --> false + /// bool SignBitMustBeZero(const Value *V, const TargetLibraryInfo *TLI); /// If the specified value can be set by repeating the same byte in memory, |