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

dse: Eliminate dead assignment statements when debuginfo is not set to full #129611

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DianQK
Copy link
Member

@DianQK DianQK commented Aug 26, 2024

This will help: #128299 (comment)

r? cjgillot or mir-opt

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 26, 2024
@rustbot
Copy link
Collaborator

rustbot commented Aug 26, 2024

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@DianQK
Copy link
Member Author

DianQK commented Aug 26, 2024

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 26, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 26, 2024
dse: Eliminate dead assignment statements when `debuginfo` is not set to `full`

This will help: rust-lang#128299 (comment)

r? cjgillot or mir-opt
@bors
Copy link
Contributor

bors commented Aug 26, 2024

⌛ Trying commit a2bc389 with merge 2124150...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-17 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
------
 > importing cache manifest from ghcr.io/rust-lang/rust-ci-cache:20d3b4d4a2629cbf7865cdbf92fe47512a7c96658c24253a045ff38e8075cd7fb37ca6fcadfa6e6d093333943ad24f6fc4f163ec5b74fd940de9d5bb03eb4d3b:
------
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-17]
---
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-17', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-17/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id            := 99999999
---

running 231 tests
........................................................................................  88/231
........................................................................................ 176/231
.............................2024-08-26T14:37:41.419810Z ERROR compiletest::runtest: fatal error, panic: "crashtest no longer crashes/triggers ICE, horray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge."
[crashes] tests/crashes/129219.rs ... F
[crashes] tests/crashes/129219.rs ... F
................2024-08-26T14:37:41.534977Z ERROR compiletest::runtest: fatal error, panic: "crashtest no longer crashes/triggers ICE, horray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge."
[crashes] tests/crashes/79409.rs ... F
........

failures:
failures:

---- [crashes] tests/crashes/129219.rs stdout ----

error: crashtest no longer crashes/triggers ICE, horray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge.
thread '[crashes] tests/crashes/129219.rs' panicked at src/tools/compiletest/src/runtest.rs:368:18:
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- [crashes] tests/crashes/79409.rs stdout ----


error: crashtest no longer crashes/triggers ICE, horray! Please give it a meaningful name, add a doc-comment to the start of the test explaining why it exists and move it to tests/ui or wherever you see fit. Adding 'Fixes #<issueNr>' to your PR description ensures that the corresponding ticket is auto-closed upon merge.
thread '[crashes] tests/crashes/79409.rs' panicked at src/tools/compiletest/src/runtest.rs:368:18:


failures:
    [crashes] tests/crashes/129219.rs

@DianQK
Copy link
Member Author

DianQK commented Aug 26, 2024

@rust-timer build 2124150

@rust-timer

This comment has been minimized.

@cjgillot
Copy link
Contributor

The first commit looks a lot like the first commit in #106852. You will have to fight CI like that PR has to.
For the second commit, should this cleanup be done in SimplifyLocals? Or are you specifically targeting StorageLive/StoragegDead pairs in the same bb?

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2124150): comparison URL.

Overall result: ❌✅ regressions and improvements - 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-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.

mean range count
Regressions ❌
(primary)
5.3% [0.4%, 12.0%] 8
Regressions ❌
(secondary)
0.8% [0.2%, 1.9%] 3
Improvements ✅
(primary)
-0.8% [-4.4%, -0.2%] 36
Improvements ✅
(secondary)
-0.8% [-2.5%, -0.2%] 10
All ❌✅ (primary) 0.3% [-4.4%, 12.0%] 44

Max RSS (memory usage)

Results (primary 0.6%, secondary -2.0%)

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.

mean range count
Regressions ❌
(primary)
12.7% [6.1%, 20.1%] 3
Regressions ❌
(secondary)
1.7% [1.7%, 1.7%] 2
Improvements ✅
(primary)
-3.9% [-7.1%, -2.1%] 8
Improvements ✅
(secondary)
-3.8% [-5.1%, -1.3%] 4
All ❌✅ (primary) 0.6% [-7.1%, 20.1%] 11

Cycles

Results (primary 2.4%, secondary -2.8%)

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.

mean range count
Regressions ❌
(primary)
8.7% [1.1%, 13.4%] 5
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.1% [-4.6%, -0.9%] 7
Improvements ✅
(secondary)
-2.8% [-2.8%, -2.8%] 1
All ❌✅ (primary) 2.4% [-4.6%, 13.4%] 12

Binary size

Results (primary -0.6%, secondary -0.1%)

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.

mean range count
Regressions ❌
(primary)
0.9% [0.1%, 10.3%] 18
Regressions ❌
(secondary)
0.3% [0.2%, 0.4%] 65
Improvements ✅
(primary)
-0.9% [-2.8%, -0.0%] 85
Improvements ✅
(secondary)
-0.9% [-4.0%, -0.1%] 29
All ❌✅ (primary) -0.6% [-2.8%, 10.3%] 103

Bootstrap: 752.172s -> 750.454s (-0.23%)
Artifact size: 338.71 MiB -> 338.69 MiB (-0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Aug 27, 2024
@Kobzol
Copy link
Contributor

Kobzol commented Aug 27, 2024

Great binary size results! But why is diesel/opt 10% larger now 🤔

@DianQK
Copy link
Member Author

DianQK commented Aug 28, 2024

Great binary size results! But why is diesel/opt 10% larger now 🤔

I think this is related to inlining, but I haven't checked it yet.

@DianQK
Copy link
Member Author

DianQK commented Aug 28, 2024

The first commit looks a lot like the first commit in #106852. You will have to fight CI like that PR has to.

Ahh, looks like it, I think we need to add FileCheck to these test cases first. I don't like a PR to have such a long dependency, I'll try to accomplish something similar in match_br.

@rustbot author

For the second commit, should this cleanup be done in SimplifyLocals? Or are you specifically targeting StorageLive/StoragegDead pairs in the same bb?

Yes, they are StorageLive/StoragegDead pairs in the same BB that can be definitely be eliminated.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 28, 2024
@DianQK DianQK marked this pull request as draft August 28, 2024 02:01
@bors
Copy link
Contributor

bors commented Sep 3, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

7 participants