about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-01-20 19:34:46 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-01-27 18:22:45 +0000
commitd29dc057ba53063a9ce7f1b307a89759a096f4ac (patch)
treed98b433eb8f8974728b565e54caabf1a86f6801e
parent9096d31dcc292bad1281e0ab37e55d9a3aac5dc4 (diff)
downloadrust-d29dc057ba53063a9ce7f1b307a89759a096f4ac.tar.gz
rust-d29dc057ba53063a9ce7f1b307a89759a096f4ac.zip
Do not merge locals that have their address taken.
-rw-r--r--compiler/rustc_mir_transform/src/copy_prop.rs71
-rw-r--r--compiler/rustc_mir_transform/src/ssa.rs11
-rw-r--r--tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff3
-rw-r--r--tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff1
-rw-r--r--tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.diff1
-rw-r--r--tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.diff34
-rw-r--r--tests/mir-opt/copy-prop/borrowed_local.rs39
-rw-r--r--tests/mir-opt/copy-prop/cycle.main.CopyProp.diff2
-rw-r--r--tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.mir1
-rw-r--r--tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.mir1
-rw-r--r--tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff2
-rw-r--r--tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff1
-rw-r--r--tests/mir-opt/issue_101973.inner.ConstProp.diff2
-rw-r--r--tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff1
-rw-r--r--tests/mir-opt/simplify_match.main.ConstProp.diff1
-rw-r--r--tests/mir-opt/slice_filter.variant_a-{closure#0}.CopyProp.diff44
-rw-r--r--tests/mir-opt/slice_filter.variant_a-{closure#0}.DestinationPropagation.diff264
-rw-r--r--tests/mir-opt/slice_filter.variant_b-{closure#0}.CopyProp.diff8
-rw-r--r--tests/mir-opt/slice_filter.variant_b-{closure#0}.DestinationPropagation.diff4
-rw-r--r--tests/mir-opt/try_identity_e2e.new.PreCodegen.after.mir4
-rw-r--r--tests/mir-opt/try_identity_e2e.old.PreCodegen.after.mir2
21 files changed, 329 insertions, 168 deletions
diff --git a/compiler/rustc_mir_transform/src/copy_prop.rs b/compiler/rustc_mir_transform/src/copy_prop.rs
index 58211bc795f..182b3015dd7 100644
--- a/compiler/rustc_mir_transform/src/copy_prop.rs
+++ b/compiler/rustc_mir_transform/src/copy_prop.rs
@@ -3,6 +3,7 @@ use rustc_index::vec::IndexVec;
 use rustc_middle::mir::visit::*;
 use rustc_middle::mir::*;
 use rustc_middle::ty::TyCtxt;
+use rustc_mir_dataflow::impls::borrowed_locals;
 
 use crate::ssa::SsaLocals;
 use crate::MirPass;
@@ -33,7 +34,8 @@ impl<'tcx> MirPass<'tcx> for CopyProp {
 
 fn propagate_ssa<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
     let param_env = tcx.param_env_reveal_all_normalized(body.source.def_id());
-    let ssa = SsaLocals::new(tcx, param_env, body);
+    let borrowed_locals = borrowed_locals(body);
+    let ssa = SsaLocals::new(tcx, param_env, body, &borrowed_locals);
 
     let fully_moved = fully_moved_locals(&ssa, body);
     debug!(?fully_moved);
@@ -42,14 +44,19 @@ fn propagate_ssa<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
     for (local, &head) in ssa.copy_classes().iter_enumerated() {
         if local != head {
             storage_to_remove.insert(head);
-            storage_to_remove.insert(local);
         }
     }
 
     let any_replacement = ssa.copy_classes().iter_enumerated().any(|(l, &h)| l != h);
 
-    Replacer { tcx, copy_classes: &ssa.copy_classes(), fully_moved, storage_to_remove }
-        .visit_body_preserves_cfg(body);
+    Replacer {
+        tcx,
+        copy_classes: &ssa.copy_classes(),
+        fully_moved,
+        borrowed_locals,
+        storage_to_remove,
+    }
+    .visit_body_preserves_cfg(body);
 
     if any_replacement {
         crate::simplify::remove_unused_definitions(body);
@@ -94,6 +101,7 @@ struct Replacer<'a, 'tcx> {
     tcx: TyCtxt<'tcx>,
     fully_moved: BitSet<Local>,
     storage_to_remove: BitSet<Local>,
+    borrowed_locals: BitSet<Local>,
     copy_classes: &'a IndexVec<Local, Local>,
 }
 
@@ -102,8 +110,45 @@ impl<'tcx> MutVisitor<'tcx> for Replacer<'_, 'tcx> {
         self.tcx
     }
 
-    fn visit_local(&mut self, local: &mut Local, _: PlaceContext, _: Location) {
-        *local = self.copy_classes[*local];
+    fn visit_local(&mut self, local: &mut Local, ctxt: PlaceContext, _: Location) {
+        let new_local = self.copy_classes[*local];
+        match ctxt {
+            // Do not modify the local in storage statements.
+            PlaceContext::NonUse(NonUseContext::StorageLive | NonUseContext::StorageDead) => {}
+            // The local should have been marked as non-SSA.
+            PlaceContext::MutatingUse(_) => assert_eq!(*local, new_local),
+            // We access the value.
+            _ => *local = new_local,
+        }
+    }
+
+    fn visit_place(&mut self, place: &mut Place<'tcx>, ctxt: PlaceContext, loc: Location) {
+        if let Some(new_projection) = self.process_projection(&place.projection, loc) {
+            place.projection = self.tcx().intern_place_elems(&new_projection);
+        }
+
+        let observes_address = match ctxt {
+            PlaceContext::NonMutatingUse(
+                NonMutatingUseContext::SharedBorrow
+                | NonMutatingUseContext::ShallowBorrow
+                | NonMutatingUseContext::UniqueBorrow
+                | NonMutatingUseContext::AddressOf,
+            ) => true,
+            // For debuginfo, merging locals is ok.
+            PlaceContext::NonUse(NonUseContext::VarDebugInfo) => {
+                self.borrowed_locals.contains(place.local)
+            }
+            _ => false,
+        };
+        if observes_address && !place.is_indirect() {
+            // We observe the address of `place.local`. Do not replace it.
+        } else {
+            self.visit_local(
+                &mut place.local,
+                PlaceContext::NonMutatingUse(NonMutatingUseContext::Copy),
+                loc,
+            )
+        }
     }
 
     fn visit_operand(&mut self, operand: &mut Operand<'tcx>, loc: Location) {
@@ -117,17 +162,17 @@ impl<'tcx> MutVisitor<'tcx> for Replacer<'_, 'tcx> {
     }
 
     fn visit_statement(&mut self, stmt: &mut Statement<'tcx>, loc: Location) {
-        if let StatementKind::StorageLive(l) | StatementKind::StorageDead(l) = stmt.kind
+        if let StatementKind::StorageDead(l) = stmt.kind
             && self.storage_to_remove.contains(l)
         {
             stmt.make_nop();
-        }
-        if let StatementKind::Assign(box (ref place, _)) = stmt.kind
-            && let Some(l) = place.as_local()
-            && self.copy_classes[l] != l
+        } else if let StatementKind::Assign(box (ref place, ref mut rvalue)) = stmt.kind
+            && place.as_local().is_some()
         {
-            stmt.make_nop();
+            // Do not replace assignments.
+            self.visit_rvalue(rvalue, loc)
+        } else {
+            self.super_statement(stmt, loc);
         }
-        self.super_statement(stmt, loc);
     }
 }
diff --git a/compiler/rustc_mir_transform/src/ssa.rs b/compiler/rustc_mir_transform/src/ssa.rs
index a5ae671be81..b6e0c6e6150 100644
--- a/compiler/rustc_mir_transform/src/ssa.rs
+++ b/compiler/rustc_mir_transform/src/ssa.rs
@@ -6,7 +6,6 @@ use rustc_middle::middle::resolve_lifetime::Set1;
 use rustc_middle::mir::visit::*;
 use rustc_middle::mir::*;
 use rustc_middle::ty::{ParamEnv, TyCtxt};
-use rustc_mir_dataflow::impls::borrowed_locals;
 
 #[derive(Debug)]
 pub struct SsaLocals {
@@ -21,19 +20,23 @@ pub struct SsaLocals {
 }
 
 impl SsaLocals {
-    pub fn new<'tcx>(tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>, body: &Body<'tcx>) -> SsaLocals {
+    pub fn new<'tcx>(
+        tcx: TyCtxt<'tcx>,
+        param_env: ParamEnv<'tcx>,
+        body: &Body<'tcx>,
+        borrowed_locals: &BitSet<Local>,
+    ) -> SsaLocals {
         let assignment_order = Vec::new();
 
         let assignments = IndexVec::from_elem(Set1::Empty, &body.local_decls);
         let dominators = body.basic_blocks.dominators();
         let mut visitor = SsaVisitor { assignments, assignment_order, dominators };
 
-        let borrowed = borrowed_locals(body);
         for (local, decl) in body.local_decls.iter_enumerated() {
             if matches!(body.local_kind(local), LocalKind::Arg) {
                 visitor.assignments[local] = Set1::One(LocationExtended::Arg);
             }
-            if borrowed.contains(local) && !decl.ty.is_freeze(tcx, param_env) {
+            if borrowed_locals.contains(local) && !decl.ty.is_freeze(tcx, param_env) {
                 visitor.assignments[local] = Set1::Many;
             }
         }
diff --git a/tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff b/tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff
index 4405b55875e..5e587be1f16 100644
--- a/tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff
+++ b/tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff
@@ -56,8 +56,11 @@
       }
   
       bb0: {
+          StorageLive(_1);                 // scope 0 at $DIR/const_debuginfo.rs:+1:9: +1:10
           _1 = const 1_u8;                 // scope 0 at $DIR/const_debuginfo.rs:+1:13: +1:16
+          StorageLive(_2);                 // scope 1 at $DIR/const_debuginfo.rs:+2:9: +2:10
           _2 = const 2_u8;                 // scope 1 at $DIR/const_debuginfo.rs:+2:13: +2:16
+          StorageLive(_3);                 // scope 2 at $DIR/const_debuginfo.rs:+3:9: +3:10
           _3 = const 3_u8;                 // scope 2 at $DIR/const_debuginfo.rs:+3:13: +3:16
           StorageLive(_4);                 // scope 3 at $DIR/const_debuginfo.rs:+4:9: +4:12
           StorageLive(_5);                 // scope 3 at $DIR/const_debuginfo.rs:+4:15: +4:20
diff --git a/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff b/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff
index ae9ffd519a1..e085a88b2da 100644
--- a/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/bad_op_mod_by_zero.main.ConstProp.diff
@@ -18,6 +18,7 @@
       }
   
       bb0: {
+          StorageLive(_1);                 // scope 0 at $DIR/bad_op_mod_by_zero.rs:+1:9: +1:10
           _1 = const 0_i32;                // scope 0 at $DIR/bad_op_mod_by_zero.rs:+1:13: +1:14
           StorageLive(_2);                 // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:9: +2:11
 -         _4 = Eq(_1, const 0_i32);        // scope 1 at $DIR/bad_op_mod_by_zero.rs:+2:14: +2:19
diff --git a/tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.diff b/tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.diff
index 22f710387db..e3f5b120a32 100644
--- a/tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/scalar_literal_propagation.main.ConstProp.diff
@@ -11,6 +11,7 @@
       }
   
       bb0: {
+          StorageLive(_1);                 // scope 0 at $DIR/scalar_literal_propagation.rs:+1:9: +1:10
           _1 = const 1_u32;                // scope 0 at $DIR/scalar_literal_propagation.rs:+1:13: +1:14
           StorageLive(_2);                 // scope 1 at $DIR/scalar_literal_propagation.rs:+2:5: +2:15
 -         _2 = consume(_1) -> bb1;         // scope 1 at $DIR/scalar_literal_propagation.rs:+2:5: +2:15
diff --git a/tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.diff b/tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.diff
new file mode 100644
index 00000000000..b183865a9bc
--- /dev/null
+++ b/tests/mir-opt/copy-prop/borrowed_local.f.CopyProp.diff
@@ -0,0 +1,34 @@
+- // MIR for `f` before CopyProp
++ // MIR for `f` after CopyProp
+  
+  fn f() -> bool {
+      let mut _0: bool;                    // return place in scope 0 at $DIR/borrowed_local.rs:+0:11: +0:15
+      let mut _1: u8;                      // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+      let mut _2: &u8;                     // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+      let mut _3: u8;                      // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+      let mut _4: &u8;                     // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+  
+      bb0: {
+          _1 = const 5_u8;                 // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+          _2 = &_1;                        // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+          _3 = _1;                         // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+          _4 = &_3;                        // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+          _0 = cmp_ref(_2, _4) -> bb1;     // scope 0 at $DIR/borrowed_local.rs:+8:13: +8:45
+                                           // mir::Constant
+                                           // + span: $DIR/borrowed_local.rs:23:29: 23:36
+                                           // + literal: Const { ty: for<'a, 'b> fn(&'a u8, &'b u8) -> bool {cmp_ref}, val: Value(<ZST>) }
+      }
+  
+      bb1: {
+-         _0 = opaque::<u8>(_3) -> bb2;    // scope 0 at $DIR/borrowed_local.rs:+12:13: +12:38
++         _0 = opaque::<u8>(_1) -> bb2;    // scope 0 at $DIR/borrowed_local.rs:+12:13: +12:38
+                                           // mir::Constant
+                                           // + span: $DIR/borrowed_local.rs:27:28: 27:34
+                                           // + literal: Const { ty: fn(u8) -> bool {opaque::<u8>}, val: Value(<ZST>) }
+      }
+  
+      bb2: {
+          return;                          // scope 0 at $DIR/borrowed_local.rs:+15:13: +15:21
+      }
+  }
+  
diff --git a/tests/mir-opt/copy-prop/borrowed_local.rs b/tests/mir-opt/copy-prop/borrowed_local.rs
new file mode 100644
index 00000000000..c4b980e2b35
--- /dev/null
+++ b/tests/mir-opt/copy-prop/borrowed_local.rs
@@ -0,0 +1,39 @@
+// unit-test: CopyProp
+
+#![feature(custom_mir, core_intrinsics)]
+#![allow(unused_assignments)]
+extern crate core;
+use core::intrinsics::mir::*;
+
+fn opaque(_: impl Sized) -> bool { true }
+
+fn cmp_ref(a: &u8, b: &u8) -> bool {
+    std::ptr::eq(a as *const u8, b as *const u8)
+}
+
+#[custom_mir(dialect = "analysis", phase = "post-cleanup")]
+fn f() -> bool {
+    mir!(
+        {
+            let a = 5_u8;
+            let r1 = &a;
+            let b = a;
+            // We cannot propagate the place `a`.
+            let r2 = &b;
+            Call(RET, next, cmp_ref(r1, r2))
+        }
+        next = {
+            // But we can propagate the value `a`.
+            Call(RET, ret, opaque(b))
+        }
+        ret = {
+            Return()
+        }
+    )
+}
+
+fn main() {
+    assert!(!f());
+}
+
+// EMIT_MIR borrowed_local.f.CopyProp.diff
diff --git a/tests/mir-opt/copy-prop/cycle.main.CopyProp.diff b/tests/mir-opt/copy-prop/cycle.main.CopyProp.diff
index 3e61869e82f..bc5083e1ad0 100644
--- a/tests/mir-opt/copy-prop/cycle.main.CopyProp.diff
+++ b/tests/mir-opt/copy-prop/cycle.main.CopyProp.diff
@@ -29,7 +29,7 @@
       }
   
       bb1: {
--         StorageLive(_2);                 // scope 1 at $DIR/cycle.rs:+2:9: +2:10
+          StorageLive(_2);                 // scope 1 at $DIR/cycle.rs:+2:9: +2:10
           _2 = _1;                         // scope 1 at $DIR/cycle.rs:+2:13: +2:14
 -         StorageLive(_3);                 // scope 2 at $DIR/cycle.rs:+3:9: +3:10
 -         _3 = _2;                         // scope 2 at $DIR/cycle.rs:+3:13: +3:14
diff --git a/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.mir b/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.mir
index d48b04e2de2..918817da56c 100644
--- a/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.mir
+++ b/tests/mir-opt/copy-prop/dead_stores_79191.f.CopyProp.after.mir
@@ -11,6 +11,7 @@ fn f(_1: usize) -> usize {
     }
 
     bb0: {
+        StorageLive(_2);                 // scope 0 at $DIR/dead_stores_79191.rs:+1:9: +1:10
         _2 = _1;                         // scope 0 at $DIR/dead_stores_79191.rs:+1:13: +1:14
         _1 = const 5_usize;              // scope 1 at $DIR/dead_stores_79191.rs:+2:5: +2:10
         _1 = _2;                         // scope 1 at $DIR/dead_stores_79191.rs:+3:5: +3:10
diff --git a/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.mir b/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.mir
index 727791f50a4..cf21fadd437 100644
--- a/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.mir
+++ b/tests/mir-opt/copy-prop/dead_stores_better.f.CopyProp.after.mir
@@ -11,6 +11,7 @@ fn f(_1: usize) -> usize {
     }
 
     bb0: {
+        StorageLive(_2);                 // scope 0 at $DIR/dead_stores_better.rs:+1:9: +1:10
         _2 = _1;                         // scope 0 at $DIR/dead_stores_better.rs:+1:13: +1:14
         _1 = const 5_usize;              // scope 1 at $DIR/dead_stores_better.rs:+2:5: +2:10
         _1 = _2;                         // scope 1 at $DIR/dead_stores_better.rs:+3:5: +3:10
diff --git a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff
index 9c3f87f47c1..6870d7d6c45 100644
--- a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff
+++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.diff
@@ -16,7 +16,9 @@
       }
   
       bb0: {
+          StorageLive(_1);                 // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
           _1 = const u8::MAX;              // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
+          StorageLive(_2);                 // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
           _2 = const 1_u8;                 // scope 0 at $DIR/inherit_overflow.rs:+3:13: +3:47
           _5 = CheckedAdd(const u8::MAX, const 1_u8); // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
           assert(!move (_5.1: bool), "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> bb1; // scope 2 at $SRC_DIR/core/src/ops/arith.rs:LL:COL
diff --git a/tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff b/tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
index 7c5d28069d5..df9f8dcf1a4 100644
--- a/tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
+++ b/tests/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
@@ -79,6 +79,7 @@
       }
   
       bb6: {
+          StorageLive(_10);                // scope 3 at $DIR/funky_arms.rs:+13:17: +13:26
           _10 = ((_7 as Some).0: usize);   // scope 3 at $DIR/funky_arms.rs:+13:17: +13:26
           StorageLive(_11);                // scope 3 at $DIR/funky_arms.rs:+15:43: +15:46
           _11 = &mut (*_1);                // scope 3 at $DIR/funky_arms.rs:+15:43: +15:46
diff --git a/tests/mir-opt/issue_101973.inner.ConstProp.diff b/tests/mir-opt/issue_101973.inner.ConstProp.diff
index 002392c5cf8..30bf2c0684e 100644
--- a/tests/mir-opt/issue_101973.inner.ConstProp.diff
+++ b/tests/mir-opt/issue_101973.inner.ConstProp.diff
@@ -33,6 +33,7 @@
       bb0: {
           StorageLive(_2);                 // scope 0 at $DIR/issue_101973.rs:+1:5: +1:65
           StorageLive(_3);                 // scope 0 at $DIR/issue_101973.rs:+1:5: +1:58
+          StorageLive(_4);                 // scope 0 at $DIR/issue_101973.rs:+1:5: +1:17
           StorageLive(_12);                // scope 2 at $DIR/issue_101973.rs:7:12: 7:27
           StorageLive(_13);                // scope 2 at $DIR/issue_101973.rs:7:12: 7:20
           _14 = CheckedShr(_1, const 0_i32); // scope 2 at $DIR/issue_101973.rs:7:12: 7:20
@@ -62,6 +63,7 @@
           StorageDead(_13);                // scope 2 at $DIR/issue_101973.rs:7:26: 7:27
           _4 = BitOr(const 0_u32, move _12); // scope 2 at $DIR/issue_101973.rs:7:5: 7:27
           StorageDead(_12);                // scope 2 at $DIR/issue_101973.rs:7:26: 7:27
+          StorageLive(_6);                 // scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
           StorageLive(_7);                 // scope 0 at $DIR/issue_101973.rs:+1:31: +1:52
           StorageLive(_8);                 // scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
           _10 = CheckedShr(_1, const 8_i32); // scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
diff --git a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff
index cc4f7cc0699..c14780052fb 100644
--- a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff
+++ b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff
@@ -29,6 +29,7 @@
   
       bb0: {
           StorageLive(_2);                 // scope 0 at $DIR/issue_76432.rs:+1:9: +1:10
+          StorageLive(_4);                 // scope 0 at $DIR/issue_76432.rs:+1:19: +1:29
           StorageLive(_5);                 // scope 0 at $DIR/issue_76432.rs:+1:20: +1:29
           _5 = [_1, _1, _1];               // scope 0 at $DIR/issue_76432.rs:+1:20: +1:29
           _4 = &_5;                        // scope 0 at $DIR/issue_76432.rs:+1:19: +1:29
diff --git a/tests/mir-opt/simplify_match.main.ConstProp.diff b/tests/mir-opt/simplify_match.main.ConstProp.diff
index b700adfb105..35ffc4963cb 100644
--- a/tests/mir-opt/simplify_match.main.ConstProp.diff
+++ b/tests/mir-opt/simplify_match.main.ConstProp.diff
@@ -10,6 +10,7 @@
       }
   
       bb0: {
+          StorageLive(_2);                 // scope 0 at $DIR/simplify_match.rs:+1:17: +1:18
           _2 = const false;                // scope 0 at $DIR/simplify_match.rs:+1:21: +1:26
 -         switchInt(_2) -> [0: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:+1:5: +1:31
 +         switchInt(const false) -> [0: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:+1:5: +1:31
diff --git a/tests/mir-opt/slice_filter.variant_a-{closure#0}.CopyProp.diff b/tests/mir-opt/slice_filter.variant_a-{closure#0}.CopyProp.diff
index ca8c04c386f..d1f6fd97dc7 100644
--- a/tests/mir-opt/slice_filter.variant_a-{closure#0}.CopyProp.diff
+++ b/tests/mir-opt/slice_filter.variant_a-{closure#0}.CopyProp.diff
@@ -101,16 +101,16 @@
       }
   
       bb0: {
--         StorageLive(_3);                 // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
+          StorageLive(_3);                 // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
           _25 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
           _3 = &((*_25).0: usize);         // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
--         StorageLive(_4);                 // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
+          StorageLive(_4);                 // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
           _26 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
           _4 = &((*_26).1: usize);         // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
--         StorageLive(_5);                 // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
+          StorageLive(_5);                 // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
           _27 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
           _5 = &((*_27).2: usize);         // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
--         StorageLive(_6);                 // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
+          StorageLive(_6);                 // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
           _28 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
           _6 = &((*_28).3: usize);         // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
           StorageLive(_7);                 // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
@@ -118,11 +118,10 @@
           StorageLive(_9);                 // scope 1 at $DIR/slice_filter.rs:+0:40: +0:41
           _9 = &_3;                        // scope 1 at $DIR/slice_filter.rs:+0:40: +0:41
           StorageLive(_10);                // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
--         StorageLive(_11);                // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
--         _11 = _5;                        // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
--         _10 = &_11;                      // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
+          StorageLive(_11);                // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
+          _11 = _5;                        // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
+          _10 = &_11;                      // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
 -         StorageLive(_29);                // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+         _10 = &_5;                       // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
           _31 = deref_copy (*_9);          // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
 -         _29 = _31;                       // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
 -         StorageLive(_30);                // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
@@ -139,7 +138,7 @@
           StorageDead(_33);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
 -         StorageDead(_30);                // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
 -         StorageDead(_29);                // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
--         StorageDead(_11);                // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
+          StorageDead(_11);                // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
           StorageDead(_10);                // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
           StorageDead(_9);                 // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
           switchInt(move _8) -> [0: bb4, otherwise: bb5]; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
@@ -156,11 +155,10 @@
           StorageLive(_18);                // scope 1 at $DIR/slice_filter.rs:+0:60: +0:61
           _18 = &_5;                       // scope 1 at $DIR/slice_filter.rs:+0:60: +0:61
           StorageLive(_19);                // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
--         StorageLive(_20);                // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
--         _20 = _3;                        // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
--         _19 = &_20;                      // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
+          StorageLive(_20);                // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
+          _20 = _3;                        // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
+          _19 = &_20;                      // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
 -         StorageLive(_35);                // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+         _19 = &_3;                       // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
           _37 = deref_copy (*_18);         // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
 -         _35 = _37;                       // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
 -         StorageLive(_36);                // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
@@ -177,7 +175,7 @@
           StorageDead(_39);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
 -         StorageDead(_36);                // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
 -         StorageDead(_35);                // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
--         StorageDead(_20);                // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
+          StorageDead(_20);                // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
           StorageDead(_19);                // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
           StorageDead(_18);                // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
           switchInt(move _17) -> [0: bb6, otherwise: bb7]; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
@@ -205,11 +203,10 @@
           StorageLive(_13);                // scope 1 at $DIR/slice_filter.rs:+0:50: +0:51
           _13 = &_6;                       // scope 1 at $DIR/slice_filter.rs:+0:50: +0:51
           StorageLive(_14);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
--         StorageLive(_15);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
--         _15 = _4;                        // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
--         _14 = &_15;                      // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
+          StorageLive(_15);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
+          _15 = _4;                        // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
+          _14 = &_15;                      // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
 -         StorageLive(_41);                // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+         _14 = &_4;                       // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
           _43 = deref_copy (*_13);         // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
 -         _41 = _43;                       // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
 -         StorageLive(_42);                // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
@@ -226,7 +223,7 @@
           StorageDead(_45);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
 -         StorageDead(_42);                // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
 -         StorageDead(_41);                // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
--         StorageDead(_15);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
+          StorageDead(_15);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
           StorageDead(_14);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
           StorageDead(_13);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
           _7 = move _12;                   // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
@@ -245,11 +242,10 @@
           StorageLive(_22);                // scope 1 at $DIR/slice_filter.rs:+0:70: +0:71
           _22 = &_4;                       // scope 1 at $DIR/slice_filter.rs:+0:70: +0:71
           StorageLive(_23);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
--         StorageLive(_24);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
--         _24 = _6;                        // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
--         _23 = &_24;                      // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
+          StorageLive(_24);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
+          _24 = _6;                        // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
+          _23 = &_24;                      // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
 -         StorageLive(_47);                // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+         _23 = &_6;                       // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
           _49 = deref_copy (*_22);         // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
 -         _47 = _49;                       // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
 -         StorageLive(_48);                // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
@@ -266,7 +262,7 @@
           StorageDead(_51);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
 -         StorageDead(_48);                // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
 -         StorageDead(_47);                // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
--         StorageDead(_24);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
+          StorageDead(_24);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
           StorageDead(_23);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
           StorageDead(_22);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
           _16 = move _21;                  // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
diff --git a/tests/mir-opt/slice_filter.variant_a-{closure#0}.DestinationPropagation.diff b/tests/mir-opt/slice_filter.variant_a-{closure#0}.DestinationPropagation.diff
index 30b49158b4f..259cd411896 100644
--- a/tests/mir-opt/slice_filter.variant_a-{closure#0}.DestinationPropagation.diff
+++ b/tests/mir-opt/slice_filter.variant_a-{closure#0}.DestinationPropagation.diff
@@ -11,20 +11,24 @@
       let mut _8: bool;                    // in scope 0 at $DIR/slice_filter.rs:+0:40: +0:46
       let mut _9: &&usize;                 // in scope 0 at $DIR/slice_filter.rs:+0:40: +0:41
       let mut _10: &&usize;                // in scope 0 at $DIR/slice_filter.rs:+0:45: +0:46
-      let mut _11: bool;                   // in scope 0 at $DIR/slice_filter.rs:+0:50: +0:56
-      let mut _12: &&usize;                // in scope 0 at $DIR/slice_filter.rs:+0:50: +0:51
-      let mut _13: &&usize;                // in scope 0 at $DIR/slice_filter.rs:+0:55: +0:56
-      let mut _14: bool;                   // in scope 0 at $DIR/slice_filter.rs:+0:60: +0:76
-      let mut _15: bool;                   // in scope 0 at $DIR/slice_filter.rs:+0:60: +0:66
-      let mut _16: &&usize;                // in scope 0 at $DIR/slice_filter.rs:+0:60: +0:61
-      let mut _17: &&usize;                // in scope 0 at $DIR/slice_filter.rs:+0:65: +0:66
-      let mut _18: bool;                   // in scope 0 at $DIR/slice_filter.rs:+0:70: +0:76
-      let mut _19: &&usize;                // in scope 0 at $DIR/slice_filter.rs:+0:70: +0:71
-      let mut _20: &&usize;                // in scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
-      let mut _21: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
-      let mut _22: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
-      let mut _23: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
-      let mut _24: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
+      let _11: &usize;                     // in scope 0 at $DIR/slice_filter.rs:+0:45: +0:46
+      let mut _12: bool;                   // in scope 0 at $DIR/slice_filter.rs:+0:50: +0:56
+      let mut _13: &&usize;                // in scope 0 at $DIR/slice_filter.rs:+0:50: +0:51
+      let mut _14: &&usize;                // in scope 0 at $DIR/slice_filter.rs:+0:55: +0:56
+      let _15: &usize;                     // in scope 0 at $DIR/slice_filter.rs:+0:55: +0:56
+      let mut _16: bool;                   // in scope 0 at $DIR/slice_filter.rs:+0:60: +0:76
+      let mut _17: bool;                   // in scope 0 at $DIR/slice_filter.rs:+0:60: +0:66
+      let mut _18: &&usize;                // in scope 0 at $DIR/slice_filter.rs:+0:60: +0:61
+      let mut _19: &&usize;                // in scope 0 at $DIR/slice_filter.rs:+0:65: +0:66
+      let _20: &usize;                     // in scope 0 at $DIR/slice_filter.rs:+0:65: +0:66
+      let mut _21: bool;                   // in scope 0 at $DIR/slice_filter.rs:+0:70: +0:76
+      let mut _22: &&usize;                // in scope 0 at $DIR/slice_filter.rs:+0:70: +0:71
+      let mut _23: &&usize;                // in scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
+      let _24: &usize;                     // in scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
+      let mut _25: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
+      let mut _26: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
+      let mut _27: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
+      let mut _28: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
       scope 1 {
           debug a => _3;                   // in scope 1 at $DIR/slice_filter.rs:+0:27: +0:28
           debug b => _4;                   // in scope 1 at $DIR/slice_filter.rs:+0:30: +0:31
@@ -33,78 +37,85 @@
           scope 2 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:40: 8:46
               debug self => _9;            // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
               debug other => _10;          // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              let mut _25: &usize;         // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              let mut _26: &usize;         // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              let mut _29: &usize;         // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              let mut _30: &usize;         // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
               scope 3 (inlined cmp::impls::<impl PartialOrd for usize>::le) { // at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  debug self => _25;       // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  debug other => _26;      // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  let mut _27: usize;      // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  let mut _28: usize;      // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  debug self => _29;       // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  debug other => _30;      // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  let mut _31: usize;      // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  let mut _32: usize;      // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
               }
           }
           scope 4 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:60: 8:66
-              debug self => _16;           // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              debug other => _17;          // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              let mut _29: &usize;         // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              let mut _30: &usize;         // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              debug self => _18;           // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              debug other => _19;          // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              let mut _33: &usize;         // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              let mut _34: &usize;         // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
               scope 5 (inlined cmp::impls::<impl PartialOrd for usize>::le) { // at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  debug self => _29;       // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  debug other => _30;      // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  let mut _31: usize;      // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  let mut _32: usize;      // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  debug self => _33;       // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  debug other => _34;      // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  let mut _35: usize;      // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  let mut _36: usize;      // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
               }
           }
           scope 6 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:50: 8:56
-              debug self => _12;           // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              debug other => _13;          // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              let mut _33: &usize;         // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              let mut _34: &usize;         // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              debug self => _13;           // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              debug other => _14;          // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              let mut _37: &usize;         // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              let mut _38: &usize;         // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
               scope 7 (inlined cmp::impls::<impl PartialOrd for usize>::le) { // at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  debug self => _33;       // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  debug other => _34;      // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  let mut _35: usize;      // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  let mut _36: usize;      // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  debug self => _37;       // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  debug other => _38;      // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  let mut _39: usize;      // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  let mut _40: usize;      // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
               }
           }
           scope 8 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:70: 8:76
-              debug self => _19;           // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              debug other => _20;          // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              let mut _37: &usize;         // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              let mut _38: &usize;         // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              debug self => _22;           // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              debug other => _23;          // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              let mut _41: &usize;         // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              let mut _42: &usize;         // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
               scope 9 (inlined cmp::impls::<impl PartialOrd for usize>::le) { // at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  debug self => _37;       // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  debug other => _38;      // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  let mut _39: usize;      // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  let mut _40: usize;      // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  debug self => _41;       // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  debug other => _42;      // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  let mut _43: usize;      // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  let mut _44: usize;      // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
               }
           }
       }
   
       bb0: {
-          _21 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
-          _3 = &((*_21).0: usize);         // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
-          _22 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
-          _4 = &((*_22).1: usize);         // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
-          _23 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
-          _5 = &((*_23).2: usize);         // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
-          _24 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
-          _6 = &((*_24).3: usize);         // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
+          StorageLive(_3);                 // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
+          _25 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
+          _3 = &((*_25).0: usize);         // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
+          StorageLive(_4);                 // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
+          _26 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
+          _4 = &((*_26).1: usize);         // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
+          StorageLive(_5);                 // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
+          _27 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
+          _5 = &((*_27).2: usize);         // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
+          StorageLive(_6);                 // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
+          _28 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
+          _6 = &((*_28).3: usize);         // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
 -         StorageLive(_7);                 // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
 +         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
           StorageLive(_8);                 // scope 1 at $DIR/slice_filter.rs:+0:40: +0:46
           StorageLive(_9);                 // scope 1 at $DIR/slice_filter.rs:+0:40: +0:41
           _9 = &_3;                        // scope 1 at $DIR/slice_filter.rs:+0:40: +0:41
           StorageLive(_10);                // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
-          _10 = &_5;                       // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
-          _25 = deref_copy (*_9);          // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _26 = deref_copy (*_10);         // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageLive(_27);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _27 = (*_25);                    // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageLive(_28);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _28 = (*_26);                    // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _8 = Le(move _27, move _28);     // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageDead(_28);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageDead(_27);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageLive(_11);                // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
+          _11 = _5;                        // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
+          _10 = &_11;                      // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
+          _29 = deref_copy (*_9);          // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _30 = deref_copy (*_10);         // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageLive(_31);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _31 = (*_29);                    // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageLive(_32);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _32 = (*_30);                    // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _8 = Le(move _31, move _32);     // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_32);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_31);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_11);                // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
           StorageDead(_10);                // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
           StorageDead(_9);                 // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
           switchInt(move _8) -> [0: bb4, otherwise: bb5]; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
@@ -116,29 +127,32 @@
       }
   
       bb2: {
--         StorageLive(_14);                // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
+-         StorageLive(_16);                // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
 +         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
-          StorageLive(_15);                // scope 1 at $DIR/slice_filter.rs:+0:60: +0:66
-          StorageLive(_16);                // scope 1 at $DIR/slice_filter.rs:+0:60: +0:61
-          _16 = &_5;                       // scope 1 at $DIR/slice_filter.rs:+0:60: +0:61
-          StorageLive(_17);                // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
-          _17 = &_3;                       // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
-          _29 = deref_copy (*_16);         // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _30 = deref_copy (*_17);         // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageLive(_31);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _31 = (*_29);                    // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageLive(_32);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _32 = (*_30);                    // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _15 = Le(move _31, move _32);    // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageDead(_32);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageDead(_31);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageDead(_17);                // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
-          StorageDead(_16);                // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
-          switchInt(move _15) -> [0: bb6, otherwise: bb7]; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
+          StorageLive(_17);                // scope 1 at $DIR/slice_filter.rs:+0:60: +0:66
+          StorageLive(_18);                // scope 1 at $DIR/slice_filter.rs:+0:60: +0:61
+          _18 = &_5;                       // scope 1 at $DIR/slice_filter.rs:+0:60: +0:61
+          StorageLive(_19);                // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
+          StorageLive(_20);                // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
+          _20 = _3;                        // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
+          _19 = &_20;                      // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
+          _33 = deref_copy (*_18);         // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _34 = deref_copy (*_19);         // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageLive(_35);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _35 = (*_33);                    // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageLive(_36);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _36 = (*_34);                    // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _17 = Le(move _35, move _36);    // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_36);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_35);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_20);                // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
+          StorageDead(_19);                // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
+          StorageDead(_18);                // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
+          switchInt(move _17) -> [0: bb6, otherwise: bb7]; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
       }
   
       bb3: {
--         StorageDead(_14);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
+-         StorageDead(_16);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
 -         StorageDead(_7);                 // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
 +         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
 +         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
@@ -146,74 +160,80 @@
       }
   
       bb4: {
--         StorageDead(_11);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
+-         StorageDead(_12);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
 +         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
           StorageDead(_8);                 // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
           goto -> bb2;                     // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
       }
   
       bb5: {
--         StorageLive(_11);                // scope 1 at $DIR/slice_filter.rs:+0:50: +0:56
+-         StorageLive(_12);                // scope 1 at $DIR/slice_filter.rs:+0:50: +0:56
 +         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:50: +0:56
-          StorageLive(_12);                // scope 1 at $DIR/slice_filter.rs:+0:50: +0:51
-          _12 = &_6;                       // scope 1 at $DIR/slice_filter.rs:+0:50: +0:51
-          StorageLive(_13);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
-          _13 = &_4;                       // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
-          _33 = deref_copy (*_12);         // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _34 = deref_copy (*_13);         // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageLive(_35);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _35 = (*_33);                    // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageLive(_36);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _36 = (*_34);                    // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _11 = Le(move _35, move _36);    // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageDead(_36);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageDead(_35);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageLive(_13);                // scope 1 at $DIR/slice_filter.rs:+0:50: +0:51
+          _13 = &_6;                       // scope 1 at $DIR/slice_filter.rs:+0:50: +0:51
+          StorageLive(_14);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
+          StorageLive(_15);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
+          _15 = _4;                        // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
+          _14 = &_15;                      // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
+          _37 = deref_copy (*_13);         // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _38 = deref_copy (*_14);         // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageLive(_39);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _39 = (*_37);                    // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageLive(_40);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _40 = (*_38);                    // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _12 = Le(move _39, move _40);    // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_40);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_39);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_15);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
+          StorageDead(_14);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
           StorageDead(_13);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
-          StorageDead(_12);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
--         _7 = move _11;                   // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
--         StorageDead(_11);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
+-         _7 = move _12;                   // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
+-         StorageDead(_12);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
 +         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
 +         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
           StorageDead(_8);                 // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
 -         switchInt(move _7) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
-+         switchInt(move _11) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
++         switchInt(move _12) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
       }
   
       bb6: {
--         _14 = const false;               // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
+-         _16 = const false;               // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
 +         _0 = const false;                // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
           goto -> bb8;                     // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
       }
   
       bb7: {
--         StorageLive(_18);                // scope 1 at $DIR/slice_filter.rs:+0:70: +0:76
+-         StorageLive(_21);                // scope 1 at $DIR/slice_filter.rs:+0:70: +0:76
 +         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:70: +0:76
-          StorageLive(_19);                // scope 1 at $DIR/slice_filter.rs:+0:70: +0:71
-          _19 = &_4;                       // scope 1 at $DIR/slice_filter.rs:+0:70: +0:71
-          StorageLive(_20);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
-          _20 = &_6;                       // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
-          _37 = deref_copy (*_19);         // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _38 = deref_copy (*_20);         // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageLive(_39);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _39 = (*_37);                    // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageLive(_40);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _40 = (*_38);                    // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
--         _18 = Le(move _39, move _40);    // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+         _0 = Le(move _39, move _40);     // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageDead(_40);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageDead(_39);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageDead(_20);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
-          StorageDead(_19);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
--         _14 = move _18;                  // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
+          StorageLive(_22);                // scope 1 at $DIR/slice_filter.rs:+0:70: +0:71
+          _22 = &_4;                       // scope 1 at $DIR/slice_filter.rs:+0:70: +0:71
+          StorageLive(_23);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
+          StorageLive(_24);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
+          _24 = _6;                        // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
+          _23 = &_24;                      // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
+          _41 = deref_copy (*_22);         // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _42 = deref_copy (*_23);         // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageLive(_43);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _43 = (*_41);                    // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageLive(_44);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _44 = (*_42);                    // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-         _21 = Le(move _43, move _44);    // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
++         _0 = Le(move _43, move _44);     // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_44);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_43);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_24);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
+          StorageDead(_23);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
+          StorageDead(_22);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
+-         _16 = move _21;                  // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
 +         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
           goto -> bb8;                     // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
       }
   
       bb8: {
--         StorageDead(_18);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
+-         StorageDead(_21);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
 +         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
-          StorageDead(_15);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
--         _0 = move _14;                   // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
+          StorageDead(_17);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
+-         _0 = move _16;                   // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
 +         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
           goto -> bb3;                     // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
       }
diff --git a/tests/mir-opt/slice_filter.variant_b-{closure#0}.CopyProp.diff b/tests/mir-opt/slice_filter.variant_b-{closure#0}.CopyProp.diff
index 5e4bdbdfa2e..c3b8e7d2eba 100644
--- a/tests/mir-opt/slice_filter.variant_b-{closure#0}.CopyProp.diff
+++ b/tests/mir-opt/slice_filter.variant_b-{closure#0}.CopyProp.diff
@@ -33,16 +33,16 @@
       }
   
       bb0: {
--         StorageLive(_3);                 // scope 0 at $DIR/slice_filter.rs:+0:29: +0:30
+          StorageLive(_3);                 // scope 0 at $DIR/slice_filter.rs:+0:29: +0:30
           _21 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:29: +0:30
           _3 = ((*_21).0: usize);          // scope 0 at $DIR/slice_filter.rs:+0:29: +0:30
--         StorageLive(_4);                 // scope 0 at $DIR/slice_filter.rs:+0:32: +0:33
+          StorageLive(_4);                 // scope 0 at $DIR/slice_filter.rs:+0:32: +0:33
           _22 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:32: +0:33
           _4 = ((*_22).1: usize);          // scope 0 at $DIR/slice_filter.rs:+0:32: +0:33
--         StorageLive(_5);                 // scope 0 at $DIR/slice_filter.rs:+0:35: +0:36
+          StorageLive(_5);                 // scope 0 at $DIR/slice_filter.rs:+0:35: +0:36
           _23 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:35: +0:36
           _5 = ((*_23).2: usize);          // scope 0 at $DIR/slice_filter.rs:+0:35: +0:36
--         StorageLive(_6);                 // scope 0 at $DIR/slice_filter.rs:+0:38: +0:39
+          StorageLive(_6);                 // scope 0 at $DIR/slice_filter.rs:+0:38: +0:39
           _24 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:38: +0:39
           _6 = ((*_24).3: usize);          // scope 0 at $DIR/slice_filter.rs:+0:38: +0:39
           StorageLive(_7);                 // scope 1 at $DIR/slice_filter.rs:+0:42: +0:58
diff --git a/tests/mir-opt/slice_filter.variant_b-{closure#0}.DestinationPropagation.diff b/tests/mir-opt/slice_filter.variant_b-{closure#0}.DestinationPropagation.diff
index 45af6600cd4..a43e84d29c7 100644
--- a/tests/mir-opt/slice_filter.variant_b-{closure#0}.DestinationPropagation.diff
+++ b/tests/mir-opt/slice_filter.variant_b-{closure#0}.DestinationPropagation.diff
@@ -25,12 +25,16 @@
       }
   
       bb0: {
+          StorageLive(_3);                 // scope 0 at $DIR/slice_filter.rs:+0:29: +0:30
           _13 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:29: +0:30
           _3 = ((*_13).0: usize);          // scope 0 at $DIR/slice_filter.rs:+0:29: +0:30
+          StorageLive(_4);                 // scope 0 at $DIR/slice_filter.rs:+0:32: +0:33
           _14 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:32: +0:33
           _4 = ((*_14).1: usize);          // scope 0 at $DIR/slice_filter.rs:+0:32: +0:33
+          StorageLive(_5);                 // scope 0 at $DIR/slice_filter.rs:+0:35: +0:36
           _15 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:35: +0:36
           _5 = ((*_15).2: usize);          // scope 0 at $DIR/slice_filter.rs:+0:35: +0:36
+          StorageLive(_6);                 // scope 0 at $DIR/slice_filter.rs:+0:38: +0:39
           _16 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:38: +0:39
           _6 = ((*_16).3: usize);          // scope 0 at $DIR/slice_filter.rs:+0:38: +0:39
 -         StorageLive(_7);                 // scope 1 at $DIR/slice_filter.rs:+0:42: +0:58
diff --git a/tests/mir-opt/try_identity_e2e.new.PreCodegen.after.mir b/tests/mir-opt/try_identity_e2e.new.PreCodegen.after.mir
index a4d2660ca6a..7c67d2abcf7 100644
--- a/tests/mir-opt/try_identity_e2e.new.PreCodegen.after.mir
+++ b/tests/mir-opt/try_identity_e2e.new.PreCodegen.after.mir
@@ -30,6 +30,7 @@ fn new(_1: Result<T, E>) -> Result<T, E> {
     }
 
     bb1: {
+        StorageLive(_5);                 // scope 0 at $DIR/try_identity_e2e.rs:+5:21: +5:22
         _5 = move ((_1 as Err).0: E);    // scope 0 at $DIR/try_identity_e2e.rs:+5:21: +5:22
         Deinit(_2);                      // scope 2 at $DIR/try_identity_e2e.rs:+5:27: +5:48
         ((_2 as Break).0: E) = move _5;  // scope 2 at $DIR/try_identity_e2e.rs:+5:27: +5:48
@@ -39,6 +40,7 @@ fn new(_1: Result<T, E>) -> Result<T, E> {
     }
 
     bb2: {
+        StorageLive(_4);                 // scope 0 at $DIR/try_identity_e2e.rs:+4:20: +4:21
         _4 = move ((_1 as Ok).0: T);     // scope 0 at $DIR/try_identity_e2e.rs:+4:20: +4:21
         Deinit(_2);                      // scope 1 at $DIR/try_identity_e2e.rs:+4:26: +4:50
         ((_2 as Continue).0: T) = move _4; // scope 1 at $DIR/try_identity_e2e.rs:+4:26: +4:50
@@ -48,6 +50,7 @@ fn new(_1: Result<T, E>) -> Result<T, E> {
     }
 
     bb3: {
+        StorageLive(_8);                 // scope 0 at $DIR/try_identity_e2e.rs:+9:32: +9:33
         _8 = move ((_2 as Break).0: E);  // scope 0 at $DIR/try_identity_e2e.rs:+9:32: +9:33
         Deinit(_0);                      // scope 4 at $DIR/try_identity_e2e.rs:+9:45: +9:51
         ((_0 as Err).0: E) = move _8;    // scope 4 at $DIR/try_identity_e2e.rs:+9:45: +9:51
@@ -61,6 +64,7 @@ fn new(_1: Result<T, E>) -> Result<T, E> {
     }
 
     bb5: {
+        StorageLive(_7);                 // scope 0 at $DIR/try_identity_e2e.rs:+8:35: +8:36
         _7 = move ((_2 as Continue).0: T); // scope 0 at $DIR/try_identity_e2e.rs:+8:35: +8:36
         Deinit(_0);                      // scope 0 at $DIR/try_identity_e2e.rs:+1:5: +11:6
         ((_0 as Ok).0: T) = move _7;     // scope 0 at $DIR/try_identity_e2e.rs:+1:5: +11:6
diff --git a/tests/mir-opt/try_identity_e2e.old.PreCodegen.after.mir b/tests/mir-opt/try_identity_e2e.old.PreCodegen.after.mir
index 37851c66a60..4a838e14026 100644
--- a/tests/mir-opt/try_identity_e2e.old.PreCodegen.after.mir
+++ b/tests/mir-opt/try_identity_e2e.old.PreCodegen.after.mir
@@ -19,6 +19,7 @@ fn old(_1: Result<T, E>) -> Result<T, E> {
     }
 
     bb1: {
+        StorageLive(_4);                 // scope 0 at $DIR/try_identity_e2e.rs:+4:17: +4:18
         _4 = move ((_1 as Err).0: E);    // scope 0 at $DIR/try_identity_e2e.rs:+4:17: +4:18
         Deinit(_0);                      // scope 2 at $DIR/try_identity_e2e.rs:+4:30: +4:36
         ((_0 as Err).0: E) = move _4;    // scope 2 at $DIR/try_identity_e2e.rs:+4:30: +4:36
@@ -31,6 +32,7 @@ fn old(_1: Result<T, E>) -> Result<T, E> {
     }
 
     bb3: {
+        StorageLive(_3);                 // scope 0 at $DIR/try_identity_e2e.rs:+3:16: +3:17
         _3 = move ((_1 as Ok).0: T);     // scope 0 at $DIR/try_identity_e2e.rs:+3:16: +3:17
         Deinit(_0);                      // scope 0 at $DIR/try_identity_e2e.rs:+1:5: +6:6
         ((_0 as Ok).0: T) = move _3;     // scope 0 at $DIR/try_identity_e2e.rs:+1:5: +6:6