- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
inlining: Also apply statement effects when declining to inline #46775
Merged
+63
−8
Conversation
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
aviatesk
reviewed
Sep 15, 2022
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.
You also need to update handle_finalizer_call!
.
Sorry, I have more changes here locally, but the structure of the code triggers a miscompilation somewhere (in the compiler, not the generated code itself), so I haven't pushed those yet. |
When inlining, we already determine what the effects for all the different cases are, so that we can apply appropriate statement flags on each of the edges. However, if for some reason we decided to decline to inline, we weren't making use of this information. Fix that.
2080b5c
to
9710f9d
Compare
aviatesk
added a commit
that referenced
this pull request
Sep 18, 2022
Keno
added a commit
that referenced
this pull request
Sep 18, 2022
During the development of #46775, we saw a miscompile in the compiler, specifically, we saw SROA failing to provide a proper PHI nest. The root cause of this turned out to be an incorrect dominance query. In particular, during incremental compaction, the non-compacted portion of the IncrementalCompact cfg is allocated, but not valid, so we must not query it for basic block information. Unfortunately, I don't really have a good test case for this. This code has grown mostly organically for a few years, and I think it's probably overdue for an overhaul.
aviatesk
pushed a commit
that referenced
this pull request
Sep 18, 2022
During the development of #46775, we saw a miscompile in the compiler, specifically, we saw SROA failing to provide a proper PHI nest. The root cause of this turned out to be an incorrect dominance query. In particular, during incremental compaction, the non-compacted portion of the IncrementalCompact cfg is allocated, but not valid, so we must not query it for basic block information. Unfortunately, I don't really have a good test case for this. This code has grown mostly organically for a few years, and I think it's probably overdue for an overhaul.
aviatesk
added a commit
that referenced
this pull request
Sep 19, 2022
Keno
added a commit
that referenced
this pull request
Sep 20, 2022
* Fix SROA miscompile in large functions During the development of #46775, we saw a miscompile in the compiler, specifically, we saw SROA failing to provide a proper PHI nest. The root cause of this turned out to be an incorrect dominance query. In particular, during incremental compaction, the non-compacted portion of the IncrementalCompact cfg is allocated, but not valid, so we must not query it for basic block information. Unfortunately, I don't really have a good test case for this. This code has grown mostly organically for a few years, and I think it's probably overdue for an overhaul. * optimizer: address TODO for computing `joint_effects` more efficiently Co-authored-by: Shuhei Kadowaki <[email protected]>
aviatesk
added a commit
that referenced
this pull request
Dec 9, 2022
* inlining: Also apply statement effects when declining to inline When inlining, we already determine what the effects for all the different cases are, so that we can apply appropriate statement flags on each of the edges. However, if for some reason we decided to decline to inline, we weren't making use of this information. Fix that. * make it work. Co-authored-by: Shuhei Kadowaki <[email protected]>
aviatesk
added a commit
that referenced
this pull request
Dec 9, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When inlining, we already determine what the effects for all the different cases are, so that we can apply appropriate statement flags on each of the edges. However, if for some reason we decided to decline to inline, we weren't making use of this information. Fix that.