Skip to content

JIT: Enable retbuf optimization for non-temporaries#79422

Closed
jakobbotsch wants to merge 2 commits intodotnet:mainfrom
jakobbotsch:enable-retbuf-optimization-more-often
Closed

JIT: Enable retbuf optimization for non-temporaries#79422
jakobbotsch wants to merge 2 commits intodotnet:mainfrom
jakobbotsch:enable-retbuf-optimization-more-often

Conversation

@jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Dec 8, 2022

This enables retbuf optimization for non-temporaries by changing the evaluation order for calls that define a local, such that the local is always visited right before the call itself (in post-order). This ensures liveness sees it at the right point for both threaded IR and LIR.

FWIW, it seems unnatural to me that we consider the address node as the definition here, especially considering that it is associated with actual codegen and is a "real" node. Would there be any immediate issues with considering it a use (or maybe a special third kind of thing)? Then we would need to consider the call as the definition like the comment I deleted says. That would avoid tying these two concepts (codegen for the retbuf arg and there being a definition) together.

This enables retbuf optimization for non-temporaries by changing the
evaluation order for calls that define a local, such that the local is
always visited right before the call itself (in post-order). This
ensures liveness sees it at the right point for both threaded IR and
LIR.
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Dec 8, 2022
@ghost ghost assigned jakobbotsch Dec 8, 2022
@ghost
Copy link

ghost commented Dec 8, 2022

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

Issue Details

This enables retbuf optimization for non-temporaries by changing the evaluation order for calls that define a local, such that the local is always visited right before the call itself (in post-order). This ensures liveness sees it at the right point for both threaded IR and LIR.

FWIW, it seems unnatural to me that we consider the address node as the definition here, especially considering that it is associated with actual codegen and is a "real" node. Would there be any immediate issues with considering it a use (or maybe a special third kind of thing) and then considering the call as the definition? That would avoid tying these two concepts (codegen for the retbuf arg and there being a definition) together.

Author: jakobbotsch
Assignees: jakobbotsch
Labels:

area-CodeGen-coreclr

Milestone: -

@jakobbotsch
Copy link
Member Author

@SingleAccretion is working on a different representation for these defined retbufs that should allow fixing this in a more elegant way.

@jakobbotsch jakobbotsch closed this Dec 9, 2022
@jakobbotsch jakobbotsch deleted the enable-retbuf-optimization-more-often branch December 9, 2022 11:30
@ghost ghost locked as resolved and limited conversation to collaborators Jan 8, 2023
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.

1 participant