JIT: Enable retbuf optimization for non-temporaries#79422
JIT: Enable retbuf optimization for non-temporaries#79422jakobbotsch wants to merge 2 commits intodotnet:mainfrom
Conversation
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.
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsThis 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.
|
|
@SingleAccretion is working on a different representation for these defined retbufs that should allow fixing this in a more elegant way. |
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.