Don't inline methods that have tail-prefixed calls.
authorEugene Rozenfeld <erozen@microsoft.com>
Thu, 18 Aug 2016 17:28:37 +0000 (10:28 -0700)
committerEugene Rozenfeld <erozen@microsoft.com>
Fri, 19 Aug 2016 22:54:08 +0000 (15:54 -0700)
commit52184be2ba019275e8a0193e14528eb03f9758ab
treeefab950cb5b842a9dbc2bcbb3c445520ec09bdb6
parent62f246cc64b2f97d6703e3ad52f134a3f67ffe90
Don't inline methods that have tail-prefixed calls.

This commit changes the inlining behavior when the callee has tail-prefixed calls.
The jit was turning tail-prefixed calls in inlinees into normal calls. That means that
in some cases tail prefix wasn't honored. I changed the code to not inline such callees.
This matches the behavior of the legacy x64 jit. A possible improvement would be to allow
inlining when the tail-prefixed calls in the inlinee could still be dispatched as tail calls from the caller.

I enabled TailcallVerifyWithPrefix set of tests. They were disabled because Condition8.Test1, Condition8.Test2,
and Condition8.Test3 used varargs calling convention. I commented out code that was calling those tests.
I didn't delete them in case CoreCLR will support varargs in the future.

I also turned on Condition21.Test1, Condition21.Test2, Condition21.Test3, Condition21.Test6, and Condition21.Test7.
Condition21.Test3 is the test that was failing because the jit was inlining calees with tail-prefixed calls.
The other Condition21 tests above were passing and just weren't called.
src/jit/flowgraph.cpp
src/jit/importer.cpp
src/jit/inline.def
tests/issues.targets
tests/src/JIT/opt/Tailcall/TailcallVerifyWithPrefix.il
tests/x86_legacy_backend_issues.targets