Make validate_mir ensure the final MIR for all bodies#128612
Make validate_mir ensure the final MIR for all bodies#128612compiler-errors wants to merge 1 commit intorust-lang:masterfrom
validate_mir ensure the final MIR for all bodies#128612Conversation
|
hi @rust-lang/wg-mir-opt anyone got strong feelings abt this? |
bfb8ab6 to
f48fe22
Compare
|
For the record, I have a fix for #128601 but want to put up better test that doesn't need the polymorphize flag to trigger it. |
|
Ah, let me just use the instance mir instead of opt mir, since we have some const body owners. |
This comment has been minimized.
This comment has been minimized.
|
this is like |
74dace7 to
470ada2
Compare
validate_mir ensure optimized MIR for all bodiesvalidate_mir ensure the final MIR for all bodies
davidtwco
left a comment
There was a problem hiding this comment.
LGTM, r=me unless you want to wait for others to chime in with an opinion
470ada2 to
1e07c19
Compare
|
@bors r=davidtwco rollup |
…ir, r=davidtwco Make `validate_mir` ensure the final MIR for all bodies A lot of the crashes tests use `-Zpolymorphize` or `-Zdump-mir` for their side effect of computing the `optimized_mir` for all bodies, which will uncover bugs with late MIR passes like the inliner. I don't like having all these tests depend on `-Zpolymorphize` (or other hacky ways) for no reason, so this PR extends the `-Zvalidate-mir` flag to ensure `optimized_mir`/`mir_for_ctfe` for all body owners during the analysis phase. Two thoughts: 1. This could be moved later in the compilation pipeline I guess? I don't really think it matters, though. 1. This could alternatively be expressed using a new flag, though I don't necessarily see much value in separating these. For example, rust-lang#128171 could have used this flag, in the `tests/ui/polymorphization/inline-incorrect-early-bound.rs`. r? mir
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#128306 (Update NonNull::align_offset quarantees) - rust-lang#128612 (Make `validate_mir` ensure the final MIR for all bodies) - rust-lang#128648 (Add regression test) - rust-lang#128791 (Don't implement `AsyncFn` for `FnDef`/`FnPtr` that wouldnt implement `Fn`) - rust-lang#128795 (Update E0517 message to reflect RFC 2195.) - rust-lang#128825 (rm `declared_features` field in resolver) - rust-lang#128826 (Only suggest `#[allow]` for `--warn` and `--deny` lint level flags) r? `@ghost` `@rustbot` modify labels: rollup
…ir, r=davidtwco Make `validate_mir` ensure the final MIR for all bodies A lot of the crashes tests use `-Zpolymorphize` or `-Zdump-mir` for their side effect of computing the `optimized_mir` for all bodies, which will uncover bugs with late MIR passes like the inliner. I don't like having all these tests depend on `-Zpolymorphize` (or other hacky ways) for no reason, so this PR extends the `-Zvalidate-mir` flag to ensure `optimized_mir`/`mir_for_ctfe` for all body owners during the analysis phase. Two thoughts: 1. This could be moved later in the compilation pipeline I guess? I don't really think it matters, though. 1. This could alternatively be expressed using a new flag, though I don't necessarily see much value in separating these. For example, rust-lang#128171 could have used this flag, in the `tests/ui/polymorphization/inline-incorrect-early-bound.rs`. r? mir
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#128306 (Update NonNull::align_offset quarantees) - rust-lang#128612 (Make `validate_mir` ensure the final MIR for all bodies) - rust-lang#128648 (Add regression test) - rust-lang#128749 (Mark `{f32,f64}::{next_up,next_down,midpoint}` inline) - rust-lang#128795 (Update E0517 message to reflect RFC 2195.) - rust-lang#128825 (rm `declared_features` field in resolver) - rust-lang#128826 (Only suggest `#[allow]` for `--warn` and `--deny` lint level flags) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#128612 - compiler-errors:validate-mir-opt-mir, r=davidtwco Make `validate_mir` ensure the final MIR for all bodies A lot of the crashes tests use `-Zpolymorphize` or `-Zdump-mir` for their side effect of computing the `optimized_mir` for all bodies, which will uncover bugs with late MIR passes like the inliner. I don't like having all these tests depend on `-Zpolymorphize` (or other hacky ways) for no reason, so this PR extends the `-Zvalidate-mir` flag to ensure `optimized_mir`/`mir_for_ctfe` for all body owners during the analysis phase. Two thoughts: 1. This could be moved later in the compilation pipeline I guess? I don't really think it matters, though. 1. This could alternatively be expressed using a new flag, though I don't necessarily see much value in separating these. For example, rust-lang#128171 could have used this flag, in the `tests/ui/polymorphization/inline-incorrect-early-bound.rs`. r? mir
|
somehow github does not recognize this as merged, closing manually.. |
|
@matthiaskrgr: it's because bors merged an old version :( Since you merge a lot of PRs and are likely to catch this: When you close PRs that GH doesn't mention, can you check that the version that is pushed is the one that shows up in the bors approval? #128612 (comment) |
|
oh wut? :O usually it would show the commits being added after the rollup being mentioned in the pr history? |
|
oh I see, there are some comments in this pr that were not in the rollup... |
…ir, r=matthiaskrgr Add comment that bors did not see pushed before it merged In rust-lang#128612, bors merged 470ada2 instead of 1e07c19. This means it dropped a useful comment I added, and a stage rename that is more descriptive.
|
☔ The latest upstream changes (presumably #128835) made this pull request unmergeable. Please resolve the merge conflicts. |
Rollup merge of rust-lang#128851 - compiler-errors:validate-mir-opt-mir, r=matthiaskrgr Add comment that bors did not see pushed before it merged In rust-lang#128612, bors merged 470ada2 instead of 1e07c19. This means it dropped a useful comment I added, and a stage rename that is more descriptive.
…iler-errors Do not compute optimized MIR if code does not type-check. Since rust-lang#128612, we compute optimized MIR when `-Zvalidate-mir` is present. This is done as part of required analyses, even if type-checking fails. This causes ICEs, as most of the mir-opt pipeline expects well-formed code. Fixes rust-lang#129095 Fixes rust-lang#134174 Fixes rust-lang#134654 Fixes rust-lang#136381 Fixes rust-lang#137468 Fixes rust-lang#144491 Fixes rust-lang#147011 This does not fix issue rust-lang#137190, as it ICEs without `-Zvalidate-mir`. r? `@compiler-errors`
…iler-errors Do not compute optimized MIR if code does not type-check. Since rust-lang#128612, we compute optimized MIR when `-Zvalidate-mir` is present. This is done as part of required analyses, even if type-checking fails. This causes ICEs, as most of the mir-opt pipeline expects well-formed code. Fixes rust-lang#129095 Fixes rust-lang#134174 Fixes rust-lang#134654 Fixes rust-lang#135570 Fixes rust-lang#136381 Fixes rust-lang#137468 Fixes rust-lang#144491 Fixes rust-lang#147011 This does not fix issue rust-lang#137190, as it ICEs without `-Zvalidate-mir`. r? `@compiler-errors`
…iler-errors Do not compute optimized MIR if code does not type-check. Since rust-lang#128612, we compute optimized MIR when `-Zvalidate-mir` is present. This is done as part of required analyses, even if type-checking fails. This causes ICEs, as most of the mir-opt pipeline expects well-formed code. Fixes rust-lang#129095 Fixes rust-lang#134174 Fixes rust-lang#134654 Fixes rust-lang#135570 Fixes rust-lang#136381 Fixes rust-lang#137468 Fixes rust-lang#144491 Fixes rust-lang#147011 This does not fix issue rust-lang#137190, as it ICEs without `-Zvalidate-mir`. r? ``@compiler-errors``
Rollup merge of #147092 - cjgillot:late-validate-mir, r=compiler-errors Do not compute optimized MIR if code does not type-check. Since #128612, we compute optimized MIR when `-Zvalidate-mir` is present. This is done as part of required analyses, even if type-checking fails. This causes ICEs, as most of the mir-opt pipeline expects well-formed code. Fixes #129095 Fixes #134174 Fixes #134654 Fixes #135570 Fixes #136381 Fixes #137468 Fixes #144491 Fixes #147011 This does not fix issue #137190, as it ICEs without `-Zvalidate-mir`. r? ``@compiler-errors``
Do not compute optimized MIR if code does not type-check. Since rust-lang/rust#128612, we compute optimized MIR when `-Zvalidate-mir` is present. This is done as part of required analyses, even if type-checking fails. This causes ICEs, as most of the mir-opt pipeline expects well-formed code. Fixes rust-lang/rust#129095 Fixes rust-lang/rust#134174 Fixes rust-lang/rust#134654 Fixes rust-lang/rust#135570 Fixes rust-lang/rust#136381 Fixes rust-lang/rust#137468 Fixes rust-lang/rust#144491 Fixes rust-lang/rust#147011 This does not fix issue rust-lang/rust#137190, as it ICEs without `-Zvalidate-mir`. r? ``@compiler-errors``
A lot of the crashes tests use
-Zpolymorphizeor-Zdump-mirfor their side effect of computing theoptimized_mirfor all bodies, which will uncover bugs with late MIR passes like the inliner. I don't like having all these tests depend on-Zpolymorphize(or other hacky ways) for no reason, so this PR extends the-Zvalidate-mirflag to ensureoptimized_mir/mir_for_ctfefor all body owners during the analysis phase.Two thoughts:
For example, #128171 could have used this flag, in the
tests/ui/polymorphization/inline-incorrect-early-bound.rs.r? mir