Update prebuilt Clang to r365631c1 from Android.
The version we had was segfaulting.
Bug: 132420445
Change-Id: Icb45a6fe0b4e2166f7895e669df1157cec9fb4e0
diff --git a/linux-x64/clang/include/llvm/Support/KnownBits.h b/linux-x64/clang/include/llvm/Support/KnownBits.h
index 8983a06..07fd94e 100644
--- a/linux-x64/clang/include/llvm/Support/KnownBits.h
+++ b/linux-x64/clang/include/llvm/Support/KnownBits.h
@@ -109,25 +109,36 @@
/// Truncate the underlying known Zero and One bits. This is equivalent
/// to truncating the value we're tracking.
- KnownBits trunc(unsigned BitWidth) {
+ KnownBits trunc(unsigned BitWidth) const {
return KnownBits(Zero.trunc(BitWidth), One.trunc(BitWidth));
}
- /// Zero extends the underlying known Zero and One bits. This is equivalent
- /// to zero extending the value we're tracking.
- KnownBits zext(unsigned BitWidth) {
- return KnownBits(Zero.zext(BitWidth), One.zext(BitWidth));
+ /// Extends the underlying known Zero and One bits.
+ /// By setting ExtendedBitsAreKnownZero=true this will be equivalent to
+ /// zero extending the value we're tracking.
+ /// With ExtendedBitsAreKnownZero=false the extended bits are set to unknown.
+ KnownBits zext(unsigned BitWidth, bool ExtendedBitsAreKnownZero) const {
+ unsigned OldBitWidth = getBitWidth();
+ APInt NewZero = Zero.zext(BitWidth);
+ if (ExtendedBitsAreKnownZero)
+ NewZero.setBitsFrom(OldBitWidth);
+ return KnownBits(NewZero, One.zext(BitWidth));
}
/// Sign extends the underlying known Zero and One bits. This is equivalent
/// to sign extending the value we're tracking.
- KnownBits sext(unsigned BitWidth) {
+ KnownBits sext(unsigned BitWidth) const {
return KnownBits(Zero.sext(BitWidth), One.sext(BitWidth));
}
- /// Zero extends or truncates the underlying known Zero and One bits. This is
- /// equivalent to zero extending or truncating the value we're tracking.
- KnownBits zextOrTrunc(unsigned BitWidth) {
+ /// Extends or truncates the underlying known Zero and One bits. When
+ /// extending the extended bits can either be set as known zero (if
+ /// ExtendedBitsAreKnownZero=true) or as unknown (if
+ /// ExtendedBitsAreKnownZero=false).
+ KnownBits zextOrTrunc(unsigned BitWidth,
+ bool ExtendedBitsAreKnownZero) const {
+ if (BitWidth > getBitWidth())
+ return zext(BitWidth, ExtendedBitsAreKnownZero);
return KnownBits(Zero.zextOrTrunc(BitWidth), One.zextOrTrunc(BitWidth));
}
@@ -191,6 +202,10 @@
return getBitWidth() - Zero.countPopulation();
}
+ /// Compute known bits resulting from adding LHS, RHS and a 1-bit Carry.
+ static KnownBits computeForAddCarry(
+ const KnownBits &LHS, const KnownBits &RHS, const KnownBits &Carry);
+
/// Compute known bits resulting from adding LHS and RHS.
static KnownBits computeForAddSub(bool Add, bool NSW, const KnownBits &LHS,
KnownBits RHS);