-
Notifications
You must be signed in to change notification settings - Fork 14k
Turn moves into copies after copy propagation #147804
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
Conversation
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
This comment has been minimized.
This comment has been minimized.
|
@bors2 try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Turn moves into copies after copy propagation
This comment has been minimized.
This comment has been minimized.
|
💥 Test timed out after |
|
@bors try |
Turn moves into copies after copy propagation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (09003ac): comparison URL. Overall result: ❌ regressions - please read the text belowBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 1.5%, secondary 4.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -0.5%, secondary 5.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.7%, secondary 0.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 475.372s -> 475.243s (-0.03%) |
4ae2c39 to
391b45e
Compare
|
@bors try @rust-timer queue |
|
💔 Test failed - checks-actions |
|
☔ The latest upstream changes (presumably #148446) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Bors, this PR has merge conflicts. @bors r- retry |
Previously copy propagation presumed that there is further unspecified distinction between move operands and copy operands in assignments and propagated moves from assignments into terminators. This is inconsistent with current operational semantics. Turn moves into copies after copy propagation to preserve existing behavior. Fixes rust-lang#137936. Fixes rust-lang#146423.
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
| //@ add-minicore | ||
| //@ revisions:m68k x86_64-linux x86_64-windows i686-linux i686-windows | ||
|
|
||
| //@ compile-flags: -Copt-level=1 -Cno-prepopulate-passes |
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 test now relies on CopyProp + DeadStoreElimination, while it previously relied only on CopyProp.
Custom MIR would be a better alternative, if not for the fact that it is not available in minicore tests :-(.
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.
Why is this opt-level=1 instead of enabling the specific MIR transforms?
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.
What would be a benefit of doing that? Test assumes that code generation is performed on fully optimized MIR. It doesn't matter which transforms are involved.
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.
Ah I see. I'm just wary of the assumption that opt-level 1 is fully optimized MIR. Currently it does map to -Zmir-opt-level=2 but I have a nagging feeling that enabling the same (with the exception of Inline) MIR opts at -Copt-level=3 and -Copt-level=1 can't be optimal.
But this isn't a serious reason to hold up this PR even more, it's an important fix so I'm delta-approving it.
|
@bors r=cjgillot,saethlin |
|
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 23f7081 (parent) -> 122cbd0 (this PR) Test differencesShow 2 test diffs2 doctest diffs were found. These are ignored, as they are noisy. Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 122cbd043833a1d7540cc5f99c458bfca2d3c525 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (122cbd0): comparison URL. Overall result: ❌ regressions - please read the text belowOur benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResults (secondary 3.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.3%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 469.836s -> 471.242s (0.30%) |
|
The perf. regression was deemed acceptable, as this fixes miscompilations. @rustbot label: +perf-regression-triaged |
Previously copy propagation presumed that there is further unspecified distinction between move operands and copy operands in assignments and propagated moves from assignments into terminators. This is inconsistent with current operational semantics.
Turn moves into copies after copy propagation to preserve existing behavior.
Fixes #137936.
Fixes #146423.
r? @cjgillot