[llvm] [KnownBits] Add KnownBits::add and KnownBits::sub helper wrappers. (PR #99468)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 03:58:32 PDT 2024


================
@@ -329,6 +329,19 @@ struct KnownBits {
   static KnownBits computeForSubBorrow(const KnownBits &LHS, KnownBits RHS,
                                        const KnownBits &Borrow);
 
+  /// Compute knownbits resulting from addition of LHS and RHS.
+  /// NSW and NUW flags are assumed to be false.
+  static KnownBits add(const KnownBits& LHS, const KnownBits& RHS) {
----------------
jayfoad wrote:

Well we already use them for `&`, `|` and `^`...

https://github.com/llvm/llvm-project/pull/99468


More information about the llvm-commits mailing list