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: Always introduce temps for ldarga'd parameters when inlining #112051

Closed
wants to merge 1 commit into from

Conversation

jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Jan 31, 2025

Noticed that we end up bailing from inlining in cases like the following because we end up in a case where we have to take the address of an rvalue when importing ldarga.

static void Foo()
{
    S x = default;
    Foo(&x);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
static unsafe void Bar(S* px)
{
    Bar(&px);
}

Bar here fails to inline into Foo. Very uncommon case, but the fix is simple.

Noticed that we end up bailing from inlining in cases like the
following because we end up in a case where we have to take the address
of an rvalue when importing `ldarga`.

```
static void Foo()
{
    S x = default;
    Foo(&x);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
static unsafe void Bar(S* px)
{
    Bar(&px);
}
```

Very uncommon case, but the fix is simple.
@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 Jan 31, 2025
Copy link
Contributor

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

@jakobbotsch
Copy link
Member Author

In the end this is subsumed by #112010 as I ended up generalizing this logic to fix some regressions in that PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.

1 participant