Conversation
Implicit byref arguments are never on the GC heap (dotnet#133304), so type them as TYP_I_IMPL rather than TYP_BYREF to avoid GC reporting them. Also treat return buffers as non-null in fgAddrCouldBeNull. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5bb92e6b-deb1-4963-9107-87559f446347
|
Azure Pipelines: Successfully started running 6 pipeline(s). 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
One or more issues must be addressed before approval.
Review effort: Lite
Findings: None
What changed in this PR
Updates JIT handling of implicit byref parameters to use TYP_I_IMPL, avoiding GC reporting and unnecessary write barriers. It also recognizes return-buffer locals as non-null.
Changes:
- Retypes implicit byref locals and related IR.
- Updates diagnostics, async analysis, and scope handling.
- Documents the non-GC semantics of implicit byrefs.
| File | Description |
|---|---|
| src/coreclr/jit/scopeinfo.cpp | Updated as part of this pull request. |
| src/coreclr/jit/morph.cpp | Updated as part of this pull request. |
| src/coreclr/jit/lclvars.cpp | Updated as part of this pull request. |
| src/coreclr/jit/importer.cpp | Updated as part of this pull request. |
| src/coreclr/jit/gentree.cpp | Updated as part of this pull request. |
| src/coreclr/jit/flowgraph.cpp | Updated as part of this pull request. |
| src/coreclr/jit/fgdiagnostic.cpp | Updated as part of this pull request. |
| src/coreclr/jit/compiler.h | Updated as part of this pull request. |
| src/coreclr/jit/asyncanalysis.cpp | Updated as part of this pull request. |
| docs/design/coreclr/botr/clr-abi.md | Updated as part of this pull request. |
* Keep implicit byrefs TYP_BYREF in async methods: their storage changes on resumption, so derived addresses must not be kept live (e.g. CSE'd) across suspension points. * Use fgAddrCouldBeHeap for write barrier selection and teach it about implicit byrefs, removing checked barriers for stores to ret bufs and implicit byrefs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5bb92e6b-deb1-4963-9107-87559f446347
Member
Author
|
PTAL @jakobbotsch @dotnet/jit-contrib Diffs mostly from teaching |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implicit byref args are never on the GC heap (#133304), so type them as
TYP_I_IMPLinstead ofTYP_BYREF(no GC reporting); async methods keepTYP_BYREFsince their storage changes on resumption.Treat return buffers as non-null in
fgAddrCouldBeNull, and usefgAddrCouldBeHeap(now aware of implicit byrefs) for write barrier selection.Contributes to #82166