JIT: streamline temp usage for returns (dotnet/coreclr#20640)
authorAndy Ayers <andya@microsoft.com>
Mon, 29 Oct 2018 23:11:53 +0000 (16:11 -0700)
committerGitHub <noreply@github.com>
Mon, 29 Oct 2018 23:11:53 +0000 (16:11 -0700)
commit859e8b7e49eca88a01ca9d79dff890a13aa4cf6a
tree505fb78f1e59c6f89b49dd8ebb336c1930584bf5
parentf789b0a16d3a5137c95375c71bf5e88267470900
JIT: streamline temp usage for returns (dotnet/coreclr#20640)

If the jit decides it needs a return spill temp, and the return value
has already been spilled to a single-def temp, re-use the existing
for the return temp rather than creating a new one.

In conjunction with dotnet/coreclr#20553 this allows late devirtualization for calls where
the object in the virtual call is the result of an inline that provides
a better type, and the objected formerly reached the call via one or more
intermediate temps.

Closes dotnet/coreclr#15873.

Commit migrated from https://github.com/dotnet/coreclr/commit/ccc18a6352c7a6232606131424c0377ea3529991
src/coreclr/src/jit/flowgraph.cpp
src/coreclr/src/jit/importer.cpp
src/coreclr/src/jit/inline.h
src/coreclr/tests/src/JIT/opt/Devirtualization/arraypool.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/opt/Devirtualization/arraypool.csproj [new file with mode: 0644]
src/coreclr/tests/src/JIT/opt/Devirtualization/late1.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/opt/Devirtualization/late1.csproj [new file with mode: 0644]