Delete impCheckForNullPointer (#61576)
authorSingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
Mon, 15 Nov 2021 22:42:51 +0000 (01:42 +0300)
committerGitHub <noreply@github.com>
Mon, 15 Nov 2021 22:42:51 +0000 (14:42 -0800)
commit2e97ac49fa77643c535b960476e24233e8d4685f
treeb8b54a367c15b4249dbc69a77639fdb5f08bd9a1
parent5d3e70a47d137c159f161a2b9fd44866cebfb467
Delete impCheckForNullPointer (#61576)

The comment above the method mentions "many problems" with leaving
null pointers around, but it is unclear what kind of problems. I can
only speculate those were the problems in legacy codegen which "could
not handle constant op1".

It also mentions that "we cannot even fold (null+offset)", which is
incorrect: "gtFoldExprConst" does in fact fold such expressions to
zero byrefs. It is also the case that spilling the null into a local
affects little as local assertion propagation happily propagates the
null back into its original place.

There was also a little bug associated with the method that got fixed:
morph was trying to use it, and in the process created uses of a local
that was not initialized, since the statement list used by the method
is the importer's one, invalid in morph.
src/coreclr/jit/compiler.h
src/coreclr/jit/compiler.hpp
src/coreclr/jit/importer.cpp
src/coreclr/jit/morph.cpp