JIT: improve simplification of IND(ADDR(x)) (#20508)
authorAndy Ayers <andya@microsoft.com>
Mon, 22 Oct 2018 20:14:57 +0000 (13:14 -0700)
committerGitHub <noreply@github.com>
Mon, 22 Oct 2018 20:14:57 +0000 (13:14 -0700)
commitc0aa74fe584a04f8c7c8e81882793a136ee074d9
tree4d9ca2079a220e47f3ec385ff0a27a76cca72027
parent961f131758e510927676e13bc2f4533b3e0cb42a
JIT: improve simplification of IND(ADDR(x)) (#20508)

Some `IND(ADDR(x))` trees were not being optimized to `x` by morph,
particularly when `x` was the promoted pointer field of a `Span`.
Instead they were creating local fields that blocked enregistration
and lead to store-load pairs like:

```asm
       mov      bword ptr [rsp+20H], rax
       mov      rax, bword ptr [rsp+20H]
```

Add logic to `fgMorphSmpOp`'s `GT_IND` clause to recognize and simplify
these cases.
src/jit/morph.cpp