Skip to content

Commit 42752cb

Browse files
committed
Auto merge of rust-lang#117206 - cjgillot:jump-threading-default, r=tmiasko
Enable MIR JumpThreading by default Mostly for perf r? `@ghost`
2 parents 6cc4843 + 014b29e commit 42752cb

27 files changed

+466
-1286
lines changed

compiler/rustc_mir_transform/src/const_goto.rs

-128
This file was deleted.

compiler/rustc_mir_transform/src/jump_threading.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const MAX_PLACES: usize = 100;
6060

6161
impl<'tcx> MirPass<'tcx> for JumpThreading {
6262
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
63-
sess.mir_opt_level() >= 4
63+
sess.mir_opt_level() >= 2
6464
}
6565

6666
#[instrument(skip_all level = "debug")]

compiler/rustc_mir_transform/src/lib.rs

-7
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ mod remove_place_mention;
5959
mod add_subtyping_projections;
6060
pub mod cleanup_post_borrowck;
6161
mod const_debuginfo;
62-
mod const_goto;
6362
mod const_prop;
6463
mod const_prop_lint;
6564
mod copy_prop;
@@ -103,7 +102,6 @@ mod remove_unneeded_drops;
103102
mod remove_zsts;
104103
mod required_consts;
105104
mod reveal_all;
106-
mod separate_const_switch;
107105
mod shim;
108106
mod ssa;
109107
// This pass is public to allow external drivers to perform MIR cleanup
@@ -590,7 +588,6 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
590588

591589
// Has to run after `slice::len` lowering
592590
&normalize_array_len::NormalizeArrayLen,
593-
&const_goto::ConstGoto,
594591
&ref_prop::ReferencePropagation,
595592
&sroa::ScalarReplacementOfAggregates,
596593
&match_branches::MatchBranchSimplification,
@@ -601,10 +598,6 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
601598
&dead_store_elimination::DeadStoreElimination::Initial,
602599
&gvn::GVN,
603600
&simplify::SimplifyLocals::AfterGVN,
604-
// Perform `SeparateConstSwitch` after SSA-based analyses, as cloning blocks may
605-
// destroy the SSA property. It should still happen before const-propagation, so the
606-
// latter pass will leverage the created opportunities.
607-
&separate_const_switch::SeparateConstSwitch,
608601
&dataflow_const_prop::DataflowConstProp,
609602
&const_debuginfo::ConstDebugInfo,
610603
&o1(simplify_branches::SimplifyConstCondition::AfterConstProp),

0 commit comments

Comments
 (0)