Skip to content
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
merged 2 commits into from
Sep 17, 2022

Conversation

Keno
Copy link
Member

@Keno Keno commented Sep 15, 2022

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.

Copy link
Member

@aviatesk aviatesk left a 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!.

@Keno
Copy link
Member Author

Keno commented Sep 15, 2022

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.

Keno and others added 2 commits September 16, 2022 13:23

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
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.
@Keno Keno merged commit b3f25d7 into master Sep 17, 2022
@Keno Keno deleted the kf/noinlineffects branch September 17, 2022 22:01
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.
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants