refactor(mir-transform): Calculate optimization status inside run_passes_inner - #160057
Conversation
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
|
|
|
This changes behavior, right? I am not sure how to figure out whether this has any bad fallout. |
053bad2 to
c325709
Compare
|
Some changes occurred in coverage instrumentation. cc @Zalathar |
|
This did introduce a regression in that |
|
Yeah the point of splitting it was to separate the functional change from the larger refactor. :) |
c325709 to
a6b2d2b
Compare
|
meta-pondering: Does Should maybe we stop checking mir-opt-level from the session in passes and instead check something passed-in only, with that passed-in thing merging the various knobs into one? I would be sad if people started cargo-culting |
| &add_call_guards::CriticalCallEdges, | ||
| ], | ||
| None, | ||
| pm::Optimizations::Allowed, |
There was a problem hiding this comment.
This is a behavior change I think? Previously SimplifyCfg::MakeShim was always run, now it is controlled by #[optimize].
| @@ -479,7 +478,6 @@ | |||
| &mut body, | |||
| &[&promote_pass, &simplify::SimplifyCfg::PromoteConsts, &coverage::InstrumentCoverage], | |||
There was a problem hiding this comment.
Another SimplifyCfg that's newly controlled by the attribute.
| body, | ||
| &[ | ||
| &remove_uninit_drops::RemoveUninitDrops, | ||
| &simplify::SimplifyCfg::RemoveFalseEdges, |
| &impossible_predicates::ImpossiblePredicates, | ||
| &cleanup_post_borrowck::CleanupPostBorrowck, | ||
| &remove_noop_landing_pads::RemoveNoopLandingPads, | ||
| &simplify::SimplifyCfg::PostAnalysis, |
| @@ -682,13 +673,7 @@ | |||
| &simplify::SimplifyCfg::PreOptimizations, | |||
You mean Yeah TBH I tend to agree... I feel like
👍 And level 0 should then IMO mean "preserve UB" so we don't need a separate knob for that either. ... though that makes it tricky to have a pass that optionally can preserve UB, since that pass will check the mir-opt-level at pass execution time rather than in |
|
I agree that all the SimplifyCfg passes should be controlled by the attribute |
|
Unknown command "". Run |
|
@bors r=RalfJung |
…uwer Rollup of 21 pull requests Successful merges: - #159990 (Many "predicate"-to-"clause" renamings) - #159665 (Replace most `Ty::new_fn_def` calls with `type_of` queries directly) - #159687 (rustdoc: Set tracing max_level_info when debug-logging is false) - #160057 (refactor(mir-transform): Calculate optimization status inside `run_passes_inner`) - #160060 (codegen: skip stores for entirely-uninit constant aggregate fields, attempt #2) - #160063 (Fix ICE when dumping the dep graph with the parallel frontend) - #160065 (Distinguish the dep-graph index space from the live node count) - #158038 (Split register_tool into register_attribute_tool and register_lint_tool) - #159776 (remove const hack in alloc) - #159978 (run intrinsic-test by default on x86_64-gnu) - #160008 (Avoid stale closure recovery state across statements) - #160027 (Add regression test for #132767) - #160030 (Update `browser-ui-test` version to `0.25.0`) - #160046 (Improve consistency of attribute error messages (part 2)) - #160056 (Fix associated function suggestion for generic ADTs) - #160069 (Update Rust crate tracing-subscriber to v0.3.23 [SECURITY]) - #160071 (sanitize_standard_fds: clarify macos comment) - #160076 (use unstable features when updating dependencies) - #160092 (miri ui tests: don't run native tests on stage 0) - #160093 (Switch cargo assignments to weihanglo) - #160094 (Update assignment for docs)
Rollup merge of #160057 - clubby789:local-optimizations, r=RalfJung refactor(mir-transform): Calculate optimization status inside `run_passes_inner` The `Optimizations` enum represents whether `#[optimize(none)]` has been applied to a function. Currently, `run_passes` takes an `Optimizations` which is confusing (#160015 (comment)). Calculate this in `run_passes_inner` instead (which also means `#[optimize(none)]` is applied more consistently. r? @RalfJung
…uwer Rollup of 21 pull requests Successful merges: - rust-lang/rust#159990 (Many "predicate"-to-"clause" renamings) - rust-lang/rust#159665 (Replace most `Ty::new_fn_def` calls with `type_of` queries directly) - rust-lang/rust#159687 (rustdoc: Set tracing max_level_info when debug-logging is false) - rust-lang/rust#160057 (refactor(mir-transform): Calculate optimization status inside `run_passes_inner`) - rust-lang/rust#160060 (codegen: skip stores for entirely-uninit constant aggregate fields, attempt rust-lang/rust#2) - rust-lang/rust#160063 (Fix ICE when dumping the dep graph with the parallel frontend) - rust-lang/rust#160065 (Distinguish the dep-graph index space from the live node count) - rust-lang/rust#158038 (Split register_tool into register_attribute_tool and register_lint_tool) - rust-lang/rust#159776 (remove const hack in alloc) - rust-lang/rust#159978 (run intrinsic-test by default on x86_64-gnu) - rust-lang/rust#160008 (Avoid stale closure recovery state across statements) - rust-lang/rust#160027 (Add regression test for rust-lang/rust#132767) - rust-lang/rust#160030 (Update `browser-ui-test` version to `0.25.0`) - rust-lang/rust#160046 (Improve consistency of attribute error messages (part 2)) - rust-lang/rust#160056 (Fix associated function suggestion for generic ADTs) - rust-lang/rust#160069 (Update Rust crate tracing-subscriber to v0.3.23 [SECURITY]) - rust-lang/rust#160071 (sanitize_standard_fds: clarify macos comment) - rust-lang/rust#160076 (use unstable features when updating dependencies) - rust-lang/rust#160092 (miri ui tests: don't run native tests on stage 0) - rust-lang/rust#160093 (Switch cargo assignments to weihanglo) - rust-lang/rust#160094 (Update assignment for docs)
The
Optimizationsenum represents whether#[optimize(none)]has been applied to a function. Currently,run_passestakes anOptimizationswhich is confusing (#160015 (comment)).Calculate this in
run_passes_innerinstead (which also means#[optimize(none)]is applied more consistently.r? @RalfJung