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

[mono] Don't inline methods with the DoesNotReturn attribute in interp #99550

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/mono/mono/mini/interp/transform.c
Original file line number Diff line number Diff line change
Expand Up @@ -2867,6 +2867,14 @@ interp_method_check_inlining (TransformData *td, MonoMethod *method, MonoMethodS
if (td->prof_coverage)
return FALSE;

/*
* doesnotreturn methods are not profitable to inline, since they almost certainly will not
* actually run during normal execution, and if they do they will only run once, so the
* upside to inlining them is effectively zero, and we'd waste time doing the inline
*/
if (has_doesnotreturn_attribute (method))
return FALSE;

if (!is_metadata_update_disabled () && mono_metadata_update_no_inline (td->method, method))
return FALSE;

Expand Down
Loading