Remove GTF_ADDR_ONSTACK and IsVarAddr.
authorEugene Rozenfeld <erozen@microsoft.com>
Tue, 29 Jan 2019 19:26:49 +0000 (11:26 -0800)
committerEugene Rozenfeld <erozen@microsoft.com>
Wed, 30 Jan 2019 22:10:49 +0000 (14:10 -0800)
commitb17d6e66e87c4d41ca9c2af2db0a68d0124e6781
treec84e965b65a36fc5b24f9566500d29b8a5bcbd7d
parentd4aaf6434fc67820739c226e622a533a898fcc7b
Remove GTF_ADDR_ONSTACK and IsVarAddr.

IsVarAddr was checking GTF_ADDR_ONSTACK  to determine if
the GT_ADDR node is an address of a local. This change removes both
GTF_ADDR_ONSTACK and  IsVarAddr and uses IsLocalAdrExpr instead.
IsLocalAddrExpr uses opcodes to determine if GT_ADDR node is
a local address.

GTF_ADDR_ONSTACK flag is ancient, added before 2002 so I couldn't find
the checkin that introduced it.

I changed the assert to a check and an assignment since simplifications
inside fgMorphArgs between
https://github.com/dotnet/coreclr/blob/dotnet/coreclr@1a1e4c4d5a8030cb8d82a2e5b06c2ab357b92534/src/jit/morph.cpp#L3709
(which causes https://github.com/dotnet/coreclr/blob/dotnet/coreclr@1a1e4c4d5a8030cb8d82a2e5b06c2ab357b92534/src/jit/morph.cpp#L3057)
and
https://github.com/dotnet/coreclr/blob/dotnet/coreclr@1a1e4c4d5a8030cb8d82a2e5b06c2ab357b92534/src/jit/morph.cpp#L3790
may result in more GT_ADDR nodes recognized by IsLocalAdrExpr.

x86 and x64 pmi frameworks had no code diffs and some gcinfo reductions
(15 methods with gcinfo diffs in x86).

Fixes dotnet/coreclr#22190.

Commit migrated from https://github.com/dotnet/coreclr/commit/4070994640bcc2c4c138b6f695d3fce14ea3efe7
src/coreclr/src/jit/codegenarmarch.cpp
src/coreclr/src/jit/codegenxarch.cpp
src/coreclr/src/jit/compiler.cpp
src/coreclr/src/jit/compiler.hpp
src/coreclr/src/jit/gentree.cpp
src/coreclr/src/jit/gentree.h
src/coreclr/src/jit/importer.cpp
src/coreclr/src/jit/morph.cpp