Skip to content

JIT: Disallow implicit byref args and return buffers from aliasing#104616

Merged
jakobbotsch merged 1 commit intodotnet:mainfrom
jakobbotsch:fix-104613
Jul 10, 2024
Merged

JIT: Disallow implicit byref args and return buffers from aliasing#104616
jakobbotsch merged 1 commit intodotnet:mainfrom
jakobbotsch:fix-104613

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
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 9, 2024
@dotnet-policy-service
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
@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