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: Disallow implicit byref args and return buffers from aliasing #104616

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

jakobbotsch
Copy link
Member

The recent work to allow more retbuf definitions uncovered cases where we would end up with the retbuffer aliasing an implicit byref argument. The JIT does not handle this aliasing, which would require proper GTF_GLOB_REF flags on the local nodes accesses implicit byrefs. Fix the problem by disallowing last-use copy elision when the local would alias the return buffer.

Fix #104613

The recent work to allow more retbuf definitions uncovered cases where
we would end up with the retbuffer aliasing an implicit byref argument.
The JIT does not handle this aliasing, which would require proper
`GTF_GLOB_REF` flags on the local nodes accesses implicit byrefs. Fix
the problem by disallowing last-use copy elision when the local would
alias the return buffer.

Fix dotnet#104613
@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 9, 2024
Copy link
Contributor

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

@jakobbotsch jakobbotsch marked this pull request as ready for review July 9, 2024 19:54
@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @AndyAyersMS

Diffs. Regressions where we no longer elide some copies. Those elisions should be new with #104467, so these regressions are just negating some of the improvements from that PR.

@jakobbotsch jakobbotsch merged commit 6c55362 into dotnet:main Jul 10, 2024
98 of 107 checks passed
@jakobbotsch jakobbotsch deleted the fix-104613 branch July 10, 2024 06:51
matouskozak added a commit to matouskozak/runtime that referenced this pull request Jul 11, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 9, 2024
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.

[libraries-jitstress] System.Tests.UInt128Tests_GenericMath.TryReadLittleEndianUInt64Test fails in CI
2 participants