Skip to content

Commit ada7a64

Browse files
committed
Remove ConstGoto and SeparateConstSwitch.
1 parent e78394c commit ada7a64

16 files changed

+176
-735
lines changed

compiler/rustc_mir_transform/src/const_goto.rs

-129
This file was deleted.

compiler/rustc_mir_transform/src/lib.rs

-7
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ mod remove_place_mention;
5757
mod add_subtyping_projections;
5858
pub mod cleanup_post_borrowck;
5959
mod const_debuginfo;
60-
mod const_goto;
6160
mod const_prop;
6261
mod const_prop_lint;
6362
mod copy_prop;
@@ -99,7 +98,6 @@ mod remove_unneeded_drops;
9998
mod remove_zsts;
10099
mod required_consts;
101100
mod reveal_all;
102-
mod separate_const_switch;
103101
mod shim;
104102
mod ssa;
105103
// This pass is public to allow external drivers to perform MIR cleanup
@@ -554,7 +552,6 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
554552
&remove_storage_markers::RemoveStorageMarkers,
555553
&remove_zsts::RemoveZsts,
556554
&normalize_array_len::NormalizeArrayLen, // has to run after `slice::len` lowering
557-
&const_goto::ConstGoto,
558555
&remove_unneeded_drops::RemoveUnneededDrops,
559556
&ref_prop::ReferencePropagation,
560557
&sroa::ScalarReplacementOfAggregates,
@@ -564,10 +561,6 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
564561
&instsimplify::InstSimplify,
565562
&simplify::SimplifyLocals::BeforeConstProp,
566563
&copy_prop::CopyProp,
567-
// Perform `SeparateConstSwitch` after SSA-based analyses, as cloning blocks may
568-
// destroy the SSA property. It should still happen before const-propagation, so the
569-
// latter pass will leverage the created opportunities.
570-
&separate_const_switch::SeparateConstSwitch,
571564
&const_prop::ConstProp,
572565
&gvn::GVN,
573566
&dataflow_const_prop::DataflowConstProp,

0 commit comments

Comments
 (0)