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

Separate generator info from MIR body. #101547

Closed
wants to merge 1 commit into from

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Sep 7, 2022

Split from #99782.

cc @JakobDegen does the splitting make sense with your recent refactor of MIR phases.
cc @eholk this should make the late generator analysis easier to work with.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 7, 2022
@rustbot
Copy link
Collaborator

rustbot commented Sep 7, 2022

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

This PR changes MIR

cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @celinval, @vakaras

@rust-highfive
Copy link
Collaborator

r? @compiler-errors

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 7, 2022
Copy link
Contributor

@eholk eholk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a quick read over this and it looks good to me! I left a few comments with some questions just to make sure I'm understanding things right.

compiler/rustc_middle/src/mir/mod.rs Show resolved Hide resolved
compiler/rustc_middle/src/mir/mod.rs Show resolved Hide resolved
compiler/rustc_middle/src/mir/syntax.rs Outdated Show resolved Hide resolved
@JakobDegen
Copy link
Contributor

cc @JakobDegen does the splitting make sense with your recent refactor of MIR phases.

See the documentation on MirPhase; the generator transform is identified there as a semantic change (because locals before a generator transform aren't really locals). This means it needs to remain part of a dialect transition, and cannot just be a phase.

Do we even still need mir_drops_elaborated_and_consts_checked? Can't we just replace it with mir_generators_lowered?

@JakobDegen
Copy link
Contributor

Also note that this PR removes a couple stale files from the mir-opt tests. That was my fault, it's fixed on master though, so should be fine if you rebase.

///
/// Furthermore, `Copy` operands are allowed for non-`Copy` types.
GeneratorsLowered = 2,
Optimized = 3,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a doc comment (that's pre-existing though, so probably material for a different PR).

@cjgillot
Copy link
Contributor Author

cjgillot commented Sep 8, 2022

See the documentation on MirPhase; the generator transform is identified there as a semantic change (because locals before a generator transform aren't really locals). This means it needs to remain part of a dialect transition, and cannot just be a phase.

I don't understand your comment. Does this mean it has to change the variant of MirPhase and not only of RuntimePhase?

Do we even still need mir_drops_elaborated_and_consts_checked? Can't we just replace it with mir_generators_lowered?

I've put back the transformation to its original position. This avoids introducing an additional query.

@rust-log-analyzer

This comment has been minimized.

@cjgillot
Copy link
Contributor Author

cjgillot commented Sep 8, 2022

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 8, 2022
@bors
Copy link
Contributor

bors commented Sep 8, 2022

⌛ Trying commit 04c480cf368292bf263ab75600d90e73dada2751 with merge d3f203dbddcb1d3835cbc318a73f4725d8dd540d...

@bors
Copy link
Contributor

bors commented Sep 8, 2022

☀️ Try build successful - checks-actions
Build commit: d3f203dbddcb1d3835cbc318a73f4725d8dd540d (d3f203dbddcb1d3835cbc318a73f4725d8dd540d)

@rust-timer
Copy link
Collaborator

Queued d3f203dbddcb1d3835cbc318a73f4725d8dd540d with parent 8778809, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d3f203dbddcb1d3835cbc318a73f4725d8dd540d): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
0.4% [0.2%, 0.9%] 42
Regressions ❌
(secondary)
0.7% [0.4%, 1.2%] 12
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [0.2%, 0.9%] 42

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
1.6% [1.2%, 2.1%] 3
Regressions ❌
(secondary)
2.1% [1.4%, 2.9%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.7% [-2.7%, -0.6%] 2
All ❌✅ (primary) 1.6% [1.2%, 2.1%] 3

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.3% [2.3%, 2.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 9, 2022
@bors
Copy link
Contributor

bors commented Sep 13, 2022

☔ The latest upstream changes (presumably #101086) made this pull request unmergeable. Please resolve the merge conflicts.

@compiler-errors
Copy link
Member

@cjgillot sorry I haven't been keeping up with this PR -- not sure if I'm qualified to make the call about whether to accept the perf regression. Do others have thoughts? (@JakobDegen @eholk to name a few people already involved in this PR)

@cjgillot
Copy link
Contributor Author

@compiler-errors this PR only really makes sense in the context of #99782 or #101692. Without those PRs, there is no reason to pay the perf cost of this one. I'd suggest we stall this PR on a decision on those.

@cjgillot cjgillot force-pushed the separate-generator branch 2 times, most recently from e97d611 to b35a02d Compare October 9, 2022 10:03
@bors
Copy link
Contributor

bors commented Oct 22, 2022

☔ The latest upstream changes (presumably #103172) made this pull request unmergeable. Please resolve the merge conflicts.

@bors
Copy link
Contributor

bors commented Oct 25, 2022

☔ The latest upstream changes (presumably #102340) made this pull request unmergeable. Please resolve the merge conflicts.

@apiraino
Copy link
Contributor

@cjgillot checking the pulse of this PR. Based on your comment what are your thoughts now about this PR (#99782 was closed, #101692 is making progesses).

thanks for your work :)

@cjgillot cjgillot force-pushed the separate-generator branch 2 times, most recently from bbaac41 to 1c93a2f Compare October 28, 2022 15:16
@compiler-errors
Copy link
Member

Marking as blocked until an update is provided about plans for this -- specifically, still waiting on #101692?

@compiler-errors compiler-errors added S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 7, 2022
@cjgillot
Copy link
Contributor Author

cjgillot commented Nov 7, 2022

This PR waits for a decision on #101692.
I will close it, as it's just a subset of the commits.

@cjgillot cjgillot closed this Nov 7, 2022
@cjgillot cjgillot deleted the separate-generator branch November 7, 2022 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.