Inline refactoring: revise candidacy determination
authorAndy Ayers <andya@microsoft.com>
Mon, 7 Mar 2016 20:23:09 +0000 (12:23 -0800)
committerAndy Ayers <andya@microsoft.com>
Mon, 7 Mar 2016 21:29:27 +0000 (13:29 -0800)
commite1e65bc82d8957b2dfc9b1e387c16778969e4a40
tree19b043c9bf03b96834ecefa1e89be77b01d53402
parent687503961b49193ffc53f38716a1469e777241d7
Inline refactoring: revise candidacy determination

Rework the code to determine the key aspects of candidacy up front
rather than figuring it out eventually. In particular this ensures
that the two stages of evaulation for inlines both start at the same
point for candidates.

This will help streamline subsequent work to move the state machine
into the policy, since the state machine is only needed for the
case where the candidate is a discretionary inline, and the policy
now tracks this directly.

For the `LegacyPolicy`, if an inline is both smaller than the always
inline size and marked force inline, attribute its inlining to its
small size.

Remove bulk of the of the "evaluation in progress" candidate
observations since they don't add much value. As a result `noteCandidate`
is not needed as an external API, and can be repurposed internally as
`setCandidate`.

Change how the prejit root case is tracked to make it explicit
from the context rather than a callback to the compiler.

Commit migrated from https://github.com/dotnet/coreclr/commit/96783862204ea1dd91e55ef4c44179535ff68514
src/coreclr/src/jit/compiler.cpp
src/coreclr/src/jit/flowgraph.cpp
src/coreclr/src/jit/importer.cpp
src/coreclr/src/jit/inline.cpp
src/coreclr/src/jit/inline.def
src/coreclr/src/jit/inline.h
src/coreclr/src/jit/inlinepolicy.cpp
src/coreclr/src/jit/inlinepolicy.h