[llvm] [KnownBits] Make nuw and nsw support in computeForAddSub optimal (PR #83382)
    Simon Pilgrim via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Sat Mar  2 05:41:44 PST 2024
    
    
  
================
@@ -62,6 +62,11 @@ struct KnownBits {
   /// Returns true if we don't know any bits.
   bool isUnknown() const { return Zero.isZero() && One.isZero(); }
 
+  /// Returns true if we don't know the sign bit.
+  bool isSignUnknown() const {
+    return !Zero.isSignBitSet() && !One.isSignBitSet();
+  }
----------------
RKSimon wrote:
Add unit-test coverage?
https://github.com/llvm/llvm-project/pull/83382
    
    
More information about the llvm-commits
mailing list