forked from OSchip/llvm-project
[NewGVN] Strengthen a couple of assertions.
StoreCount >= 0 on `unsigned` is always true, otherwise. llvm-svn: 291709
This commit is contained in:
parent
991c2e0e57
commit
6e919df2f5
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue