]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir_transform/src/lib.rs
Reimplement NormalizeArrayLen.
[rust.git] / compiler / rustc_mir_transform / src / lib.rs
index 6858fa8e524f20bb5ccddee0f0589e5fcfcc4906..43d5b44525848ce01c63760ee642e519f5700eef 100644 (file)
@@ -54,6 +54,7 @@
 mod const_goto;
 mod const_prop;
 mod const_prop_lint;
+mod copy_prop;
 mod coverage;
 mod ctfe_limit;
 mod dataflow_const_prop;
@@ -87,6 +88,7 @@
 mod reveal_all;
 mod separate_const_switch;
 mod shim;
+mod ssa;
 // This pass is public to allow external drivers to perform MIR cleanup
 pub mod simplify;
 mod simplify_branches;
@@ -547,13 +549,13 @@ fn o1<T>(x: T) -> WithMinOptLevel<T> {
         &[
             &reveal_all::RevealAll, // has to be done before inlining, since inlined code is in RevealAll mode.
             &lower_slice_len::LowerSliceLenCalls, // has to be done before inlining, otherwise actual call will be almost always inlined. Also simple, so can just do first
-            &normalize_array_len::NormalizeArrayLen, // has to run after `slice::len` lowering
             &unreachable_prop::UnreachablePropagation,
             &uninhabited_enum_branching::UninhabitedEnumBranching,
             &o1(simplify::SimplifyCfg::new("after-uninhabited-enum-branching")),
             &inline::Inline,
             &remove_storage_markers::RemoveStorageMarkers,
             &remove_zsts::RemoveZsts,
+            &normalize_array_len::NormalizeArrayLen, // has to run after `slice::len` lowering
             &const_goto::ConstGoto,
             &remove_unneeded_drops::RemoveUnneededDrops,
             &sroa::ScalarReplacementOfAggregates,
@@ -563,6 +565,7 @@ fn o1<T>(x: T) -> WithMinOptLevel<T> {
             &instcombine::InstCombine,
             &separate_const_switch::SeparateConstSwitch,
             &simplify::SimplifyLocals::new("before-const-prop"),
+            &copy_prop::CopyProp,
             //
             // FIXME(#70073): This pass is responsible for both optimization as well as some lints.
             &const_prop::ConstProp,