Update prebuilt Clang to r416183b from Android.
https://android.googlesource.com/platform/prebuilts/clang/host/
linux-x86/+/06a71ddac05c22edb2d10b590e1769b3f8619bef
clang 12.0.5 (based on r416183b) from build 7284624.
Change-Id: I277a316abcf47307562d8b748b84870f31a72866
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/linux-x64/clang/include/llvm/IR/Constant.h b/linux-x64/clang/include/llvm/IR/Constant.h
index 9315766..0190aca 100644
--- a/linux-x64/clang/include/llvm/IR/Constant.h
+++ b/linux-x64/clang/include/llvm/IR/Constant.h
@@ -43,6 +43,8 @@
Constant(Type *ty, ValueTy vty, Use *Ops, unsigned NumOps)
: User(ty, vty, Ops, NumOps) {}
+ ~Constant() = default;
+
public:
void operator=(const Constant &) = delete;
Constant(const Constant &) = delete;
@@ -53,6 +55,10 @@
/// Returns true if the value is one.
bool isOneValue() const;
+ /// Return true if the value is not the one value, or,
+ /// for vectors, does not contain one value elements.
+ bool isNotOneValue() const;
+
/// Return true if this is the value that would be returned by
/// getAllOnesValue.
bool isAllOnesValue() const;
@@ -64,18 +70,21 @@
/// Return true if the value is negative zero or null value.
bool isZeroValue() const;
- /// Return true if the value is not the smallest signed value.
+ /// Return true if the value is not the smallest signed value, or,
+ /// for vectors, does not contain smallest signed value elements.
bool isNotMinSignedValue() const;
/// Return true if the value is the smallest signed value.
bool isMinSignedValue() const;
/// Return true if this is a finite and non-zero floating-point scalar
- /// constant or a vector constant with all finite and non-zero elements.
+ /// constant or a fixed width vector constant with all finite and non-zero
+ /// elements.
bool isFiniteNonZeroFP() const;
- /// Return true if this is a normal (as opposed to denormal) floating-point
- /// scalar constant or a vector constant with all normal elements.
+ /// Return true if this is a normal (as opposed to denormal, infinity, nan,
+ /// or zero) floating-point scalar constant or a vector constant with all
+ /// normal elements. See APFloat::isNormal.
bool isNormalFP() const;
/// Return true if this scalar has an exact multiplicative inverse or this
@@ -86,12 +95,24 @@
/// floating-point constant with all NaN elements.
bool isNaN() const;
- /// Return true if this is a vector constant that includes any undefined
- /// elements.
- bool containsUndefElement() const;
+ /// Return true if this constant and a constant 'Y' are element-wise equal.
+ /// This is identical to just comparing the pointers, with the exception that
+ /// for vectors, if only one of the constants has an `undef` element in some
+ /// lane, the constants still match.
+ bool isElementWiseEqual(Value *Y) const;
- /// Return true if this is a vector constant that includes any constant
- /// expressions.
+ /// Return true if this is a vector constant that includes any undef or
+ /// poison elements. Since it is impossible to inspect a scalable vector
+ /// element- wise at compile time, this function returns true only if the
+ /// entire vector is undef or poison.
+ bool containsUndefOrPoisonElement() const;
+
+ /// Return true if this is a vector constant that includes any poison
+ /// elements.
+ bool containsPoisonElement() const;
+
+ /// Return true if this is a fixed width vector constant that includes
+ /// any constant expressions.
bool containsConstantExpression() const;
/// Return true if evaluation of this constant could trap. This is true for
@@ -122,9 +143,10 @@
Constant *getAggregateElement(unsigned Elt) const;
Constant *getAggregateElement(Constant *Elt) const;
- /// If this is a splat vector constant, meaning that all of the elements have
- /// the same value, return that value. Otherwise return 0.
- Constant *getSplatValue() const;
+ /// If all elements of the vector constant have the same value, return that
+ /// value. Otherwise, return nullptr. Ignore undefined elements by setting
+ /// AllowUndefs to true.
+ Constant *getSplatValue(bool AllowUndefs = false) const;
/// If C is a constant integer then return its value, otherwise C must be a
/// vector of constant integers, all equal, and the common value is returned.
@@ -182,6 +204,16 @@
return const_cast<Constant*>(
static_cast<const Constant *>(this)->stripPointerCasts());
}
+
+ /// Try to replace undefined constant C or undefined elements in C with
+ /// Replacement. If no changes are made, the constant C is returned.
+ static Constant *replaceUndefsWith(Constant *C, Constant *Replacement);
+
+ /// Merges undefs of a Constant with another Constant, along with the
+ /// undefs already present. Other doesn't have to be the same type as C, but
+ /// both must either be scalars or vectors with the same element count. If no
+ /// changes are made, the constant C is returned.
+ static Constant *mergeUndefsWith(Constant *C, Constant *Other);
};
} // end namespace llvm