[NewGVN] Strengthen a couple of assertions.

StoreCount >= 0 on `unsigned` is always true, otherwise.

llvm-svn: 291709
This commit is contained in:
Davide Italiano 2017-01-11 21:49:00 +00:00
parent 991c2e0e57
commit 6e919df2f5
1 changed files with 2 additions and 2 deletions

View File

@ -1063,10 +1063,10 @@ void NewGVN::moveValueToNewCongruenceClass(Value *V, CongruenceClass *OldClass,
OldClass->Members.erase(V);
NewClass->Members.insert(V);
if (isa<StoreInst>(V)) {
assert(OldClass->StoreCount > 0 && "Store count underflow detected");
--OldClass->StoreCount;
assert(OldClass->StoreCount >= 0);
assert(NewClass->StoreCount < UINT_MAX && "Store count overflow detected");
++NewClass->StoreCount;
assert(NewClass->StoreCount >= 0);
}
ValueToClass[V] = NewClass;