Skip to content

Commit 7891778

Browse files
committed
Remove ConstGoto and SeparateConstSwitch.
1 parent 4fb7562 commit 7891778

17 files changed

+289
-901
lines changed

compiler/rustc_mir_transform/src/const_goto.rs

-128
This file was deleted.

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;
@@ -102,7 +101,6 @@ mod remove_unneeded_drops;
102101
mod remove_zsts;
103102
mod required_consts;
104103
mod reveal_all;
105-
mod separate_const_switch;
106104
mod shim;
107105
mod ssa;
108106
// This pass is public to allow external drivers to perform MIR cleanup
@@ -574,7 +572,6 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
574572
&remove_storage_markers::RemoveStorageMarkers,
575573
&remove_zsts::RemoveZsts,
576574
&normalize_array_len::NormalizeArrayLen, // has to run after `slice::len` lowering
577-
&const_goto::ConstGoto,
578575
&remove_unneeded_drops::RemoveUnneededDrops,
579576
&ref_prop::ReferencePropagation,
580577
&sroa::ScalarReplacementOfAggregates,
@@ -584,10 +581,6 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
584581
&instsimplify::InstSimplify,
585582
&simplify::SimplifyLocals::BeforeConstProp,
586583
&copy_prop::CopyProp,
587-
// Perform `SeparateConstSwitch` after SSA-based analyses, as cloning blocks may
588-
// destroy the SSA property. It should still happen before const-propagation, so the
589-
// latter pass will leverage the created opportunities.
590-
&separate_const_switch::SeparateConstSwitch,
591584
&const_prop::ConstProp,
592585
&gvn::GVN,
593586
&simplify::SimplifyLocals::AfterGVN,

0 commit comments

Comments
 (0)