Skip to content

Commit d9a5789

Browse files
Update hash of the new CSE when resizing (#61984)
The CSE logic maintains a custom hashtable implementation. It triggers a resize at the same time as adding a new CSE, but forgets the hash of the new CSE needs to be updated from its pre-resize value. Failing to do so can lead to losing some CSEs, though not in a correctness-impacting way.
1 parent a4cab7d commit d9a5789

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/coreclr/jit/optcse.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,7 @@ unsigned Compiler::optValnumCSE_Index(GenTree* tree, Statement* stmt)
655655
}
656656
}
657657

658+
hval = optCSEKeyToHashIndex(key, newOptCSEhashSize);
658659
optCSEhash = newOptCSEhash;
659660
optCSEhashSize = newOptCSEhashSize;
660661
optCSEhashMaxCountBeforeResize = optCSEhashMaxCountBeforeResize * s_optCSEhashGrowthFactor;

0 commit comments

Comments
 (0)