JIT: Avoid unnecessary GTF_GLOB_REFs (#84349)
authorJakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Fri, 7 Apr 2023 19:05:26 +0000 (21:05 +0200)
committerGitHub <noreply@github.com>
Fri, 7 Apr 2023 19:05:26 +0000 (21:05 +0200)
commit15c7022dfd0424e97d42d0dee9015bfd0d2a5fbd
treea31684639e1f247132fce5883a09fed391e2a54c
parent092f752ed994f807f7081447d5a38367b1e583fc
JIT: Avoid unnecessary GTF_GLOB_REFs (#84349)

* Avoid setting GTF_GLOB_REF on GT_FIELD_ADDR nodes
* Avoid setting GTF_GLOB_REF on GT_FIELD nodes off of implicit byrefs.
  This is ok now since implicit byref morphing indiscriminately sets
  GTF_GLOB_REF for these.
* Manually clone a "pointer to span" in span intrinsic expansion when it points to a local. Unfortunately this does not fall out from the above since gtClone does not handle FIELD_ADDR, and making it handle this needs some more work.

These changes are necessary to avoid address exposure in the two user
benchmarks in #83388.

Fix #74563
Fix #856
src/coreclr/jit/gentree.cpp
src/coreclr/jit/importer.cpp
src/coreclr/jit/importercalls.cpp