OSDN Git Service

[KnownBits] Remove asserts from KnownBits::makeNegative/makeNonNegative
authorCraig Topper <craig.topper@intel.com>
Thu, 28 Dec 2017 19:46:14 +0000 (19:46 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 28 Dec 2017 19:46:14 +0000 (19:46 +0000)
Many of the callers don't guarantee there is no conflict before calling these and instead check for conflicts later.

The makeNegative/makeNonNegative methods replaced Known.One.setSignBit() and Known.Zero.setSignBit() calls that didn't have asserts originally. So removing the asserts is no worse than the original code.

Fixes PR35769

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321539 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/KnownBits.h

index 7a4de3e..97e73b1 100644 (file)
@@ -100,13 +100,11 @@ public:
 
   /// Make this value negative.
   void makeNegative() {
-    assert(!isNonNegative() && "Can't make a non-negative value negative");
     One.setSignBit();
   }
 
   /// Make this value negative.
   void makeNonNegative() {
-    assert(!isNegative() && "Can't make a negative value non-negative");
     Zero.setSignBit();
   }