Skip to content

Commit a8181bc

Browse files
Fix the pre/post increment bug.
1 parent e1bedbf commit a8181bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Scalar/GVNSink.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,10 +535,10 @@ class ValueTable {
535535
uint32_t e = ExpressionNumbering[exp];
536536
if (!e) {
537537
hash_code H = exp->getHashValue([=](Value *V) { return lookupOrAdd(V); });
538-
auto [I, Inserted] = HashNumbering.try_emplace(H, nextValueNumber + 1);
538+
auto [I, Inserted] = HashNumbering.try_emplace(H, nextValueNumber);
539539
e = I->second;
540540
if (Inserted)
541-
ExpressionNumbering[exp] = ++nextValueNumber;
541+
ExpressionNumbering[exp] = nextValueNumber++;
542542
}
543543
ValueNumbering[V] = e;
544544
return e;

0 commit comments

Comments
 (0)