Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[interp] Inline more AggressiveInlining methods #48513

Merged
merged 2 commits into from
Feb 22, 2021

Conversation

BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented Feb 19, 2021

By default, the interpreter stops inlining when encountering a call that it cannot inline or a throw. Inline the method anyway if the aggressive inlining attribute is present.

@ghost
Copy link

ghost commented Feb 19, 2021

Tagging subscribers to this area: @BrzVlad
See info in area-owners.md if you want to be subscribed.

Issue Details

By default, the interpreter stops inlining when encountering a call that it cannot inline or a throw. Inline the method anyway if the aggressive inlining attribute is present.

Author: BrzVlad
Assignees: -
Labels:

area-Codegen-Interpreter-mono

Milestone: -

@BrzVlad
Copy link
Member Author

BrzVlad commented Feb 19, 2021

Aids with methods like https://github.com/dotnet/runtime/blob/master/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs#L839, which the interpreter wouldn't inline, even though the code for the method would be just :

IR_0000: ceq.i4         [16 <- 0 8],
IR_0004: ret            [nil <- 16],

This makes Vector<int>.Equals twice as fast.

Contributes to #47520

@@ -5453,7 +5456,8 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header,
// Inlining failed. Set the method to be executed as part of newobj instruction
newobj_fast->data [0] = get_data_item_index (td, mono_interp_get_imethod (domain, m, error));
/* The constructor was not inlined, abort inlining of current method */
INLINE_FAILURE;
if (inlining && !td->aggressive_inlining)
goto exit;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want
if (....)
INLINE_FAILURE;

By default, the interpreter stops inlining when encountering a call that it cannot inline or a throw. Inline the method anyway if the aggressive inlining attribute is present.
@BrzVlad BrzVlad force-pushed the feature-interp-aggressive-inline branch from 98260b2 to dacbb29 Compare February 19, 2021 19:25
@BrzVlad BrzVlad merged commit 5bc40f5 into dotnet:master Feb 22, 2021
BrzVlad added a commit to BrzVlad/mono that referenced this pull request Feb 26, 2021
BrzVlad added a commit to BrzVlad/mono that referenced this pull request Mar 15, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Mar 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants