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)
commit2efa50a403e13a4cea4c38b6c8d6463f2cb06f87
tree677ec1ab4a4079e58f170efd6c36846329d2af74
parent9983a8447eb57057d8a83341cb58db46080569de
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 dotnet/coreclr#10858.

Commit migrated from https://github.com/dotnet/coreclr/commit/a9044a132b4807695d386181cf55bb952826e350
src/coreclr/src/jit/importer.cpp
src/coreclr/tests/src/JIT/opt/Devirtualization/GitHub_10858.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/opt/Devirtualization/GitHub_10858.csproj [new file with mode: 0644]