Update clang to r339409.
Change-Id: I800772d2d838223be1f6b40d490c4591b937fca2
diff --git a/linux-x64/clang/include/llvm/Analysis/ValueTracking.h b/linux-x64/clang/include/llvm/Analysis/ValueTracking.h
index ced95df..99b47fb 100644
--- a/linux-x64/clang/include/llvm/Analysis/ValueTracking.h
+++ b/linux-x64/clang/include/llvm/Analysis/ValueTracking.h
@@ -101,6 +101,12 @@
const Instruction *CxtI = nullptr,
const DominatorTree *DT = nullptr);
+ /// Return true if the two given values are negation.
+ /// Currently can recoginze Value pair:
+ /// 1: <X, Y> if X = sub (0, Y) or Y = sub (0, X)
+ /// 2: <X, Y> if X = sub (A, B) and Y = sub (B, A)
+ bool isKnownNegation(const Value *X, const Value *Y, bool NeedNSW = false);
+
/// Returns true if the give value is known to be non-negative.
bool isKnownNonNegative(const Value *V, const DataLayout &DL,
unsigned Depth = 0,
@@ -188,7 +194,8 @@
/// Return true if the floating-point scalar value is not a NaN or if the
/// floating-point vector value has no NaN elements. Return false if a value
/// could ever be NaN.
- bool isKnownNeverNaN(const Value *V);
+ bool isKnownNeverNaN(const Value *V, const TargetLibraryInfo *TLI,
+ unsigned Depth = 0);
/// Return true if we can prove that the specified FP value's sign bit is 0.
///
@@ -276,6 +283,22 @@
/// pointer, return 'len+1'. If we can't, return 0.
uint64_t GetStringLength(const Value *V, unsigned CharSize = 8);
+ /// This function returns call pointer argument that is considered the same by
+ /// aliasing rules. You CAN'T use it to replace one value with another.
+ const Value *getArgumentAliasingToReturnedPointer(ImmutableCallSite CS);
+ inline Value *getArgumentAliasingToReturnedPointer(CallSite CS) {
+ return const_cast<Value *>(
+ getArgumentAliasingToReturnedPointer(ImmutableCallSite(CS)));
+ }
+
+ // {launder,strip}.invariant.group returns pointer that aliases its argument,
+ // and it only captures pointer by returning it.
+ // These intrinsics are not marked as nocapture, because returning is
+ // considered as capture. The arguments are not marked as returned neither,
+ // because it would make it useless.
+ bool isIntrinsicReturningPointerAliasingArgumentWithoutCapturing(
+ ImmutableCallSite CS);
+
/// This method strips off any GEP address adjustments and pointer casts from
/// the specified value, returning the original object being addressed. Note
/// that the returned value has pointer type if the specified value does. If
@@ -288,7 +311,7 @@
return GetUnderlyingObject(const_cast<Value *>(V), DL, MaxLookup);
}
- /// \brief This method is similar to GetUnderlyingObject except that it can
+ /// This method is similar to GetUnderlyingObject except that it can
/// look through phi and select instructions and return multiple objects.
///
/// If LoopInfo is passed, loop phis are further analyzed. If a pointer
@@ -384,6 +407,11 @@
AssumptionCache *AC,
const Instruction *CxtI,
const DominatorTree *DT);
+ OverflowResult computeOverflowForSignedMul(const Value *LHS, const Value *RHS,
+ const DataLayout &DL,
+ AssumptionCache *AC,
+ const Instruction *CxtI,
+ const DominatorTree *DT);
OverflowResult computeOverflowForUnsignedAdd(const Value *LHS,
const Value *RHS,
const DataLayout &DL,
@@ -401,6 +429,16 @@
AssumptionCache *AC = nullptr,
const Instruction *CxtI = nullptr,
const DominatorTree *DT = nullptr);
+ OverflowResult computeOverflowForUnsignedSub(const Value *LHS, const Value *RHS,
+ const DataLayout &DL,
+ AssumptionCache *AC,
+ const Instruction *CxtI,
+ const DominatorTree *DT);
+ OverflowResult computeOverflowForSignedSub(const Value *LHS, const Value *RHS,
+ const DataLayout &DL,
+ AssumptionCache *AC,
+ const Instruction *CxtI,
+ const DominatorTree *DT);
/// Returns true if the arithmetic part of the \p II 's result is
/// used only along the paths control dependent on the computation
@@ -427,7 +465,7 @@
/// This is equivelent to saying that all instructions within the basic block
/// are guaranteed to transfer execution to their successor within the basic
/// block. This has the same assumptions w.r.t. undefined behavior as the
- /// instruction variant of this function.
+ /// instruction variant of this function.
bool isGuaranteedToTransferExecutionToSuccessor(const BasicBlock *BB);
/// Return true if this function can prove that the instruction I
@@ -461,7 +499,7 @@
/// the parent of I.
bool programUndefinedIfFullPoison(const Instruction *PoisonI);
- /// \brief Specific patterns of select instructions we can match.
+ /// Specific patterns of select instructions we can match.
enum SelectPatternFlavor {
SPF_UNKNOWN = 0,
SPF_SMIN, /// Signed minimum
@@ -474,7 +512,7 @@
SPF_NABS /// Negated absolute value
};
- /// \brief Behavior when a floating point min/max is given one NaN and one
+ /// Behavior when a floating point min/max is given one NaN and one
/// non-NaN as input.
enum SelectPatternNaNBehavior {
SPNB_NA = 0, /// NaN behavior not applicable.
@@ -502,6 +540,9 @@
/// Pattern match integer [SU]MIN, [SU]MAX and ABS idioms, returning the kind
/// and providing the out parameter results if we successfully match.
///
+ /// For ABS/NABS, LHS will be set to the input to the abs idiom. RHS will be
+ /// the negation instruction from the idiom.
+ ///
/// If CastOp is not nullptr, also match MIN/MAX idioms where the type does
/// not match that of the original select. If this is the case, the cast
/// operation (one of Trunc,SExt,Zext) that must be done to transform the