-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Take advantage of simplifications enabled by folding all indirect access to locals #79722
Take advantage of simplifications enabled by folding all indirect access to locals #79722
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak Issue DetailsWe delete code which needed to deal with the fact tracked locals in HIR could be accesses indirectly. Diffs: a few regressions in tests where we are more conservative with address-exposed locals accessed via
|
d041eeb
to
ec7107c
Compare
Good on me for noticing it a few weeks ago in dotnet#79722... ``` // Otherwise, must be local lhs form. TODO-Bug: this doesn't account for LCL_FLD. // This will miss memory havoc induced by address-exposed local field stores. ```
Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it. |
Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it. |
52f3e59
to
8e6d803
Compare
Forward sub can bring in local address nodes and not recognizing them pessimizes things
8e6d803
to
668bacb
Compare
@dotnet/jit-contrib |
GenTreeLclVarCommon* lclVarTree = nullptr; | ||
GenTree* addrArg = tree->AsOp()->gtOp1->gtEffectiveVal(/*commaOnly*/ true); | ||
if (!addrArg->DefinesLocalAddr(&lclVarTree)) | ||
{ | ||
fgCurMemoryUse |= memoryKindSet(GcHeap, ByrefExposed); | ||
} | ||
else | ||
{ | ||
// Defines a local addr | ||
assert(lclVarTree != nullptr); | ||
fgMarkUseDef(lclVarTree->AsLclVarCommon()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me!
/azp run runtime-coreclr jitstress, runtime-coreclr libraries-jitstress |
Azure Pipelines successfully started running 2 pipeline(s). |
Failure is known according to build analysis. |
We delete code which needed to deal with the fact tracked locals in HIR could be accesses indirectly.
Diffs are primarily from the reintroduced morph folding. Sources:
GTF_ORDER_SIDEEFF
on the local field (as it would on an indirection), allowing for someoptOptimizeBools
action.LCL_FLD
is cheaper thanIND(LCL_VAR_ADDR)
.There is also a nice TP win,
0.3%
-0.5%
reduction in instruction retired under FullOpts.Note: diff better viewed with the "ignore whitespace changes" option.