diff options
author | Andy Ayers <andya@microsoft.com> | 2016-02-23 15:21:22 -0800 |
---|---|---|
committer | Andy Ayers <andya@microsoft.com> | 2016-02-25 09:42:40 -0800 |
commit | 99927794a53ed68b1a55ddba238eff809be79fdc (patch) | |
tree | 6e61cc8fe0a9a2d36d050884af247cf3488e17f2 /src/jit/jit.settings.targets | |
parent | 7a6d8a44c0a2f8d3f431c58aa77b95f15f212756 (diff) | |
download | coreclr-99927794a53ed68b1a55ddba238eff809be79fdc.tar.gz coreclr-99927794a53ed68b1a55ddba238eff809be79fdc.tar.bz2 coreclr-99927794a53ed68b1a55ddba238eff809be79fdc.zip |
Inline Refactoring: set up policy for bad inlinees
Move inline policies to their own header and cpp file.
Add a method to the policy class to indicate if the policy wants newly
discovered `Never` inline cases to change the callee method attributes
to Noinline. This is an existing optimization that saves time when the
jit sees calls to this callee elsewhere as a possible inline candidates.
For example, in the trace below, at for the call at offset 31, the jit
determines that `ToInt32` is too large to be inlined and so marks it as
noinline. Then when it sees another call to `ToInt31` at offset 44 it
immediately fails the inline attempt.
```
Inlines into RegistryTimeZoneInformation:.ctor(ref):this
...
[IL=0031 TR=000040] [FAILED: too many il bytes] System.BitConverter:ToInt32(ref,int):int
[IL=0044 TR=000049] [FAILED: noinline per IL/cached result] System.BitConverter:ToInt32(ref,int):int
[IL=0057 TR=000058] [FAILED: noinline per IL/cached result] System.BitConverter:ToInt32(ref,int):int
```
Diagnostic and experimental policies may choose to disable this
optimization to make it easier to locally reason about failed inlines.
There were 5 calls to `setMethodAttribs` passing `CORINFO_FLG_BAD_INLINEE`.
This change consolidates 4 of them into the inlining code. The remaining
call is for a method with verification errors. I've left it as is.
Diffstat (limited to 'src/jit/jit.settings.targets')
-rw-r--r-- | src/jit/jit.settings.targets | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/jit/jit.settings.targets b/src/jit/jit.settings.targets index 0f3e9e4deb..a0347da0a0 100644 --- a/src/jit/jit.settings.targets +++ b/src/jit/jit.settings.targets @@ -81,6 +81,7 @@ <CppCompile Include="..\RangeCheck.cpp" /> <CppCompile Include="..\LoopCloning.cpp" /> <CppCompile Include="..\inline.cpp" /> + <CppCompile Include="..\inlinepolicy.cpp" /> <CppCompile Include="..\jitconfig.cpp" /> <CppCompile Condition="'$(ClDefines.Contains(`LEGACY_BACKEND`))'=='True'" Include="..\CodeGenLegacy.cpp" /> <CppCompile Condition="'$(ClDefines.Contains(`LEGACY_BACKEND`))'=='False'" Include="..\Lower.cpp" /> |