Repository navigation
mir-transform: Treat optimize(none) the same as opt-level=0 - #160524
Conversation
354d5d9 to
e4742bc
Compare
|
Typo error caused an ICE in drop elaboration which seems a bit surprising EDIT: Seems like some other opts rely on |
This comment has been minimized.
This comment has been minimized.
|
Note that this now fails because produces |
What do you mean by "rely" here and why does this become more of a problem with this PR? |
I didn't look into it deeply, but a few passes seemed to ICE if they ran with dead BBs.
It doesn't; I just made a typo during implementation which exposed this and I was unsure if that was intentional/known. |
We'd have to ask the people that wrote the passes, so it'd help if you had a concrete example and backtrace. I presume this can be reproduced with |
|
The ICE is from a debug assertion; with the typo reverted, and debug-assertions enabled, the ICE is as follows (when building std) rustc-ice-2026-08-10T06_58_41-132370.txt Minimised to a baseline rustc with debug assertions: Not sure if this is a problem at all in practice? If you think it is I can split out a new issue since it's not too relevant to this PR specifically |
|
Thanks! Could you file an issue? Then we can ping some folks to see what the expected contract for these passes is.
|
e4742bc to
963617f
Compare
This comment has been minimized.
This comment has been minimized.
963617f to
011d6ef
Compare
|
Refactored around this API: |
This comment has been minimized.
This comment has been minimized.
011d6ef to
7911d5f
Compare
This comment has been minimized.
This comment has been minimized.
|
I am not sure that |
7911d5f to
67ab36c
Compare
|
Some changes occurred in coverage instrumentation. cc @Zalathar Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
|
r? @JohnTitor rustbot has assigned @JohnTitor. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
I dropped the |
1076f97 to
13b81b7
Compare
|
Thanks. :) @bors r+ |
This comment has been minimized.
This comment has been minimized.
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 f207aa3 (parent) -> f248f40 (this PR) Test differencesShow 10 test diffs10 doctest diffs were found. These are ignored, as they are noisy. Test dashboardRun And 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 (f248f40): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (primary 2.7%, secondary -2.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.2%, secondary -2.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 476.209s -> 476.686s (0.10%) |
…r=saethlin mir-transform: Remove `is_optimization_stage` Based on rust-lang#160524 until that one is merged rust-lang#160524 (comment)
mir-transform: Remove `is_optimization_stage` Based on #160524 until that one is merged #160524 (comment)
…r=saethlin mir-transform: Remove `is_optimization_stage` Based on rust-lang#160524 until that one is merged rust-lang#160524 (comment)
Rollup merge of #161413 - clubby789:remove-is-optimization, r=saethlin mir-transform: Remove `is_optimization_stage` Based on #160524 until that one is merged #160524 (comment)
RFC 2412 had said that: > `#[optimize]` attributes are no-ops when no optimizations are done > globally (i.e., `-C opt-level=0`). Correspondingly, that's what the nonnormative admonition here had said, regarding the behavior of `rustc`. As it turns out, though, this is only true at the LLVM level. We still do MIR optimizations (except for inlining) based on the presence of these attributes (see rust-lang/rust#160524). So let's clarify.
RFC 2412 says that the `optimize` attributes are no-ops at `-C opt-level=0`. Correspondingly, that's what the nonnormative admonition here had said, regarding the behavior of `rustc`. As it turns out, though, this is true only at the LLVM level. We still do MIR optimizations (except for inlining) based on the presence of these attributes (see rust-lang/rust#160524). So let's clarify.
View all comments
cc @RalfJung