[Unix x64|Arm64] Correct canfastTailCall decisions
authorjashook <jashoo@microsoft.com>
Mon, 5 Jun 2017 21:48:51 +0000 (14:48 -0700)
committerjashook <jashoo@microsoft.com>
Fri, 18 Aug 2017 14:27:01 +0000 (07:27 -0700)
commit5a52738c3877c79c1ac82f401de1470a3ca360a5
tree32ab707d638f1a35140851da32d641e4ed88157c
parent88f729cbf5ff3f7306192c8434029c82e013c591
[Unix x64|Arm64] Correct canfastTailCall decisions

This will change how the fastTailCall decision is made for x64 unix and arm64.
Before this change the decision was based on the amount of incoming and outgoing
caller arguments like on Windows. This was incorrect on Unix x64 and Arm64
because one argument does not translate to one register or one stack slot use.

Before this change structs on Arm64 and Amd64 Unix could
pessimize when we could fastTailCall if they were engregisterable
and took more than one register.

This change also fixes several cases when determining to fastTailCall. It fixes
 dotnet/coreclr#12479 and will cause a no fastTailCalls decisions for case dotnet/coreclr#12468.

In addition this change adds several regression cases for dotnet/coreclr#12479 and dotnet/coreclr#12468. It
includes more logging ofr fastTailCall decisions, including a new COMPlus
variable named COMPlus_JitReportFastTailCallDecisions, which can be toggled with
COMPlus_JitReportFastTailCallDecisions=1.

Commit migrated from https://github.com/dotnet/coreclr/commit/ee95d7c5f552dcfc1b69f8ac2567c4afda40695e
14 files changed:
src/coreclr/src/jit/compiler.h
src/coreclr/src/jit/jitconfigvalues.h
src/coreclr/src/jit/lclvars.cpp
src/coreclr/src/jit/morph.cpp
src/coreclr/tests/arm/Tests.lst
src/coreclr/tests/arm64/Tests.lst
src/coreclr/tests/src/JIT/opt/FastTailCall/FastTailCallCandidates.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/opt/FastTailCall/FastTailCallCandidates.csproj [moved from src/coreclr/tests/src/JIT/opt/Tailcall/FastTailCallStackFixup.csproj with 97% similarity]
src/coreclr/tests/src/JIT/opt/FastTailCall/GitHubIssue12479.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/opt/FastTailCall/GitHubIssue12479.csproj [new file with mode: 0644]
src/coreclr/tests/src/JIT/opt/FastTailCall/StackFixup.cs [moved from src/coreclr/tests/src/JIT/opt/Tailcall/FastTailCallStackFixup.cs with 89% similarity]
src/coreclr/tests/src/JIT/opt/FastTailCall/StackFixup.csproj [new file with mode: 0644]
src/coreclr/tests/src/JIT/opt/FastTailCall/StructPassingSimple.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/opt/FastTailCall/StructPassingSimple.csproj [new file with mode: 0644]