JIT: only tail recursive calls become loops (dotnet/coreclr#27079)
authorAndy Ayers <andya@microsoft.com>
Thu, 10 Oct 2019 06:46:23 +0000 (23:46 -0700)
committerGitHub <noreply@github.com>
Thu, 10 Oct 2019 06:46:23 +0000 (23:46 -0700)
commit09311b1ea13ae5eb16389e03008e3e436cdd2f4d
treea8832560ec2dad32726db63da152d18c5dbffdaf
parentb7b419f9c1c22f5d6eb4a5bf4db2769208728b2c
JIT: only tail recursive calls become loops (dotnet/coreclr#27079)

Importer was a bit too liberal marking recursive calls as loop-inducing, at
least from the standpoint of enforcing backward-branch constraints. This would
sometimes lead us to inline into cold paths like throws. Only tail-recursive
calls will turn into loops.

Also, future-proof the propagation of simple loopness the root compiler, in
case we ever decide to enable inlining at Tier0.

Commit migrated from https://github.com/dotnet/coreclr/commit/6b13065e7ac88671795a01577e017ff7cdc26f35
src/coreclr/src/jit/compiler.cpp
src/coreclr/src/jit/compiler.h
src/coreclr/src/jit/flowgraph.cpp
src/coreclr/src/jit/importer.cpp