From: Aaron Ballman Date: Thu, 15 Oct 2015 13:55:43 +0000 (+0000) Subject: Silencing a -Wtype-limits warning; an unsigned value will always be >= 0; NFC. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ae7c0e87c26d6be3415bec1bd8ace83a816f3c31;p=oota-llvm.git Silencing a -Wtype-limits warning; an unsigned value will always be >= 0; NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250404 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp index d2a1f8737cd..e83a5793bf3 100644 --- a/lib/Analysis/ValueTracking.cpp +++ b/lib/Analysis/ValueTracking.cpp @@ -1382,7 +1382,7 @@ static void computeKnownBitsFromOperator(Operator *I, APInt &KnownZero, unsigned BitsPossiblySet = BitWidth - KnownZero2.countPopulation(); unsigned LeadingZeros = APInt(BitWidth, BitsPossiblySet).countLeadingZeros(); - assert(LeadingZeros >= 0 && LeadingZeros <= BitWidth); + assert(LeadingZeros <= BitWidth); KnownZero |= APInt::getHighBitsSet(BitWidth, LeadingZeros); KnownOne &= ~KnownZero; // TODO: we could bound KnownOne using the lower bound on the number