diff options
author | Andy Ayers <andya@microsoft.com> | 2017-11-01 15:17:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-01 15:17:40 -0700 |
commit | 0ea9d2e189ea1b4f069204d3f57645067ceb0d38 (patch) | |
tree | d9074b7b49560d5a9fe8fcae606fb0e19563d731 /src/jit/inlinepolicy.cpp | |
parent | c80085a9271d5bc234cafeb14e89fdade3de4247 (diff) | |
download | coreclr-0ea9d2e189ea1b4f069204d3f57645067ceb0d38.tar.gz coreclr-0ea9d2e189ea1b4f069204d3f57645067ceb0d38.tar.bz2 coreclr-0ea9d2e189ea1b4f069204d3f57645067ceb0d38.zip |
JIT: convert fixed-sized locallocs to locals, enable inlining (#14623)
Optimize fixed sized locallocs of 32 bytes or less to use local buffers,
if the localloc is not in a loop.
Also "optimize" the degenerate 0 byte case.
Allow inline candidates containing localloc, but fail inlining if any
of a candidate's locallocs do not convert to local buffers.
The 32 byte size threshold was arrived at empirically; larger values did
not enable many more cases and started seeinge size bloat because of
larger stack offsets.
We can revise this threshold if we are willing to reorder locals and see
fixed sized cases larger than 32 bytes.
Closes #8542.
Also add missing handler for the callsite is in try region, this was
an oversight.
Diffstat (limited to 'src/jit/inlinepolicy.cpp')
-rw-r--r-- | src/jit/inlinepolicy.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/jit/inlinepolicy.cpp b/src/jit/inlinepolicy.cpp index 61e70c3ed4..a4f51c9ee9 100644 --- a/src/jit/inlinepolicy.cpp +++ b/src/jit/inlinepolicy.cpp @@ -384,11 +384,20 @@ void LegacyPolicy::NoteBool(InlineObservation obs, bool value) } case InlineObservation::CALLEE_HAS_PINNED_LOCALS: + case InlineObservation::CALLEE_HAS_LOCALLOC: // The legacy policy is to never inline methods with - // pinned locals. + // pinned locals or localloc. SetNever(obs); break; + case InlineObservation::CALLSITE_IN_TRY_REGION: + m_CallsiteIsInTryRegion = true; + break; + + case InlineObservation::CALLSITE_IN_LOOP: + m_CallsiteIsInLoop = true; + break; + default: // Ignore the remainder for now break; @@ -900,6 +909,11 @@ void EnhancedLegacyPolicy::NoteBool(InlineObservation obs, bool value) } break; + case InlineObservation::CALLEE_HAS_LOCALLOC: + // We see this during the IL prescan. Ignore for now, we will + // bail out, if necessary, during importation + break; + default: // Pass all other information to the legacy policy LegacyPolicy::NoteBool(obs, value); |