JIT: invoke nullable box optimizations earlier (#32269)
authorAndy Ayers <andya@microsoft.com>
Thu, 20 Feb 2020 00:17:40 +0000 (16:17 -0800)
committerGitHub <noreply@github.com>
Thu, 20 Feb 2020 00:17:40 +0000 (16:17 -0800)
commitddf4f4b9b76342a606146b4a66fd68571c91498f
tree1fb776d3c74a2ad3dd00da7a7452adc7bb000b33
parent3be5238a376cd4bca32db1acb732dc7c15091cdf
JIT: invoke nullable box optimizations earlier (#32269)

Move the logic in `fgMorphRecognizeBoxNullable` into `gtFoldExprSpecial`
so it can be invoked earlier. This may prevent the original struct
from becoming address exposed and allow subsequent optimizations when the
`hasValue` field has a known value.

Fixes #31661.
src/coreclr/src/jit/compiler.h
src/coreclr/src/jit/gentree.cpp
src/coreclr/src/jit/morph.cpp