-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Recognize more "local addr" trees as invariant #68484
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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.
It's notable that combined with #68469, this will bind
IsLocalAddrExpr
"the simple version" toLocalAddressVisitor
likeDefinesLocalAddr
andIsLocalAddrExpr
"the not simple version" are bound right now (which may also not be a new thing, it may have been like this already due to struct promotion requirements).BTW, this is also the reason we must recognize
ADD
s in all these functions, they're produced for structs with fields at offsets larger thanGenTreeLclFld
(and the emitter) can represent.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.
I think even without #68469 there are/were non-trivial invariants between the two. While before this PR we 'supported' call morphing introducing a local store for the address, there was already an implicit assumption that no extra uses of this temp were ever created. So in a way we are just trading one assumption for another and have a slightly more explicit assert about it.
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 unsatisfying, but I am hard pressed to think about how to improve the situation.
Probably it would be ideal if we could unify
DefinesLocalAddr
, the two variants ofIsLocalAddrExpr
and whatLocalAddressVisitor
is doing somehow, but that also seems difficult.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.
Hehe, this is what #11057 is about :).
The original "north star" design was that we'd only have
STORE_LCL_VAR|FLD
for tracked locals, this return buffer optimization makes that "hard" unfortunately, but even with it (assuming I won't find a way to represent it as a store after all), we'd have:DefinesLocalAddr
becomes equivalent toOperIsLocalAddr
.IsLocalAddrExpr
"simple" and "not simple", as well asfgIsIndirOfAddrOfLocal
) are deleted.LocalAddressVisitor
transforms allASG
s intoSTORE_LCL_VAR|FLD
, and for the return buffer optimization,LCL_VAR|FLD_ADDR
.LCL_VAR|FLD
(this is Remove theOBJ(ADDR)
wrapping created for calls by the importer #51569)As a point-in-time improvement, the "not simple"
IsLocalAddrExpr
will be deleted once/if physical VN changes are in.