Refactor fgValueNumberBlockAssignment (#64110)
authorSingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
Thu, 3 Feb 2022 20:56:38 +0000 (23:56 +0300)
committerGitHub <noreply@github.com>
Thu, 3 Feb 2022 20:56:38 +0000 (21:56 +0100)
commitc85f02deec88cf57cab3cffee631a61ae2797a8f
tree5ef6fc2f32d9f86bcb5b1459e86be4e448de4185
parent9a10cec10e788a3d7c0860cbc085d289ea7bde5f
Refactor fgValueNumberBlockAssignment (#64110)

"fgValueNumberBlockAssignment" had a very interesting oddity:
it re-VNs the source tree of the assignment. This is unnecessary,
and is in fact a pessimization, as it means we will fail to VN
assignments from sources it does not understand. This change
fixes that, bringing along some positive diffs from numbering
stores from field indirections.

"fgValueNumberBlockAssignment" also needs to maintaint the
invariant that a location's VN will always match its type.
It was failing to do that in cases where the assignment's
source was not local. This change fixes that.

Finally, this change unifies the code common to numbering
"CopyBlk" and "InitBlk" cases. There is no need for them to
be different.
src/coreclr/jit/compiler.h
src/coreclr/jit/valuenum.cpp