Jit: fix for broken type equality optimization
authorAndy Ayers <andya@microsoft.com>
Mon, 13 Feb 2017 19:05:02 +0000 (11:05 -0800)
committerAndy Ayers <andya@microsoft.com>
Mon, 13 Feb 2017 20:22:26 +0000 (12:22 -0800)
commit25defd7020e67c4bd91bfd6f3cc64b251cc49711
tree88120bcbfcef576f7ddea33b99af1a583581eadd
parent40f9ed964c195e11010f7dc0aeddc1407135b374
Jit: fix for broken type equality optimization

The jit relies on a particular tree remaining intact during importation
to optimize type equality tests commonly found in generics.

In dotnet/coreclr#7909 the jit started aggressively spilling the evaluation stack before
calls, which broke up the trees needed for the optimizations.

In the special cases pertaining to type tests the trees can safely remain
intact because we know the calls can't interact with the computations on
the stack. Recognize these cases and selectively suppress spilling.

Closes dotnet/coreclr#9552.

Commit migrated from https://github.com/dotnet/coreclr/commit/a26e2c670fc7a793794f4a499212a115c5d5a4b3
src/coreclr/src/jit/importer.cpp