-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Improve liveness for 'STORE_BLK(lcl_var)'. #48797
Improve liveness for 'STORE_BLK(lcl_var)'. #48797
Conversation
@erozenfeld, could you please review it if you have time? It is not what I asked about but a different issue, the one that I asked I could not have fixed and will leave it for now. |
c5edbba
to
efb06ed
Compare
I have changed the solution to better analyse "store_blk" and use "store_lcl_var" in the cases where "store_blk" was used with no reason. It gives improvements on the same set of methods, so the original commit was dropped, maybe I will still need in the future, with additional struct changes, but for now, it does not produce diffs. The new diffs:
|
Could somebody please review it @dotnet/jit-contrib ? |
store->gtFlags |= GTF_VAR_DEF | GTF_ASG; | ||
return store; | ||
} | ||
|
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.
Nice improvement
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 Good
src/coreclr/jit/liveness.cpp
Outdated
if (entire) | ||
{ | ||
fgMarkUseDef(dummyLclVarTree); | ||
} |
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.
This is good too.
While reviewing this change again I found that `fgMarkUseDef` should be called when we visit the local itself, the diffs that I saw from this change were because the LCL_VAR was not marked as `GTF_VAR_DEF`. Now the lclVar is marked as `GTF_VAR_DEF` so we don't need this extra logic.
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.
LGTM
The rule for an untracked variable was weaker so converting a tracked variable to untracked sometimes gave us better code.
Don't set
lvMustInit
for trackedlclVars
that are compiler temps if they don't contain GC fields.Tiny SPMI improvements on master but I need it for my future changes.
Diff example:
before.txt
after.txt