Jit: fix issue with single-def type propagation
authorAndy Ayers <andya@microsoft.com>
Mon, 10 Apr 2017 19:05:49 +0000 (12:05 -0700)
committerAndy Ayers <andya@microsoft.com>
Mon, 10 Apr 2017 19:13:16 +0000 (12:13 -0700)
commita9044a132b4807695d386181cf55bb952826e350
tree07d51ff4af1866194c3d096ff2895ccb4ee6293d
parent9cfc763700e38ce47242ad66657ba3210451df78
Jit: fix issue with single-def type propagation

To avoid overly aggressive type propagation when there are multiple
reaching definitions, only propagate types to single-IL-def locals
when the definiting value comes from the same basic block as the store.
We check this conservatively by insisting that the block's entry stack
be empty.

Added a test case where the jit will improperly devirtualize without
such a check.

Closes #10858.
src/jit/importer.cpp
tests/src/JIT/opt/Devirtualization/GitHub_10858.cs [new file with mode: 0644]
tests/src/JIT/opt/Devirtualization/GitHub_10858.csproj [new file with mode: 0644]