Change the SSA def node to ASG (dotnet/coreclr#27445)
authormikedn <onemihaid@hotmail.com>
Thu, 7 Nov 2019 01:10:47 +0000 (03:10 +0200)
committerAndy Ayers <andya@microsoft.com>
Thu, 7 Nov 2019 01:10:47 +0000 (17:10 -0800)
commit140051510f880f60a0b1dfa9e63a18836112c9df
tree9ba9b86ec8715d054bfef26efffa61155aa44b26
parent9bd0a96a71eae21609ae78652ba0623b09d77d5d
Change the SSA def node to ASG (dotnet/coreclr#27445)

SSA defs used to point at LHS of GT_ASG. Many clients immediately needed to walk up the tree to the parent to find the GT_ASG. So revise the SSA def to just be the GT_ASG.

Also, reject non-LCL_VAR definitions in RangeCheck. This matches the previous behavior that rejected LHS nodes that weren't the direct descendant of the ASG node - basically cases like ASG(IND(ADDR(LCL_VAR)), x). RangeCheck doesn't have the ability to follow such definitions.

This also happens to reject LCL_FLD nodes as LHS. The machinery required to follow definition chains involving struct copies and field access is quite a bit more complicated and RangeCheck certainly doesn't have it.

Commit migrated from https://github.com/dotnet/coreclr/commit/1b12053ffffc36ad73ad83f7ce111c891c4cf457
src/coreclr/src/jit/compiler.h
src/coreclr/src/jit/earlyprop.cpp
src/coreclr/src/jit/optcse.cpp
src/coreclr/src/jit/optimizer.cpp
src/coreclr/src/jit/rangecheck.cpp
src/coreclr/src/jit/rangecheck.h
src/coreclr/src/jit/ssabuilder.cpp
src/coreclr/src/jit/ssabuilder.h
src/coreclr/src/jit/valuenum.cpp