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

crashes: add test for #131451 #133104

Merged
merged 1 commit into from
Dec 8, 2024

Conversation

matthiaskrgr
Copy link
Member

r? @saethlin
How do I find out which mir opts are involved here? 😅

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 16, 2024
@saethlin
Copy link
Member

This should be scriptable:

First off, try with a lower mir-opt-level. This is just a fast way to trim down the pass list.

Build with -Zdump-mir=all. This will produce a mir_dump directory that has the before and after MIR for every pass that was run on any MIR. This produces a directory called mir_dump/ which contains a bunch of files named like <crate>.<function>.<phase_number>-<pass_number>.<pass_name>.{before,after}.mir.

You should be able to manually enable only the passes that produce a diff in the MIR. The before and after files always differ on the first line because that's a comment that repeats the file's name.

Then trim down that list of passes further, if possible.

@saethlin saethlin 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 Nov 20, 2024
@jieyouxu jieyouxu mentioned this pull request Nov 21, 2024
@matthiaskrgr
Copy link
Member Author

matthiaskrgr commented Nov 21, 2024

ok ty, I think I got it :D
to get the flags, in the mir-dump dir:

ls -c1 | sort -n | grep after  | grep -o "...-...\..*.after" | cut -c9- | sed 's/\.after$//g'   | sed s/^/\"-Zmir-enable-passes=+/  | sed -e s/$/\",/

Then I throw this into icemaker and let it reduce the flags automatically:
-Zvalidate-mir -Zmir-enable-passes=+DataflowConstProp -Zmir-enable-passes=+Inline
oops these were from a different file that does not require debug assertions
edit: this is

-Clink-dead-code=true -Zmir-enable-passes=+GVN -Zmir-enable-passes=+JumpThreading --crate-type=lib

@saethlin
Copy link
Member

Can you drop -Clink-dead-code=true if the fn is pub?

@matthiaskrgr matthiaskrgr force-pushed the crashtest_debugass_131451.rs branch from 6fca409 to 159ed85 Compare December 8, 2024 12:10
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 8, 2024
@matthiaskrgr
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 8, 2024
@saethlin
Copy link
Member

saethlin commented Dec 8, 2024

Nice!
@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 8, 2024

📌 Commit 159ed85 has been approved by saethlin

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 8, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 8, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#131669 (lint: change help for pointers to dyn types in FFI)
 - rust-lang#133104 (crashes: add test for rust-lang#131451)
 - rust-lang#133767 (Add more info on type/trait mismatches for different crate versions)
 - rust-lang#133861 (Add allocate_bytes and refactor allocate_str in InterpCx for raw byte…)
 - rust-lang#133976 (Removed Unnecessary Spaces From RELEASES.md)
 - rust-lang#133987 (Define acronym for thread local storage)
 - rust-lang#133992 (Actually walk into lifetimes and attrs in `EarlyContextAndPass`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5101833 into rust-lang:master Dec 8, 2024
6 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Dec 8, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 8, 2024
Rollup merge of rust-lang#133104 - matthiaskrgr:crashtest_debugass_131451.rs, r=saethlin

crashes: add test for rust-lang#131451

r? `@saethlin`
How do I find out which mir opts are involved here? 😅
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

4 participants