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

JIT: add more inlining bail out checks #72795

Merged
merged 1 commit into from
Jul 25, 2022
Merged

Conversation

AndyAyersMS
Copy link
Member

When inlining, new temp allocation may fail, and callers of methods
that allocate new temps must do suitable checks.

Add a few that were missing.

Fixes #64787.

When inlining, new temp allocation may fail, and callers of methods
that allocate new temps must do suitable checks.

Add a few that were missing.

Fixes dotnet#64787.
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 25, 2022
@ghost ghost assigned AndyAyersMS Jul 25, 2022
@ghost
Copy link

ghost commented Jul 25, 2022

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

Issue Details

When inlining, new temp allocation may fail, and callers of methods
that allocate new temps must do suitable checks.

Add a few that were missing.

Fixes #64787.

Author: AndyAyersMS
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@AndyAyersMS
Copy link
Member Author

@EgorBo PTAL
cc @dotnet/jit-contrib

We've known for a while this whole design needs rethinking (#8713). Seems like with temps we can just over-allocate and do this sort of check periodically at a higher level; failed inlines should scrub out their side effects to the locals table.

@jakobbotsch
Copy link
Member

I wonder if we could use longjmp or an exception to bail out of inlining in a non-local manner. Is there anything that stops us from doing this given that the design of the JIT is already to leave it to the runtime to clean up after us (so not executing destructors and the likes is not super problematic)?

@AndyAyersMS
Copy link
Member Author

I wonder if we could use longjmp or an exception to bail out of inlining in a non-local manner. Is there anything that stops us from doing this given that the design of the JIT is already to leave it to the runtime to clean up after us (so not executing destructors and the likes is not super problematic)?

Probably doable. I think the only clunky part is we'd need to generalize runWithErrorTrap to recognize yet another type of handled failure.

Not sure if the runtime needs to get involved in cleanup as there is only one jit request and I think the jit interface state/caching is tied to that, not to the particular compiler object the jit is using.

@AndyAyersMS AndyAyersMS merged commit 193fd53 into dotnet:main Jul 25, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assertion failed '!compDonotInline()' during 'Morph - Inlining'
3 participants