[llvm] r321539 - [KnownBits] Remove asserts from KnownBits::makeNegative/makeNonNegative
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 28 11:46:14 PST 2017
Author: ctopper
Date: Thu Dec 28 11:46:14 2017
New Revision: 321539
URL: http://llvm.org/viewvc/llvm-project?rev=321539&view=rev
Log:
[KnownBits] Remove asserts from KnownBits::makeNegative/makeNonNegative
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
Modified:
llvm/trunk/include/llvm/Support/KnownBits.h
Modified: llvm/trunk/include/llvm/Support/KnownBits.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/KnownBits.h?rev=321539&r1=321538&r2=321539&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/KnownBits.h (original)
+++ llvm/trunk/include/llvm/Support/KnownBits.h Thu Dec 28 11:46:14 2017
@@ -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();
}
More information about the llvm-commits
mailing list