JIT: preliminaries to improve types (dotnet/coreclr#10172)
authorAndy Ayers <andya@microsoft.com>
Wed, 15 Mar 2017 02:45:10 +0000 (19:45 -0700)
committerGitHub <noreply@github.com>
Wed, 15 Mar 2017 02:45:10 +0000 (19:45 -0700)
commitdf5a9854b4f429a0c799a7f4616030745045b518
treeb938e82b040961704803d88c12446b04a139b288
parent5745c212f5791c42fb7884d5d14ce6ec958f17f9
JIT: preliminaries to improve types (dotnet/coreclr#10172)

Refactor the logic in `impDevirtualizeCall` so that the part that determines
the type of a tree for ref types is now a new utility method that can be called
elsewhere.

Update the utility to examine calls more closely. For inline candidates that
return shared types, try and use the context to get to the unshared version of the
type. For calls that are not inline candidates, look at the type in the signature
available to the jit w/o context.

Call the utility when we've created a temp for an inlinee's argument and the
argument is not modified in the inlinee body. If we already thought we knew the
type of the temp exactly, ensure that this new information agrees.

Rework the logic in `impDevirtualizeCall` in anticipation of interface call
devirtualization. Update the diagnostic stream to indicate the kind of call
devirtualized and the primary reason why devirtualization happened.
Avoid fetching class and method names unless they're going to be used. Likewise
try not to fetch attributes if we already have them on hand.

Commit migrated from https://github.com/dotnet/coreclr/commit/3ea5447c9b090e621aed9e20a580178e97dabf8f
src/coreclr/src/jit/compiler.h
src/coreclr/src/jit/flowgraph.cpp
src/coreclr/src/jit/gentree.cpp
src/coreclr/src/jit/importer.cpp