about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-05-07 14:58:40 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-05-13 10:17:28 +0000
commit19652377c3f056aa0db32b8586e5a707b965a90d (patch)
tree1e68400801debbf1d36da6817ad501678033fe3b
parent25ef27759442b84c90af08dba348611b04d10654 (diff)
downloadrust-19652377c3f056aa0db32b8586e5a707b965a90d.tar.gz
rust-19652377c3f056aa0db32b8586e5a707b965a90d.zip
Iterate ReferencePropagation to fixpoint.
-rw-r--r--compiler/rustc_mir_transform/src/ref_prop.rs6
-rw-r--r--tests/mir-opt/reference_prop.debuginfo.ReferencePropagation.diff16
-rw-r--r--tests/mir-opt/reference_prop.dominate_storage.ReferencePropagation.diff2
-rw-r--r--tests/mir-opt/reference_prop.maybe_dead.ReferencePropagation.diff6
-rw-r--r--tests/mir-opt/reference_prop.multiple_storage.ReferencePropagation.diff2
-rw-r--r--tests/mir-opt/reference_prop.mut_raw_then_mut_shr.ReferencePropagation.diff7
-rw-r--r--tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff158
-rw-r--r--tests/mir-opt/reference_prop.reference_propagation_const_ptr.ReferencePropagation.diff186
-rw-r--r--tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff172
-rw-r--r--tests/mir-opt/reference_prop.reference_propagation_mut_ptr.ReferencePropagation.diff168
-rw-r--r--tests/mir-opt/reference_prop.rs72
-rw-r--r--tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff4
-rw-r--r--tests/mir-opt/slice_filter.variant_a-{closure#0}.DestinationPropagation.diff270
-rw-r--r--tests/mir-opt/slice_filter.variant_a-{closure#0}.ReferencePropagation.diff132
14 files changed, 801 insertions, 400 deletions
diff --git a/compiler/rustc_mir_transform/src/ref_prop.rs b/compiler/rustc_mir_transform/src/ref_prop.rs
index 0c5e7348e04..b0f89393989 100644
--- a/compiler/rustc_mir_transform/src/ref_prop.rs
+++ b/compiler/rustc_mir_transform/src/ref_prop.rs
@@ -77,11 +77,11 @@ impl<'tcx> MirPass<'tcx> for ReferencePropagation {
     #[instrument(level = "trace", skip(self, tcx, body))]
     fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
         debug!(def_id = ?body.source.def_id());
-        propagate_ssa(tcx, body);
+        while propagate_ssa(tcx, body) {}
     }
 }
 
-fn propagate_ssa<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
+fn propagate_ssa<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) -> bool {
     let ssa = SsaLocals::new(body);
 
     let mut replacer = compute_replacement(tcx, body, &ssa);
@@ -94,6 +94,8 @@ fn propagate_ssa<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
     if replacer.any_replacement {
         crate::simplify::remove_unused_definitions(body);
     }
+
+    replacer.any_replacement
 }
 
 #[derive(Copy, Clone, Debug, PartialEq, Eq)]
diff --git a/tests/mir-opt/reference_prop.debuginfo.ReferencePropagation.diff b/tests/mir-opt/reference_prop.debuginfo.ReferencePropagation.diff
index 94b8e6a7f2f..883a04171df 100644
--- a/tests/mir-opt/reference_prop.debuginfo.ReferencePropagation.diff
+++ b/tests/mir-opt/reference_prop.debuginfo.ReferencePropagation.diff
@@ -28,7 +28,7 @@
               let _5: &u8;                 // in scope 2 at $DIR/reference_prop.rs:+7:9: +7:17
               scope 3 {
 -                 debug reborrow => _5;    // in scope 3 at $DIR/reference_prop.rs:+7:9: +7:17
-+                 debug reborrow => _1;    // in scope 3 at $DIR/reference_prop.rs:+7:9: +7:17
++                 debug reborrow => &_2;   // in scope 3 at $DIR/reference_prop.rs:+7:9: +7:17
                   let _9: &i32;            // in scope 3 at $DIR/reference_prop.rs:+11:14: +11:31
                   let mut _22: &std::option::Option<i32>; // in scope 3 at $DIR/reference_prop.rs:+11:14: +11:31
                   scope 4 {
@@ -50,14 +50,14 @@
       }
   
       bb0: {
-          StorageLive(_1);                 // scope 0 at $DIR/reference_prop.rs:+3:9: +3:19
+-         StorageLive(_1);                 // scope 0 at $DIR/reference_prop.rs:+3:9: +3:19
           StorageLive(_2);                 // scope 0 at $DIR/reference_prop.rs:+3:27: +3:31
           _2 = const 5_u8;                 // scope 0 at $DIR/reference_prop.rs:+3:27: +3:31
-          _1 = &mut _2;                    // scope 0 at $DIR/reference_prop.rs:+3:22: +3:31
+-         _1 = &mut _2;                    // scope 0 at $DIR/reference_prop.rs:+3:22: +3:31
 -         StorageLive(_3);                 // scope 1 at $DIR/reference_prop.rs:+4:9: +4:14
           _23 = const _;                   // scope 1 at $DIR/reference_prop.rs:+4:17: +4:24
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:463:17: 463:24
+                                           // + span: $DIR/reference_prop.rs:535:17: 535:24
                                            // + literal: Const { ty: &T, val: Unevaluated(debuginfo, [], Some(promoted[2])) }
 -         _3 = &((*_23).0: u8);            // scope 1 at $DIR/reference_prop.rs:+4:17: +4:24
 -         StorageLive(_5);                 // scope 2 at $DIR/reference_prop.rs:+7:9: +7:17
@@ -73,7 +73,7 @@
 -         StorageLive(_9);                 // scope 3 at $DIR/reference_prop.rs:+11:14: +11:31
           _22 = const _;                   // scope 3 at $DIR/reference_prop.rs:+11:14: +11:31
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:470:14: 470:31
+                                           // + span: $DIR/reference_prop.rs:542:14: 542:31
                                            // + literal: Const { ty: &Option<i32>, val: Unevaluated(debuginfo, [], Some(promoted[1])) }
 -         _9 = &(((*_22) as Some).0: i32); // scope 3 at $DIR/reference_prop.rs:+11:14: +11:31
 -         _6 = const ();                   // scope 4 at $DIR/reference_prop.rs:+11:36: +11:38
@@ -98,14 +98,14 @@
           StorageLive(_12);                // scope 5 at $DIR/reference_prop.rs:+16:83: +16:90
           _21 = const _;                   // scope 5 at $DIR/reference_prop.rs:+16:83: +16:90
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:475:83: 475:90
+                                           // + span: $DIR/reference_prop.rs:547:83: 547:90
                                            // + literal: Const { ty: &[i32; 10], val: Unevaluated(debuginfo, [], Some(promoted[0])) }
           _12 = &(*_21);                   // scope 5 at $DIR/reference_prop.rs:+16:83: +16:90
           StorageLive(_14);                // scope 5 at $DIR/reference_prop.rs:+16:91: +16:93
           _14 = RangeFull;                 // scope 5 at $DIR/reference_prop.rs:+16:91: +16:93
           _11 = <[i32; 10] as Index<RangeFull>>::index(move _12, move _14) -> bb5; // scope 5 at $DIR/reference_prop.rs:+16:83: +16:94
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:475:83: 475:94
+                                           // + span: $DIR/reference_prop.rs:547:83: 547:94
                                            // + literal: Const { ty: for<'a> fn(&'a [i32; 10], RangeFull) -> &'a <[i32; 10] as Index<RangeFull>>::Output {<[i32; 10] as Index<RangeFull>>::index}, val: Value(<ZST>) }
       }
   
@@ -142,7 +142,7 @@
 -         StorageDead(_5);                 // scope 2 at $DIR/reference_prop.rs:+18:1: +18:2
 -         StorageDead(_3);                 // scope 1 at $DIR/reference_prop.rs:+18:1: +18:2
           StorageDead(_2);                 // scope 0 at $DIR/reference_prop.rs:+18:1: +18:2
-          StorageDead(_1);                 // scope 0 at $DIR/reference_prop.rs:+18:1: +18:2
+-         StorageDead(_1);                 // scope 0 at $DIR/reference_prop.rs:+18:1: +18:2
           StorageDead(_11);                // scope 0 at $DIR/reference_prop.rs:+18:1: +18:2
           StorageDead(_10);                // scope 0 at $DIR/reference_prop.rs:+18:1: +18:2
           return;                          // scope 0 at $DIR/reference_prop.rs:+18:2: +18:2
diff --git a/tests/mir-opt/reference_prop.dominate_storage.ReferencePropagation.diff b/tests/mir-opt/reference_prop.dominate_storage.ReferencePropagation.diff
index 8edc83cbf67..e158f64e9c3 100644
--- a/tests/mir-opt/reference_prop.dominate_storage.ReferencePropagation.diff
+++ b/tests/mir-opt/reference_prop.dominate_storage.ReferencePropagation.diff
@@ -24,7 +24,7 @@
           _5 = (*_2);                      // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
           _0 = opaque::<i32>(_5) -> bb3;   // scope 0 at $DIR/reference_prop.rs:+16:13: +16:38
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:383:28: 383:34
+                                           // + span: $DIR/reference_prop.rs:455:28: 455:34
                                            // + literal: Const { ty: fn(i32) {opaque::<i32>}, val: Value(<ZST>) }
       }
   
diff --git a/tests/mir-opt/reference_prop.maybe_dead.ReferencePropagation.diff b/tests/mir-opt/reference_prop.maybe_dead.ReferencePropagation.diff
index 920755bdd1d..38ab16cedb7 100644
--- a/tests/mir-opt/reference_prop.maybe_dead.ReferencePropagation.diff
+++ b/tests/mir-opt/reference_prop.maybe_dead.ReferencePropagation.diff
@@ -29,7 +29,7 @@
           StorageDead(_3);                 // scope 0 at $DIR/reference_prop.rs:+21:13: +21:27
           _0 = opaque::<i32>(_6) -> bb2;   // scope 0 at $DIR/reference_prop.rs:+22:13: +22:38
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:417:28: 417:34
+                                           // + span: $DIR/reference_prop.rs:489:28: 489:34
                                            // + literal: Const { ty: fn(i32) {opaque::<i32>}, val: Value(<ZST>) }
       }
   
@@ -37,7 +37,7 @@
           _7 = (*_4);                      // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
           _0 = opaque::<i32>(_7) -> bb3;   // scope 0 at $DIR/reference_prop.rs:+27:13: +27:38
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:422:28: 422:34
+                                           // + span: $DIR/reference_prop.rs:494:28: 494:34
                                            // + literal: Const { ty: fn(i32) {opaque::<i32>}, val: Value(<ZST>) }
       }
   
@@ -45,7 +45,7 @@
           _8 = (*_5);                      // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
           _0 = opaque::<i32>(_8) -> bb4;   // scope 0 at $DIR/reference_prop.rs:+33:13: +33:43
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:428:33: 428:39
+                                           // + span: $DIR/reference_prop.rs:500:33: 500:39
                                            // + literal: Const { ty: fn(i32) {opaque::<i32>}, val: Value(<ZST>) }
       }
   
diff --git a/tests/mir-opt/reference_prop.multiple_storage.ReferencePropagation.diff b/tests/mir-opt/reference_prop.multiple_storage.ReferencePropagation.diff
index 07bfdf0b2f1..6e451786870 100644
--- a/tests/mir-opt/reference_prop.multiple_storage.ReferencePropagation.diff
+++ b/tests/mir-opt/reference_prop.multiple_storage.ReferencePropagation.diff
@@ -16,7 +16,7 @@
           _3 = (*_2);                      // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
           _0 = opaque::<i32>(_3) -> bb1;   // scope 0 at $DIR/reference_prop.rs:+14:13: +14:43
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:357:33: 357:39
+                                           // + span: $DIR/reference_prop.rs:429:33: 429:39
                                            // + literal: Const { ty: fn(i32) {opaque::<i32>}, val: Value(<ZST>) }
       }
   
diff --git a/tests/mir-opt/reference_prop.mut_raw_then_mut_shr.ReferencePropagation.diff b/tests/mir-opt/reference_prop.mut_raw_then_mut_shr.ReferencePropagation.diff
index 09bc9dc7bcc..d99e110359f 100644
--- a/tests/mir-opt/reference_prop.mut_raw_then_mut_shr.ReferencePropagation.diff
+++ b/tests/mir-opt/reference_prop.mut_raw_then_mut_shr.ReferencePropagation.diff
@@ -18,11 +18,11 @@
               let _3: *mut i32;            // in scope 2 at $DIR/reference_prop.rs:+3:9: +3:13
               scope 3 {
 -                 debug xraw => _3;        // in scope 3 at $DIR/reference_prop.rs:+3:9: +3:13
-+                 debug xraw => _4;        // in scope 3 at $DIR/reference_prop.rs:+3:9: +3:13
++                 debug xraw => &_1;       // in scope 3 at $DIR/reference_prop.rs:+3:9: +3:13
                   let _6: &i32;            // in scope 3 at $DIR/reference_prop.rs:+4:9: +4:13
                   scope 4 {
 -                     debug xshr => _6;    // in scope 4 at $DIR/reference_prop.rs:+4:9: +4:13
-+                     debug xshr => _2;    // in scope 4 at $DIR/reference_prop.rs:+4:9: +4:13
++                     debug xshr => &_1;   // in scope 4 at $DIR/reference_prop.rs:+4:9: +4:13
                       let _7: i32;         // in scope 4 at $DIR/reference_prop.rs:+6:9: +6:10
                       scope 5 {
                           debug a => _7;   // in scope 5 at $DIR/reference_prop.rs:+6:9: +6:10
@@ -38,7 +38,7 @@
           StorageLive(_1);                 // scope 0 at $DIR/reference_prop.rs:+1:9: +1:14
           _1 = const 2_i32;                // scope 0 at $DIR/reference_prop.rs:+1:17: +1:18
 -         StorageLive(_2);                 // scope 1 at $DIR/reference_prop.rs:+2:9: +2:13
-          _2 = &mut _1;                    // scope 1 at $DIR/reference_prop.rs:+2:16: +2:22
+-         _2 = &mut _1;                    // scope 1 at $DIR/reference_prop.rs:+2:16: +2:22
 -         StorageLive(_3);                 // scope 2 at $DIR/reference_prop.rs:+3:9: +3:13
 -         StorageLive(_4);                 // scope 2 at $DIR/reference_prop.rs:+3:16: +3:36
 -         StorageLive(_5);                 // scope 2 at $DIR/reference_prop.rs:+3:16: +3:26
@@ -49,7 +49,6 @@
 -         StorageDead(_4);                 // scope 2 at $DIR/reference_prop.rs:+3:36: +3:37
 -         StorageLive(_6);                 // scope 3 at $DIR/reference_prop.rs:+4:9: +4:13
 -         _6 = &(*_2);                     // scope 3 at $DIR/reference_prop.rs:+4:16: +4:22
-+         _4 = &raw mut _1;                // scope 2 at $DIR/reference_prop.rs:+3:16: +3:26
           StorageLive(_7);                 // scope 4 at $DIR/reference_prop.rs:+6:9: +6:10
 -         _7 = (*_6);                      // scope 4 at $DIR/reference_prop.rs:+6:13: +6:18
 -         StorageLive(_8);                 // scope 5 at $DIR/reference_prop.rs:+7:5: +7:26
diff --git a/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff b/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff
index e08954ba2fd..7b31ee695ce 100644
--- a/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff
+++ b/tests/mir-opt/reference_prop.reference_propagation.ReferencePropagation.diff
@@ -35,11 +35,19 @@
       let _48: &T;                         // in scope 0 at $DIR/reference_prop.rs:+61:13: +61:14
       let _50: ();                         // in scope 0 at $DIR/reference_prop.rs:+63:9: +63:19
       let mut _51: ();                     // in scope 0 at $DIR/reference_prop.rs:+63:16: +63:18
-      let _52: &T;                         // in scope 0 at $DIR/reference_prop.rs:+68:13: +68:14
-      let mut _53: &T;                     // in scope 0 at $DIR/reference_prop.rs:+69:20: +69:28
-      let _54: &T;                         // in scope 0 at $DIR/reference_prop.rs:+69:20: +69:28
-      let _56: ();                         // in scope 0 at $DIR/reference_prop.rs:+71:9: +71:19
-      let mut _57: ();                     // in scope 0 at $DIR/reference_prop.rs:+71:16: +71:18
+      let _52: ();                         // in scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
+      let _53: &T;                         // in scope 0 at $DIR/reference_prop.rs:+68:13: +68:14
+      let mut _54: &T;                     // in scope 0 at $DIR/reference_prop.rs:+69:20: +69:28
+      let _55: &T;                         // in scope 0 at $DIR/reference_prop.rs:+69:20: +69:28
+      let _57: ();                         // in scope 0 at $DIR/reference_prop.rs:+71:9: +71:19
+      let mut _58: ();                     // in scope 0 at $DIR/reference_prop.rs:+71:16: +71:18
+      let _59: ();                         // in scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
+      let _60: usize;                      // in scope 0 at $DIR/reference_prop.rs:+76:13: +76:14
+      let _64: ();                         // in scope 0 at $DIR/reference_prop.rs:+80:9: +80:19
+      let mut _65: ();                     // in scope 0 at $DIR/reference_prop.rs:+80:16: +80:18
+      let _66: usize;                      // in scope 0 at $DIR/reference_prop.rs:+85:13: +85:14
+      let _70: ();                         // in scope 0 at $DIR/reference_prop.rs:+89:9: +89:19
+      let mut _71: ();                     // in scope 0 at $DIR/reference_prop.rs:+89:16: +89:18
       scope 1 {
           debug a => _4;                   // in scope 1 at $DIR/reference_prop.rs:+3:13: +3:14
           let _5: &usize;                  // in scope 1 at $DIR/reference_prop.rs:+4:13: +4:14
@@ -140,10 +148,44 @@
           }
       }
       scope 27 {
-          debug a => _52;                  // in scope 27 at $DIR/reference_prop.rs:+68:13: +68:14
-          let _55: T;                      // in scope 27 at $DIR/reference_prop.rs:+70:13: +70:14
+          debug a => _53;                  // in scope 27 at $DIR/reference_prop.rs:+68:13: +68:14
+          let _56: T;                      // in scope 27 at $DIR/reference_prop.rs:+70:13: +70:14
           scope 28 {
-              debug b => _55;              // in scope 28 at $DIR/reference_prop.rs:+70:13: +70:14
+              debug b => _56;              // in scope 28 at $DIR/reference_prop.rs:+70:13: +70:14
+          }
+      }
+      scope 29 {
+          debug a => _60;                  // in scope 29 at $DIR/reference_prop.rs:+76:13: +76:14
+          let _61: &usize;                 // in scope 29 at $DIR/reference_prop.rs:+77:13: +77:14
+          scope 30 {
+-             debug b => _61;              // in scope 30 at $DIR/reference_prop.rs:+77:13: +77:14
++             debug b => &_60;             // in scope 30 at $DIR/reference_prop.rs:+77:13: +77:14
+              let _62: &&usize;            // in scope 30 at $DIR/reference_prop.rs:+78:13: +78:14
+              scope 31 {
+-                 debug d => _62;          // in scope 31 at $DIR/reference_prop.rs:+78:13: +78:14
++                 debug d => &&_60;        // in scope 31 at $DIR/reference_prop.rs:+78:13: +78:14
+                  let _63: usize;          // in scope 31 at $DIR/reference_prop.rs:+79:13: +79:14
+                  scope 32 {
+                      debug c => _63;      // in scope 32 at $DIR/reference_prop.rs:+79:13: +79:14
+                  }
+              }
+          }
+      }
+      scope 33 {
+          debug a => _66;                  // in scope 33 at $DIR/reference_prop.rs:+85:13: +85:14
+          let mut _67: &usize;             // in scope 33 at $DIR/reference_prop.rs:+86:13: +86:18
+          scope 34 {
+-             debug b => _67;              // in scope 34 at $DIR/reference_prop.rs:+86:13: +86:18
++             debug b => &_66;             // in scope 34 at $DIR/reference_prop.rs:+86:13: +86:18
+              let _68: &mut &usize;        // in scope 34 at $DIR/reference_prop.rs:+87:13: +87:14
+              scope 35 {
+-                 debug d => _68;          // in scope 35 at $DIR/reference_prop.rs:+87:13: +87:14
++                 debug d => &&_66;        // in scope 35 at $DIR/reference_prop.rs:+87:13: +87:14
+                  let _69: usize;          // in scope 35 at $DIR/reference_prop.rs:+88:13: +88:14
+                  scope 36 {
+                      debug c => _69;      // in scope 36 at $DIR/reference_prop.rs:+88:13: +88:14
+                  }
+              }
           }
       }
   
@@ -344,34 +386,90 @@
           StorageDead(_49);                // scope 25 at $DIR/reference_prop.rs:+64:5: +64:6
 -         StorageDead(_48);                // scope 0 at $DIR/reference_prop.rs:+64:5: +64:6
 -         StorageDead(_47);                // scope 0 at $DIR/reference_prop.rs:+64:5: +64:6
-          StorageLive(_52);                // scope 0 at $DIR/reference_prop.rs:+68:13: +68:14
-          _52 = &(*_2);                    // scope 0 at $DIR/reference_prop.rs:+68:17: +68:27
-          StorageLive(_53);                // scope 27 at $DIR/reference_prop.rs:+69:20: +69:28
--         StorageLive(_54);                // scope 27 at $DIR/reference_prop.rs:+69:20: +69:28
--         _54 = &(*_1);                    // scope 27 at $DIR/reference_prop.rs:+69:20: +69:28
--         _53 = &(*_54);                   // scope 27 at $DIR/reference_prop.rs:+69:20: +69:28
-+         _53 = &(*_1);                    // scope 27 at $DIR/reference_prop.rs:+69:20: +69:28
-          _2 = move _53;                   // scope 27 at $DIR/reference_prop.rs:+69:9: +69:28
-          StorageDead(_53);                // scope 27 at $DIR/reference_prop.rs:+69:27: +69:28
--         StorageDead(_54);                // scope 27 at $DIR/reference_prop.rs:+69:28: +69:29
-          StorageLive(_55);                // scope 27 at $DIR/reference_prop.rs:+70:13: +70:14
-          _55 = (*_52);                    // scope 27 at $DIR/reference_prop.rs:+70:17: +70:19
-          StorageLive(_56);                // scope 28 at $DIR/reference_prop.rs:+71:9: +71:19
-          StorageLive(_57);                // scope 28 at $DIR/reference_prop.rs:+71:16: +71:18
-          _57 = ();                        // scope 28 at $DIR/reference_prop.rs:+71:16: +71:18
-          _56 = opaque::<()>(move _57) -> bb8; // scope 28 at $DIR/reference_prop.rs:+71:9: +71:19
+-         StorageLive(_52);                // scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
+          StorageLive(_53);                // scope 0 at $DIR/reference_prop.rs:+68:13: +68:14
+          _53 = &(*_2);                    // scope 0 at $DIR/reference_prop.rs:+68:17: +68:27
+          StorageLive(_54);                // scope 27 at $DIR/reference_prop.rs:+69:20: +69:28
+-         StorageLive(_55);                // scope 27 at $DIR/reference_prop.rs:+69:20: +69:28
+-         _55 = &(*_1);                    // scope 27 at $DIR/reference_prop.rs:+69:20: +69:28
+-         _54 = &(*_55);                   // scope 27 at $DIR/reference_prop.rs:+69:20: +69:28
++         _54 = &(*_1);                    // scope 27 at $DIR/reference_prop.rs:+69:20: +69:28
+          _2 = move _54;                   // scope 27 at $DIR/reference_prop.rs:+69:9: +69:28
+          StorageDead(_54);                // scope 27 at $DIR/reference_prop.rs:+69:27: +69:28
+-         StorageDead(_55);                // scope 27 at $DIR/reference_prop.rs:+69:28: +69:29
+          StorageLive(_56);                // scope 27 at $DIR/reference_prop.rs:+70:13: +70:14
+          _56 = (*_53);                    // scope 27 at $DIR/reference_prop.rs:+70:17: +70:19
+          StorageLive(_57);                // scope 28 at $DIR/reference_prop.rs:+71:9: +71:19
+          StorageLive(_58);                // scope 28 at $DIR/reference_prop.rs:+71:16: +71:18
+          _58 = ();                        // scope 28 at $DIR/reference_prop.rs:+71:16: +71:18
+          _57 = opaque::<()>(move _58) -> bb8; // scope 28 at $DIR/reference_prop.rs:+71:9: +71:19
                                            // mir::Constant
                                            // + span: $DIR/reference_prop.rs:81:9: 81:15
                                            // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
       }
   
       bb8: {
-          StorageDead(_57);                // scope 28 at $DIR/reference_prop.rs:+71:18: +71:19
-          StorageDead(_56);                // scope 28 at $DIR/reference_prop.rs:+71:19: +71:20
-          _0 = const ();                   // scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
-          StorageDead(_55);                // scope 27 at $DIR/reference_prop.rs:+72:5: +72:6
-          StorageDead(_52);                // scope 0 at $DIR/reference_prop.rs:+72:5: +72:6
-          return;                          // scope 0 at $DIR/reference_prop.rs:+73:2: +73:2
+          StorageDead(_58);                // scope 28 at $DIR/reference_prop.rs:+71:18: +71:19
+          StorageDead(_57);                // scope 28 at $DIR/reference_prop.rs:+71:19: +71:20
+-         _52 = const ();                  // scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
+          StorageDead(_56);                // scope 27 at $DIR/reference_prop.rs:+72:5: +72:6
+          StorageDead(_53);                // scope 0 at $DIR/reference_prop.rs:+72:5: +72:6
+-         StorageDead(_52);                // scope 0 at $DIR/reference_prop.rs:+72:5: +72:6
+-         StorageLive(_59);                // scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
+          StorageLive(_60);                // scope 0 at $DIR/reference_prop.rs:+76:13: +76:14
+          _60 = const 5_usize;             // scope 0 at $DIR/reference_prop.rs:+76:17: +76:24
+-         StorageLive(_61);                // scope 29 at $DIR/reference_prop.rs:+77:13: +77:14
+-         _61 = &_60;                      // scope 29 at $DIR/reference_prop.rs:+77:17: +77:19
+-         StorageLive(_62);                // scope 30 at $DIR/reference_prop.rs:+78:13: +78:14
+-         _62 = &_61;                      // scope 30 at $DIR/reference_prop.rs:+78:17: +78:19
+          StorageLive(_63);                // scope 31 at $DIR/reference_prop.rs:+79:13: +79:14
+-         _63 = (*_61);                    // scope 31 at $DIR/reference_prop.rs:+79:17: +79:19
++         _63 = _60;                       // scope 31 at $DIR/reference_prop.rs:+79:17: +79:19
+          StorageLive(_64);                // scope 32 at $DIR/reference_prop.rs:+80:9: +80:19
+          StorageLive(_65);                // scope 32 at $DIR/reference_prop.rs:+80:16: +80:18
+          _65 = ();                        // scope 32 at $DIR/reference_prop.rs:+80:16: +80:18
+          _64 = opaque::<()>(move _65) -> bb9; // scope 32 at $DIR/reference_prop.rs:+80:9: +80:19
+                                           // mir::Constant
+                                           // + span: $DIR/reference_prop.rs:90:9: 90:15
+                                           // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+      }
+  
+      bb9: {
+          StorageDead(_65);                // scope 32 at $DIR/reference_prop.rs:+80:18: +80:19
+          StorageDead(_64);                // scope 32 at $DIR/reference_prop.rs:+80:19: +80:20
+-         _59 = const ();                  // scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
+          StorageDead(_63);                // scope 31 at $DIR/reference_prop.rs:+81:5: +81:6
+-         StorageDead(_62);                // scope 30 at $DIR/reference_prop.rs:+81:5: +81:6
+-         StorageDead(_61);                // scope 29 at $DIR/reference_prop.rs:+81:5: +81:6
+          StorageDead(_60);                // scope 0 at $DIR/reference_prop.rs:+81:5: +81:6
+-         StorageDead(_59);                // scope 0 at $DIR/reference_prop.rs:+81:5: +81:6
+          StorageLive(_66);                // scope 0 at $DIR/reference_prop.rs:+85:13: +85:14
+          _66 = const 5_usize;             // scope 0 at $DIR/reference_prop.rs:+85:17: +85:24
+-         StorageLive(_67);                // scope 33 at $DIR/reference_prop.rs:+86:13: +86:18
+-         _67 = &_66;                      // scope 33 at $DIR/reference_prop.rs:+86:21: +86:23
+-         StorageLive(_68);                // scope 34 at $DIR/reference_prop.rs:+87:13: +87:14
+-         _68 = &mut _67;                  // scope 34 at $DIR/reference_prop.rs:+87:17: +87:23
+          StorageLive(_69);                // scope 35 at $DIR/reference_prop.rs:+88:13: +88:14
+-         _69 = (*_67);                    // scope 35 at $DIR/reference_prop.rs:+88:17: +88:19
++         _69 = _66;                       // scope 35 at $DIR/reference_prop.rs:+88:17: +88:19
+          StorageLive(_70);                // scope 36 at $DIR/reference_prop.rs:+89:9: +89:19
+          StorageLive(_71);                // scope 36 at $DIR/reference_prop.rs:+89:16: +89:18
+          _71 = ();                        // scope 36 at $DIR/reference_prop.rs:+89:16: +89:18
+          _70 = opaque::<()>(move _71) -> bb10; // scope 36 at $DIR/reference_prop.rs:+89:9: +89:19
+                                           // mir::Constant
+                                           // + span: $DIR/reference_prop.rs:99:9: 99:15
+                                           // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+      }
+  
+      bb10: {
+          StorageDead(_71);                // scope 36 at $DIR/reference_prop.rs:+89:18: +89:19
+          StorageDead(_70);                // scope 36 at $DIR/reference_prop.rs:+89:19: +89:20
+          _0 = const ();                   // scope 0 at $DIR/reference_prop.rs:+84:5: +90:6
+          StorageDead(_69);                // scope 35 at $DIR/reference_prop.rs:+90:5: +90:6
+-         StorageDead(_68);                // scope 34 at $DIR/reference_prop.rs:+90:5: +90:6
+-         StorageDead(_67);                // scope 33 at $DIR/reference_prop.rs:+90:5: +90:6
+          StorageDead(_66);                // scope 0 at $DIR/reference_prop.rs:+90:5: +90:6
+          return;                          // scope 0 at $DIR/reference_prop.rs:+91:2: +91:2
       }
   }
   
diff --git a/tests/mir-opt/reference_prop.reference_propagation_const_ptr.ReferencePropagation.diff b/tests/mir-opt/reference_prop.reference_propagation_const_ptr.ReferencePropagation.diff
index 62cc180a602..ddeb04e50c7 100644
--- a/tests/mir-opt/reference_prop.reference_propagation_const_ptr.ReferencePropagation.diff
+++ b/tests/mir-opt/reference_prop.reference_propagation_const_ptr.ReferencePropagation.diff
@@ -31,8 +31,14 @@
       let mut _53: *const T;               // in scope 0 at $DIR/reference_prop.rs:+69:20: +69:38
       let _55: ();                         // in scope 0 at $DIR/reference_prop.rs:+71:9: +71:19
       let mut _56: ();                     // in scope 0 at $DIR/reference_prop.rs:+71:16: +71:18
-      let _61: ();                         // in scope 0 at $DIR/reference_prop.rs:+80:9: +80:19
-      let mut _62: ();                     // in scope 0 at $DIR/reference_prop.rs:+80:16: +80:18
+      let _57: ();                         // in scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
+      let _62: ();                         // in scope 0 at $DIR/reference_prop.rs:+80:9: +80:19
+      let mut _63: ();                     // in scope 0 at $DIR/reference_prop.rs:+80:16: +80:18
+      let _64: ();                         // in scope 0 at $DIR/reference_prop.rs:+84:5: +90:6
+      let _69: ();                         // in scope 0 at $DIR/reference_prop.rs:+89:9: +89:19
+      let mut _70: ();                     // in scope 0 at $DIR/reference_prop.rs:+89:16: +89:18
+      let _75: ();                         // in scope 0 at $DIR/reference_prop.rs:+98:9: +98:19
+      let mut _76: ();                     // in scope 0 at $DIR/reference_prop.rs:+98:16: +98:18
       scope 1 {
           let _4: usize;                   // in scope 1 at $DIR/reference_prop.rs:+3:13: +3:14
           scope 2 {
@@ -164,20 +170,60 @@
           }
       }
       scope 37 {
-          let _57: usize;                  // in scope 37 at $DIR/reference_prop.rs:+76:13: +76:14
+          let _58: usize;                  // in scope 37 at $DIR/reference_prop.rs:+76:13: +76:14
           scope 38 {
-              debug a => _57;              // in scope 38 at $DIR/reference_prop.rs:+76:13: +76:14
-              let _58: *const usize;       // in scope 38 at $DIR/reference_prop.rs:+77:13: +77:14
+              debug a => _58;              // in scope 38 at $DIR/reference_prop.rs:+76:13: +76:14
+              let _59: *const usize;       // in scope 38 at $DIR/reference_prop.rs:+77:13: +77:14
               scope 39 {
--                 debug b => _58;          // in scope 39 at $DIR/reference_prop.rs:+77:13: +77:14
-+                 debug b => &_57;         // in scope 39 at $DIR/reference_prop.rs:+77:13: +77:14
-                  let _59: *const usize;   // in scope 39 at $DIR/reference_prop.rs:+78:13: +78:14
+-                 debug b => _59;          // in scope 39 at $DIR/reference_prop.rs:+77:13: +77:14
++                 debug b => &_58;         // in scope 39 at $DIR/reference_prop.rs:+77:13: +77:14
+                  let _60: *const usize;   // in scope 39 at $DIR/reference_prop.rs:+78:13: +78:14
                   scope 40 {
--                     debug c => _59;      // in scope 40 at $DIR/reference_prop.rs:+78:13: +78:14
-+                     debug c => &_57;     // in scope 40 at $DIR/reference_prop.rs:+78:13: +78:14
-                      let _60: usize;      // in scope 40 at $DIR/reference_prop.rs:+79:13: +79:14
+-                     debug c => _60;      // in scope 40 at $DIR/reference_prop.rs:+78:13: +78:14
++                     debug c => &_58;     // in scope 40 at $DIR/reference_prop.rs:+78:13: +78:14
+                      let _61: usize;      // in scope 40 at $DIR/reference_prop.rs:+79:13: +79:14
                       scope 41 {
-                          debug e => _60;  // in scope 41 at $DIR/reference_prop.rs:+79:13: +79:14
+                          debug e => _61;  // in scope 41 at $DIR/reference_prop.rs:+79:13: +79:14
+                      }
+                  }
+              }
+          }
+      }
+      scope 42 {
+          let _65: usize;                  // in scope 42 at $DIR/reference_prop.rs:+85:13: +85:14
+          scope 43 {
+              debug a => _65;              // in scope 43 at $DIR/reference_prop.rs:+85:13: +85:14
+              let _66: *const usize;       // in scope 43 at $DIR/reference_prop.rs:+86:13: +86:14
+              scope 44 {
+-                 debug b => _66;          // in scope 44 at $DIR/reference_prop.rs:+86:13: +86:14
++                 debug b => &_65;         // in scope 44 at $DIR/reference_prop.rs:+86:13: +86:14
+                  let _67: &*const usize;  // in scope 44 at $DIR/reference_prop.rs:+87:13: +87:14
+                  scope 45 {
+-                     debug d => _67;      // in scope 45 at $DIR/reference_prop.rs:+87:13: +87:14
++                     debug d => &&_65;    // in scope 45 at $DIR/reference_prop.rs:+87:13: +87:14
+                      let _68: usize;      // in scope 45 at $DIR/reference_prop.rs:+88:13: +88:14
+                      scope 46 {
+                          debug c => _68;  // in scope 46 at $DIR/reference_prop.rs:+88:13: +88:14
+                      }
+                  }
+              }
+          }
+      }
+      scope 47 {
+          let _71: usize;                  // in scope 47 at $DIR/reference_prop.rs:+94:13: +94:14
+          scope 48 {
+              debug a => _71;              // in scope 48 at $DIR/reference_prop.rs:+94:13: +94:14
+              let mut _72: *const usize;   // in scope 48 at $DIR/reference_prop.rs:+95:13: +95:18
+              scope 49 {
+-                 debug b => _72;          // in scope 49 at $DIR/reference_prop.rs:+95:13: +95:18
++                 debug b => &_71;         // in scope 49 at $DIR/reference_prop.rs:+95:13: +95:18
+                  let _73: &mut *const usize; // in scope 49 at $DIR/reference_prop.rs:+96:13: +96:14
+                  scope 50 {
+-                     debug d => _73;      // in scope 50 at $DIR/reference_prop.rs:+96:13: +96:14
++                     debug d => &&_71;    // in scope 50 at $DIR/reference_prop.rs:+96:13: +96:14
+                      let _74: usize;      // in scope 50 at $DIR/reference_prop.rs:+97:13: +97:14
+                      scope 51 {
+                          debug c => _74;  // in scope 51 at $DIR/reference_prop.rs:+97:13: +97:14
                       }
                   }
               }
@@ -198,7 +244,7 @@
           _8 = ();                         // scope 4 at $DIR/reference_prop.rs:+6:16: +6:18
           _7 = opaque::<()>(move _8) -> bb1; // scope 4 at $DIR/reference_prop.rs:+6:9: +6:19
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:166:9: 166:15
+                                           // + span: $DIR/reference_prop.rs:202:9: 202:15
                                            // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
       }
   
@@ -228,7 +274,7 @@
           _16 = ();                        // scope 9 at $DIR/reference_prop.rs:+17:16: +17:18
           _15 = opaque::<()>(move _16) -> bb2; // scope 9 at $DIR/reference_prop.rs:+17:9: +17:19
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:177:9: 177:15
+                                           // + span: $DIR/reference_prop.rs:213:9: 213:15
                                            // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
       }
   
@@ -255,7 +301,7 @@
           _23 = _20;                       // scope 14 at $DIR/reference_prop.rs:+26:16: +26:17
           _22 = opaque::<&*const usize>(move _23) -> bb3; // scope 14 at $DIR/reference_prop.rs:+26:9: +26:18
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:186:9: 186:15
+                                           // + span: $DIR/reference_prop.rs:222:9: 222:15
                                            // + literal: Const { ty: fn(&*const usize) {opaque::<&*const usize>}, val: Value(<ZST>) }
       }
   
@@ -282,7 +328,7 @@
           _30 = _27;                       // scope 19 at $DIR/reference_prop.rs:+35:16: +35:17
           _29 = opaque::<*mut *const usize>(move _30) -> bb4; // scope 19 at $DIR/reference_prop.rs:+35:9: +35:18
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:195:9: 195:15
+                                           // + span: $DIR/reference_prop.rs:231:9: 231:15
                                            // + literal: Const { ty: fn(*mut *const usize) {opaque::<*mut *const usize>}, val: Value(<ZST>) }
       }
   
@@ -308,7 +354,7 @@
           _36 = _33;                       // scope 23 at $DIR/reference_prop.rs:+43:16: +43:17
           _35 = opaque::<*const usize>(move _36) -> bb5; // scope 23 at $DIR/reference_prop.rs:+43:9: +43:18
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:203:9: 203:15
+                                           // + span: $DIR/reference_prop.rs:239:9: 239:15
                                            // + literal: Const { ty: fn(*const usize) {opaque::<*const usize>}, val: Value(<ZST>) }
       }
   
@@ -340,7 +386,7 @@
           _45 = _43;                       // scope 30 at $DIR/reference_prop.rs:+56:16: +56:18
           _44 = opaque::<*const usize>(move _45) -> bb6; // scope 30 at $DIR/reference_prop.rs:+56:9: +56:19
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:216:9: 216:15
+                                           // + span: $DIR/reference_prop.rs:252:9: 252:15
                                            // + literal: Const { ty: fn(*const usize) {opaque::<*const usize>}, val: Value(<ZST>) }
       }
   
@@ -366,7 +412,7 @@
           _50 = ();                        // scope 33 at $DIR/reference_prop.rs:+63:16: +63:18
           _49 = opaque::<()>(move _50) -> bb7; // scope 33 at $DIR/reference_prop.rs:+63:9: +63:19
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:223:9: 223:15
+                                           // + span: $DIR/reference_prop.rs:259:9: 259:15
                                            // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
       }
   
@@ -391,7 +437,7 @@
           _56 = ();                        // scope 36 at $DIR/reference_prop.rs:+71:16: +71:18
           _55 = opaque::<()>(move _56) -> bb8; // scope 36 at $DIR/reference_prop.rs:+71:9: +71:19
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:231:9: 231:15
+                                           // + span: $DIR/reference_prop.rs:267:9: 267:15
                                            // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
       }
   
@@ -402,33 +448,89 @@
           StorageDead(_54);                // scope 35 at $DIR/reference_prop.rs:+72:5: +72:6
           StorageDead(_52);                // scope 34 at $DIR/reference_prop.rs:+72:5: +72:6
 -         StorageDead(_51);                // scope 0 at $DIR/reference_prop.rs:+72:5: +72:6
-          StorageLive(_57);                // scope 37 at $DIR/reference_prop.rs:+76:13: +76:14
-          _57 = const 13_usize;            // scope 37 at $DIR/reference_prop.rs:+76:17: +76:25
--         StorageLive(_58);                // scope 38 at $DIR/reference_prop.rs:+77:13: +77:14
--         _58 = &raw const _57;            // scope 38 at $DIR/reference_prop.rs:+77:17: +77:29
--         StorageLive(_59);                // scope 39 at $DIR/reference_prop.rs:+78:13: +78:14
--         _59 = &raw const (*_58);         // scope 39 at $DIR/reference_prop.rs:+78:17: +78:30
-          StorageLive(_60);                // scope 40 at $DIR/reference_prop.rs:+79:13: +79:14
--         _60 = (*_59);                    // scope 40 at $DIR/reference_prop.rs:+79:17: +79:19
-+         _60 = _57;                       // scope 40 at $DIR/reference_prop.rs:+79:17: +79:19
-          StorageLive(_61);                // scope 41 at $DIR/reference_prop.rs:+80:9: +80:19
-          StorageLive(_62);                // scope 41 at $DIR/reference_prop.rs:+80:16: +80:18
-          _62 = ();                        // scope 41 at $DIR/reference_prop.rs:+80:16: +80:18
-          _61 = opaque::<()>(move _62) -> bb9; // scope 41 at $DIR/reference_prop.rs:+80:9: +80:19
+-         StorageLive(_57);                // scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
+          StorageLive(_58);                // scope 37 at $DIR/reference_prop.rs:+76:13: +76:14
+          _58 = const 13_usize;            // scope 37 at $DIR/reference_prop.rs:+76:17: +76:25
+-         StorageLive(_59);                // scope 38 at $DIR/reference_prop.rs:+77:13: +77:14
+-         _59 = &raw const _58;            // scope 38 at $DIR/reference_prop.rs:+77:17: +77:29
+-         StorageLive(_60);                // scope 39 at $DIR/reference_prop.rs:+78:13: +78:14
+-         _60 = &raw const (*_59);         // scope 39 at $DIR/reference_prop.rs:+78:17: +78:30
+          StorageLive(_61);                // scope 40 at $DIR/reference_prop.rs:+79:13: +79:14
+-         _61 = (*_60);                    // scope 40 at $DIR/reference_prop.rs:+79:17: +79:19
++         _61 = _58;                       // scope 40 at $DIR/reference_prop.rs:+79:17: +79:19
+          StorageLive(_62);                // scope 41 at $DIR/reference_prop.rs:+80:9: +80:19
+          StorageLive(_63);                // scope 41 at $DIR/reference_prop.rs:+80:16: +80:18
+          _63 = ();                        // scope 41 at $DIR/reference_prop.rs:+80:16: +80:18
+          _62 = opaque::<()>(move _63) -> bb9; // scope 41 at $DIR/reference_prop.rs:+80:9: +80:19
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:240:9: 240:15
+                                           // + span: $DIR/reference_prop.rs:276:9: 276:15
                                            // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
       }
   
       bb9: {
-          StorageDead(_62);                // scope 41 at $DIR/reference_prop.rs:+80:18: +80:19
-          StorageDead(_61);                // scope 41 at $DIR/reference_prop.rs:+80:19: +80:20
-          _0 = const ();                   // scope 37 at $DIR/reference_prop.rs:+75:5: +81:6
-          StorageDead(_60);                // scope 40 at $DIR/reference_prop.rs:+81:5: +81:6
--         StorageDead(_59);                // scope 39 at $DIR/reference_prop.rs:+81:5: +81:6
--         StorageDead(_58);                // scope 38 at $DIR/reference_prop.rs:+81:5: +81:6
-          StorageDead(_57);                // scope 37 at $DIR/reference_prop.rs:+81:5: +81:6
-          return;                          // scope 0 at $DIR/reference_prop.rs:+82:2: +82:2
+          StorageDead(_63);                // scope 41 at $DIR/reference_prop.rs:+80:18: +80:19
+          StorageDead(_62);                // scope 41 at $DIR/reference_prop.rs:+80:19: +80:20
+-         _57 = const ();                  // scope 37 at $DIR/reference_prop.rs:+75:5: +81:6
+          StorageDead(_61);                // scope 40 at $DIR/reference_prop.rs:+81:5: +81:6
+-         StorageDead(_60);                // scope 39 at $DIR/reference_prop.rs:+81:5: +81:6
+-         StorageDead(_59);                // scope 38 at $DIR/reference_prop.rs:+81:5: +81:6
+          StorageDead(_58);                // scope 37 at $DIR/reference_prop.rs:+81:5: +81:6
+-         StorageDead(_57);                // scope 0 at $DIR/reference_prop.rs:+81:5: +81:6
+-         StorageLive(_64);                // scope 0 at $DIR/reference_prop.rs:+84:5: +90:6
+          StorageLive(_65);                // scope 42 at $DIR/reference_prop.rs:+85:13: +85:14
+          _65 = const 5_usize;             // scope 42 at $DIR/reference_prop.rs:+85:17: +85:24
+-         StorageLive(_66);                // scope 43 at $DIR/reference_prop.rs:+86:13: +86:14
+-         _66 = &raw const _65;            // scope 43 at $DIR/reference_prop.rs:+86:17: +86:29
+-         StorageLive(_67);                // scope 44 at $DIR/reference_prop.rs:+87:13: +87:14
+-         _67 = &_66;                      // scope 44 at $DIR/reference_prop.rs:+87:17: +87:19
+          StorageLive(_68);                // scope 45 at $DIR/reference_prop.rs:+88:13: +88:14
+-         _68 = (*_66);                    // scope 45 at $DIR/reference_prop.rs:+88:17: +88:19
++         _68 = _65;                       // scope 45 at $DIR/reference_prop.rs:+88:17: +88:19
+          StorageLive(_69);                // scope 46 at $DIR/reference_prop.rs:+89:9: +89:19
+          StorageLive(_70);                // scope 46 at $DIR/reference_prop.rs:+89:16: +89:18
+          _70 = ();                        // scope 46 at $DIR/reference_prop.rs:+89:16: +89:18
+          _69 = opaque::<()>(move _70) -> bb10; // scope 46 at $DIR/reference_prop.rs:+89:9: +89:19
+                                           // mir::Constant
+                                           // + span: $DIR/reference_prop.rs:285:9: 285:15
+                                           // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+      }
+  
+      bb10: {
+          StorageDead(_70);                // scope 46 at $DIR/reference_prop.rs:+89:18: +89:19
+          StorageDead(_69);                // scope 46 at $DIR/reference_prop.rs:+89:19: +89:20
+-         _64 = const ();                  // scope 42 at $DIR/reference_prop.rs:+84:5: +90:6
+          StorageDead(_68);                // scope 45 at $DIR/reference_prop.rs:+90:5: +90:6
+-         StorageDead(_67);                // scope 44 at $DIR/reference_prop.rs:+90:5: +90:6
+-         StorageDead(_66);                // scope 43 at $DIR/reference_prop.rs:+90:5: +90:6
+          StorageDead(_65);                // scope 42 at $DIR/reference_prop.rs:+90:5: +90:6
+-         StorageDead(_64);                // scope 0 at $DIR/reference_prop.rs:+90:5: +90:6
+          StorageLive(_71);                // scope 47 at $DIR/reference_prop.rs:+94:13: +94:14
+          _71 = const 5_usize;             // scope 47 at $DIR/reference_prop.rs:+94:17: +94:24
+-         StorageLive(_72);                // scope 48 at $DIR/reference_prop.rs:+95:13: +95:18
+-         _72 = &raw const _71;            // scope 48 at $DIR/reference_prop.rs:+95:21: +95:33
+-         StorageLive(_73);                // scope 49 at $DIR/reference_prop.rs:+96:13: +96:14
+-         _73 = &mut _72;                  // scope 49 at $DIR/reference_prop.rs:+96:17: +96:23
+          StorageLive(_74);                // scope 50 at $DIR/reference_prop.rs:+97:13: +97:14
+-         _74 = (*_72);                    // scope 50 at $DIR/reference_prop.rs:+97:17: +97:19
++         _74 = _71;                       // scope 50 at $DIR/reference_prop.rs:+97:17: +97:19
+          StorageLive(_75);                // scope 51 at $DIR/reference_prop.rs:+98:9: +98:19
+          StorageLive(_76);                // scope 51 at $DIR/reference_prop.rs:+98:16: +98:18
+          _76 = ();                        // scope 51 at $DIR/reference_prop.rs:+98:16: +98:18
+          _75 = opaque::<()>(move _76) -> bb11; // scope 51 at $DIR/reference_prop.rs:+98:9: +98:19
+                                           // mir::Constant
+                                           // + span: $DIR/reference_prop.rs:294:9: 294:15
+                                           // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+      }
+  
+      bb11: {
+          StorageDead(_76);                // scope 51 at $DIR/reference_prop.rs:+98:18: +98:19
+          StorageDead(_75);                // scope 51 at $DIR/reference_prop.rs:+98:19: +98:20
+          _0 = const ();                   // scope 47 at $DIR/reference_prop.rs:+93:5: +99:6
+          StorageDead(_74);                // scope 50 at $DIR/reference_prop.rs:+99:5: +99:6
+-         StorageDead(_73);                // scope 49 at $DIR/reference_prop.rs:+99:5: +99:6
+-         StorageDead(_72);                // scope 48 at $DIR/reference_prop.rs:+99:5: +99:6
+          StorageDead(_71);                // scope 47 at $DIR/reference_prop.rs:+99:5: +99:6
+          return;                          // scope 0 at $DIR/reference_prop.rs:+100:2: +100:2
       }
   }
   
diff --git a/tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff b/tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff
index aedc08d7f92..8d059de5b87 100644
--- a/tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff
+++ b/tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff
@@ -35,11 +35,19 @@
       let _48: &mut T;                     // in scope 0 at $DIR/reference_prop.rs:+61:13: +61:14
       let _50: ();                         // in scope 0 at $DIR/reference_prop.rs:+63:9: +63:19
       let mut _51: ();                     // in scope 0 at $DIR/reference_prop.rs:+63:16: +63:18
-      let _52: &mut T;                     // in scope 0 at $DIR/reference_prop.rs:+68:13: +68:14
-      let mut _53: &mut T;                 // in scope 0 at $DIR/reference_prop.rs:+69:20: +69:32
+      let _52: ();                         // in scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
+      let _53: &mut T;                     // in scope 0 at $DIR/reference_prop.rs:+68:13: +68:14
       let mut _54: &mut T;                 // in scope 0 at $DIR/reference_prop.rs:+69:20: +69:32
-      let _56: ();                         // in scope 0 at $DIR/reference_prop.rs:+71:9: +71:19
-      let mut _57: ();                     // in scope 0 at $DIR/reference_prop.rs:+71:16: +71:18
+      let mut _55: &mut T;                 // in scope 0 at $DIR/reference_prop.rs:+69:20: +69:32
+      let _57: ();                         // in scope 0 at $DIR/reference_prop.rs:+71:9: +71:19
+      let mut _58: ();                     // in scope 0 at $DIR/reference_prop.rs:+71:16: +71:18
+      let _59: ();                         // in scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
+      let mut _60: usize;                  // in scope 0 at $DIR/reference_prop.rs:+76:13: +76:18
+      let _64: ();                         // in scope 0 at $DIR/reference_prop.rs:+80:9: +80:19
+      let mut _65: ();                     // in scope 0 at $DIR/reference_prop.rs:+80:16: +80:18
+      let mut _66: usize;                  // in scope 0 at $DIR/reference_prop.rs:+85:13: +85:18
+      let _70: ();                         // in scope 0 at $DIR/reference_prop.rs:+89:9: +89:19
+      let mut _71: ();                     // in scope 0 at $DIR/reference_prop.rs:+89:16: +89:18
       scope 1 {
           debug a => _4;                   // in scope 1 at $DIR/reference_prop.rs:+3:13: +3:18
           let _5: &mut usize;              // in scope 1 at $DIR/reference_prop.rs:+4:13: +4:14
@@ -140,10 +148,44 @@
           }
       }
       scope 27 {
-          debug a => _52;                  // in scope 27 at $DIR/reference_prop.rs:+68:13: +68:14
-          let _55: T;                      // in scope 27 at $DIR/reference_prop.rs:+70:13: +70:14
+          debug a => _53;                  // in scope 27 at $DIR/reference_prop.rs:+68:13: +68:14
+          let _56: T;                      // in scope 27 at $DIR/reference_prop.rs:+70:13: +70:14
           scope 28 {
-              debug b => _55;              // in scope 28 at $DIR/reference_prop.rs:+70:13: +70:14
+              debug b => _56;              // in scope 28 at $DIR/reference_prop.rs:+70:13: +70:14
+          }
+      }
+      scope 29 {
+          debug a => _60;                  // in scope 29 at $DIR/reference_prop.rs:+76:13: +76:18
+          let _61: &mut usize;             // in scope 29 at $DIR/reference_prop.rs:+77:13: +77:14
+          scope 30 {
+-             debug b => _61;              // in scope 30 at $DIR/reference_prop.rs:+77:13: +77:14
++             debug b => &_60;             // in scope 30 at $DIR/reference_prop.rs:+77:13: +77:14
+              let _62: &&mut usize;        // in scope 30 at $DIR/reference_prop.rs:+78:13: +78:14
+              scope 31 {
+-                 debug d => _62;          // in scope 31 at $DIR/reference_prop.rs:+78:13: +78:14
++                 debug d => &&_60;        // in scope 31 at $DIR/reference_prop.rs:+78:13: +78:14
+                  let _63: usize;          // in scope 31 at $DIR/reference_prop.rs:+79:13: +79:14
+                  scope 32 {
+                      debug c => _63;      // in scope 32 at $DIR/reference_prop.rs:+79:13: +79:14
+                  }
+              }
+          }
+      }
+      scope 33 {
+          debug a => _66;                  // in scope 33 at $DIR/reference_prop.rs:+85:13: +85:18
+          let mut _67: &mut usize;         // in scope 33 at $DIR/reference_prop.rs:+86:13: +86:18
+          scope 34 {
+-             debug b => _67;              // in scope 34 at $DIR/reference_prop.rs:+86:13: +86:18
++             debug b => &_66;             // in scope 34 at $DIR/reference_prop.rs:+86:13: +86:18
+              let _68: &mut &mut usize;    // in scope 34 at $DIR/reference_prop.rs:+87:13: +87:14
+              scope 35 {
+-                 debug d => _68;          // in scope 35 at $DIR/reference_prop.rs:+87:13: +87:14
++                 debug d => &&_66;        // in scope 35 at $DIR/reference_prop.rs:+87:13: +87:14
+                  let _69: usize;          // in scope 35 at $DIR/reference_prop.rs:+88:13: +88:14
+                  scope 36 {
+                      debug c => _69;      // in scope 36 at $DIR/reference_prop.rs:+88:13: +88:14
+                  }
+              }
           }
       }
   
@@ -161,7 +203,7 @@
           _8 = ();                         // scope 3 at $DIR/reference_prop.rs:+6:16: +6:18
           _7 = opaque::<()>(move _8) -> bb1; // scope 3 at $DIR/reference_prop.rs:+6:9: +6:19
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:91:9: 91:15
+                                           // + span: $DIR/reference_prop.rs:109:9: 109:15
                                            // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
       }
   
@@ -195,7 +237,7 @@
           _17 = ();                        // scope 7 at $DIR/reference_prop.rs:+17:16: +17:18
           _16 = opaque::<()>(move _17) -> bb2; // scope 7 at $DIR/reference_prop.rs:+17:9: +17:19
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:102:9: 102:15
+                                           // + span: $DIR/reference_prop.rs:120:9: 120:15
                                            // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
       }
   
@@ -222,7 +264,7 @@
           _24 = _21;                       // scope 11 at $DIR/reference_prop.rs:+26:16: +26:17
           _23 = opaque::<&&mut usize>(move _24) -> bb3; // scope 11 at $DIR/reference_prop.rs:+26:9: +26:18
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:111:9: 111:15
+                                           // + span: $DIR/reference_prop.rs:129:9: 129:15
                                            // + literal: Const { ty: fn(&&mut usize) {opaque::<&&mut usize>}, val: Value(<ZST>) }
       }
   
@@ -249,7 +291,7 @@
           _31 = _28;                       // scope 15 at $DIR/reference_prop.rs:+35:16: +35:17
           _30 = opaque::<*mut &mut usize>(move _31) -> bb4; // scope 15 at $DIR/reference_prop.rs:+35:9: +35:18
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:120:9: 120:15
+                                           // + span: $DIR/reference_prop.rs:138:9: 138:15
                                            // + literal: Const { ty: fn(*mut &mut usize) {opaque::<*mut &mut usize>}, val: Value(<ZST>) }
       }
   
@@ -274,7 +316,7 @@
           _37 = move _34;                  // scope 18 at $DIR/reference_prop.rs:+43:16: +43:17
           _36 = opaque::<&mut usize>(move _37) -> bb5; // scope 18 at $DIR/reference_prop.rs:+43:9: +43:18
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:128:9: 128:15
+                                           // + span: $DIR/reference_prop.rs:146:9: 146:15
                                            // + literal: Const { ty: fn(&mut usize) {opaque::<&mut usize>}, val: Value(<ZST>) }
       }
   
@@ -304,7 +346,7 @@
           _46 = move _44;                  // scope 24 at $DIR/reference_prop.rs:+56:16: +56:18
           _45 = opaque::<&mut usize>(move _46) -> bb6; // scope 24 at $DIR/reference_prop.rs:+56:9: +56:19
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:141:9: 141:15
+                                           // + span: $DIR/reference_prop.rs:159:9: 159:15
                                            // + literal: Const { ty: fn(&mut usize) {opaque::<&mut usize>}, val: Value(<ZST>) }
       }
   
@@ -330,7 +372,7 @@
           _51 = ();                        // scope 26 at $DIR/reference_prop.rs:+63:16: +63:18
           _50 = opaque::<()>(move _51) -> bb7; // scope 26 at $DIR/reference_prop.rs:+63:9: +63:19
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:148:9: 148:15
+                                           // + span: $DIR/reference_prop.rs:166:9: 166:15
                                            // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
       }
   
@@ -341,34 +383,90 @@
           StorageDead(_49);                // scope 25 at $DIR/reference_prop.rs:+64:5: +64:6
 -         StorageDead(_48);                // scope 0 at $DIR/reference_prop.rs:+64:5: +64:6
 -         StorageDead(_47);                // scope 0 at $DIR/reference_prop.rs:+64:5: +64:6
-          StorageLive(_52);                // scope 0 at $DIR/reference_prop.rs:+68:13: +68:14
-          _52 = &mut (*_2);                // scope 0 at $DIR/reference_prop.rs:+68:17: +68:31
-          StorageLive(_53);                // scope 27 at $DIR/reference_prop.rs:+69:20: +69:32
--         StorageLive(_54);                // scope 27 at $DIR/reference_prop.rs:+69:20: +69:32
--         _54 = &mut (*_1);                // scope 27 at $DIR/reference_prop.rs:+69:20: +69:32
--         _53 = &mut (*_54);               // scope 27 at $DIR/reference_prop.rs:+69:20: +69:32
-+         _53 = &mut (*_1);                // scope 27 at $DIR/reference_prop.rs:+69:20: +69:32
-          _2 = move _53;                   // scope 27 at $DIR/reference_prop.rs:+69:9: +69:32
-          StorageDead(_53);                // scope 27 at $DIR/reference_prop.rs:+69:31: +69:32
--         StorageDead(_54);                // scope 27 at $DIR/reference_prop.rs:+69:32: +69:33
-          StorageLive(_55);                // scope 27 at $DIR/reference_prop.rs:+70:13: +70:14
-          _55 = (*_52);                    // scope 27 at $DIR/reference_prop.rs:+70:17: +70:19
-          StorageLive(_56);                // scope 28 at $DIR/reference_prop.rs:+71:9: +71:19
-          StorageLive(_57);                // scope 28 at $DIR/reference_prop.rs:+71:16: +71:18
-          _57 = ();                        // scope 28 at $DIR/reference_prop.rs:+71:16: +71:18
-          _56 = opaque::<()>(move _57) -> bb8; // scope 28 at $DIR/reference_prop.rs:+71:9: +71:19
+-         StorageLive(_52);                // scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
+          StorageLive(_53);                // scope 0 at $DIR/reference_prop.rs:+68:13: +68:14
+          _53 = &mut (*_2);                // scope 0 at $DIR/reference_prop.rs:+68:17: +68:31
+          StorageLive(_54);                // scope 27 at $DIR/reference_prop.rs:+69:20: +69:32
+-         StorageLive(_55);                // scope 27 at $DIR/reference_prop.rs:+69:20: +69:32
+-         _55 = &mut (*_1);                // scope 27 at $DIR/reference_prop.rs:+69:20: +69:32
+-         _54 = &mut (*_55);               // scope 27 at $DIR/reference_prop.rs:+69:20: +69:32
++         _54 = &mut (*_1);                // scope 27 at $DIR/reference_prop.rs:+69:20: +69:32
+          _2 = move _54;                   // scope 27 at $DIR/reference_prop.rs:+69:9: +69:32
+          StorageDead(_54);                // scope 27 at $DIR/reference_prop.rs:+69:31: +69:32
+-         StorageDead(_55);                // scope 27 at $DIR/reference_prop.rs:+69:32: +69:33
+          StorageLive(_56);                // scope 27 at $DIR/reference_prop.rs:+70:13: +70:14
+          _56 = (*_53);                    // scope 27 at $DIR/reference_prop.rs:+70:17: +70:19
+          StorageLive(_57);                // scope 28 at $DIR/reference_prop.rs:+71:9: +71:19
+          StorageLive(_58);                // scope 28 at $DIR/reference_prop.rs:+71:16: +71:18
+          _58 = ();                        // scope 28 at $DIR/reference_prop.rs:+71:16: +71:18
+          _57 = opaque::<()>(move _58) -> bb8; // scope 28 at $DIR/reference_prop.rs:+71:9: +71:19
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:156:9: 156:15
+                                           // + span: $DIR/reference_prop.rs:174:9: 174:15
                                            // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
       }
   
       bb8: {
-          StorageDead(_57);                // scope 28 at $DIR/reference_prop.rs:+71:18: +71:19
-          StorageDead(_56);                // scope 28 at $DIR/reference_prop.rs:+71:19: +71:20
-          _0 = const ();                   // scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
-          StorageDead(_55);                // scope 27 at $DIR/reference_prop.rs:+72:5: +72:6
-          StorageDead(_52);                // scope 0 at $DIR/reference_prop.rs:+72:5: +72:6
-          return;                          // scope 0 at $DIR/reference_prop.rs:+73:2: +73:2
+          StorageDead(_58);                // scope 28 at $DIR/reference_prop.rs:+71:18: +71:19
+          StorageDead(_57);                // scope 28 at $DIR/reference_prop.rs:+71:19: +71:20
+-         _52 = const ();                  // scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
+          StorageDead(_56);                // scope 27 at $DIR/reference_prop.rs:+72:5: +72:6
+          StorageDead(_53);                // scope 0 at $DIR/reference_prop.rs:+72:5: +72:6
+-         StorageDead(_52);                // scope 0 at $DIR/reference_prop.rs:+72:5: +72:6
+-         StorageLive(_59);                // scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
+          StorageLive(_60);                // scope 0 at $DIR/reference_prop.rs:+76:13: +76:18
+          _60 = const 5_usize;             // scope 0 at $DIR/reference_prop.rs:+76:21: +76:28
+-         StorageLive(_61);                // scope 29 at $DIR/reference_prop.rs:+77:13: +77:14
+-         _61 = &mut _60;                  // scope 29 at $DIR/reference_prop.rs:+77:17: +77:23
+-         StorageLive(_62);                // scope 30 at $DIR/reference_prop.rs:+78:13: +78:14
+-         _62 = &_61;                      // scope 30 at $DIR/reference_prop.rs:+78:17: +78:19
+          StorageLive(_63);                // scope 31 at $DIR/reference_prop.rs:+79:13: +79:14
+-         _63 = (*_61);                    // scope 31 at $DIR/reference_prop.rs:+79:17: +79:19
++         _63 = _60;                       // scope 31 at $DIR/reference_prop.rs:+79:17: +79:19
+          StorageLive(_64);                // scope 32 at $DIR/reference_prop.rs:+80:9: +80:19
+          StorageLive(_65);                // scope 32 at $DIR/reference_prop.rs:+80:16: +80:18
+          _65 = ();                        // scope 32 at $DIR/reference_prop.rs:+80:16: +80:18
+          _64 = opaque::<()>(move _65) -> bb9; // scope 32 at $DIR/reference_prop.rs:+80:9: +80:19
+                                           // mir::Constant
+                                           // + span: $DIR/reference_prop.rs:183:9: 183:15
+                                           // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+      }
+  
+      bb9: {
+          StorageDead(_65);                // scope 32 at $DIR/reference_prop.rs:+80:18: +80:19
+          StorageDead(_64);                // scope 32 at $DIR/reference_prop.rs:+80:19: +80:20
+-         _59 = const ();                  // scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
+          StorageDead(_63);                // scope 31 at $DIR/reference_prop.rs:+81:5: +81:6
+-         StorageDead(_62);                // scope 30 at $DIR/reference_prop.rs:+81:5: +81:6
+-         StorageDead(_61);                // scope 29 at $DIR/reference_prop.rs:+81:5: +81:6
+          StorageDead(_60);                // scope 0 at $DIR/reference_prop.rs:+81:5: +81:6
+-         StorageDead(_59);                // scope 0 at $DIR/reference_prop.rs:+81:5: +81:6
+          StorageLive(_66);                // scope 0 at $DIR/reference_prop.rs:+85:13: +85:18
+          _66 = const 5_usize;             // scope 0 at $DIR/reference_prop.rs:+85:21: +85:28
+-         StorageLive(_67);                // scope 33 at $DIR/reference_prop.rs:+86:13: +86:18
+-         _67 = &mut _66;                  // scope 33 at $DIR/reference_prop.rs:+86:21: +86:27
+-         StorageLive(_68);                // scope 34 at $DIR/reference_prop.rs:+87:13: +87:14
+-         _68 = &mut _67;                  // scope 34 at $DIR/reference_prop.rs:+87:17: +87:23
+          StorageLive(_69);                // scope 35 at $DIR/reference_prop.rs:+88:13: +88:14
+-         _69 = (*_67);                    // scope 35 at $DIR/reference_prop.rs:+88:17: +88:19
++         _69 = _66;                       // scope 35 at $DIR/reference_prop.rs:+88:17: +88:19
+          StorageLive(_70);                // scope 36 at $DIR/reference_prop.rs:+89:9: +89:19
+          StorageLive(_71);                // scope 36 at $DIR/reference_prop.rs:+89:16: +89:18
+          _71 = ();                        // scope 36 at $DIR/reference_prop.rs:+89:16: +89:18
+          _70 = opaque::<()>(move _71) -> bb10; // scope 36 at $DIR/reference_prop.rs:+89:9: +89:19
+                                           // mir::Constant
+                                           // + span: $DIR/reference_prop.rs:192:9: 192:15
+                                           // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+      }
+  
+      bb10: {
+          StorageDead(_71);                // scope 36 at $DIR/reference_prop.rs:+89:18: +89:19
+          StorageDead(_70);                // scope 36 at $DIR/reference_prop.rs:+89:19: +89:20
+          _0 = const ();                   // scope 0 at $DIR/reference_prop.rs:+84:5: +90:6
+          StorageDead(_69);                // scope 35 at $DIR/reference_prop.rs:+90:5: +90:6
+-         StorageDead(_68);                // scope 34 at $DIR/reference_prop.rs:+90:5: +90:6
+-         StorageDead(_67);                // scope 33 at $DIR/reference_prop.rs:+90:5: +90:6
+          StorageDead(_66);                // scope 0 at $DIR/reference_prop.rs:+90:5: +90:6
+          return;                          // scope 0 at $DIR/reference_prop.rs:+91:2: +91:2
       }
   }
   
diff --git a/tests/mir-opt/reference_prop.reference_propagation_mut_ptr.ReferencePropagation.diff b/tests/mir-opt/reference_prop.reference_propagation_mut_ptr.ReferencePropagation.diff
index 83478b83b2d..c93aa52be11 100644
--- a/tests/mir-opt/reference_prop.reference_propagation_mut_ptr.ReferencePropagation.diff
+++ b/tests/mir-opt/reference_prop.reference_propagation_mut_ptr.ReferencePropagation.diff
@@ -27,9 +27,15 @@
       let _46: ();                         // in scope 0 at $DIR/reference_prop.rs:+60:5: +64:6
       let _49: ();                         // in scope 0 at $DIR/reference_prop.rs:+63:9: +63:19
       let mut _50: ();                     // in scope 0 at $DIR/reference_prop.rs:+63:16: +63:18
-      let mut _52: *mut T;                 // in scope 0 at $DIR/reference_prop.rs:+69:20: +69:36
-      let _54: ();                         // in scope 0 at $DIR/reference_prop.rs:+71:9: +71:19
-      let mut _55: ();                     // in scope 0 at $DIR/reference_prop.rs:+71:16: +71:18
+      let _51: ();                         // in scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
+      let mut _53: *mut T;                 // in scope 0 at $DIR/reference_prop.rs:+69:20: +69:36
+      let _55: ();                         // in scope 0 at $DIR/reference_prop.rs:+71:9: +71:19
+      let mut _56: ();                     // in scope 0 at $DIR/reference_prop.rs:+71:16: +71:18
+      let _57: ();                         // in scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
+      let _62: ();                         // in scope 0 at $DIR/reference_prop.rs:+80:9: +80:19
+      let mut _63: ();                     // in scope 0 at $DIR/reference_prop.rs:+80:16: +80:18
+      let _68: ();                         // in scope 0 at $DIR/reference_prop.rs:+89:9: +89:19
+      let mut _69: ();                     // in scope 0 at $DIR/reference_prop.rs:+89:16: +89:18
       scope 1 {
           let mut _4: usize;               // in scope 1 at $DIR/reference_prop.rs:+3:13: +3:18
           scope 2 {
@@ -151,12 +157,52 @@
           }
       }
       scope 34 {
-          let _51: *mut T;                 // in scope 34 at $DIR/reference_prop.rs:+68:13: +68:14
+          let _52: *mut T;                 // in scope 34 at $DIR/reference_prop.rs:+68:13: +68:14
           scope 35 {
-              debug a => _51;              // in scope 35 at $DIR/reference_prop.rs:+68:13: +68:14
-              let _53: T;                  // in scope 35 at $DIR/reference_prop.rs:+70:13: +70:14
+              debug a => _52;              // in scope 35 at $DIR/reference_prop.rs:+68:13: +68:14
+              let _54: T;                  // in scope 35 at $DIR/reference_prop.rs:+70:13: +70:14
               scope 36 {
-                  debug b => _53;          // in scope 36 at $DIR/reference_prop.rs:+70:13: +70:14
+                  debug b => _54;          // in scope 36 at $DIR/reference_prop.rs:+70:13: +70:14
+              }
+          }
+      }
+      scope 37 {
+          let mut _58: usize;              // in scope 37 at $DIR/reference_prop.rs:+76:13: +76:18
+          scope 38 {
+              debug a => _58;              // in scope 38 at $DIR/reference_prop.rs:+76:13: +76:18
+              let _59: *mut usize;         // in scope 38 at $DIR/reference_prop.rs:+77:13: +77:14
+              scope 39 {
+-                 debug b => _59;          // in scope 39 at $DIR/reference_prop.rs:+77:13: +77:14
++                 debug b => &_58;         // in scope 39 at $DIR/reference_prop.rs:+77:13: +77:14
+                  let _60: &*mut usize;    // in scope 39 at $DIR/reference_prop.rs:+78:13: +78:14
+                  scope 40 {
+-                     debug d => _60;      // in scope 40 at $DIR/reference_prop.rs:+78:13: +78:14
++                     debug d => &&_58;    // in scope 40 at $DIR/reference_prop.rs:+78:13: +78:14
+                      let _61: usize;      // in scope 40 at $DIR/reference_prop.rs:+79:13: +79:14
+                      scope 41 {
+                          debug c => _61;  // in scope 41 at $DIR/reference_prop.rs:+79:13: +79:14
+                      }
+                  }
+              }
+          }
+      }
+      scope 42 {
+          let mut _64: usize;              // in scope 42 at $DIR/reference_prop.rs:+85:13: +85:18
+          scope 43 {
+              debug a => _64;              // in scope 43 at $DIR/reference_prop.rs:+85:13: +85:18
+              let mut _65: *mut usize;     // in scope 43 at $DIR/reference_prop.rs:+86:13: +86:18
+              scope 44 {
+-                 debug b => _65;          // in scope 44 at $DIR/reference_prop.rs:+86:13: +86:18
++                 debug b => &_64;         // in scope 44 at $DIR/reference_prop.rs:+86:13: +86:18
+                  let _66: &mut *mut usize; // in scope 44 at $DIR/reference_prop.rs:+87:13: +87:14
+                  scope 45 {
+-                     debug d => _66;      // in scope 45 at $DIR/reference_prop.rs:+87:13: +87:14
++                     debug d => &&_64;    // in scope 45 at $DIR/reference_prop.rs:+87:13: +87:14
+                      let _67: usize;      // in scope 45 at $DIR/reference_prop.rs:+88:13: +88:14
+                      scope 46 {
+                          debug c => _67;  // in scope 46 at $DIR/reference_prop.rs:+88:13: +88:14
+                      }
+                  }
               }
           }
       }
@@ -175,7 +221,7 @@
           _8 = ();                         // scope 4 at $DIR/reference_prop.rs:+6:16: +6:18
           _7 = opaque::<()>(move _8) -> bb1; // scope 4 at $DIR/reference_prop.rs:+6:9: +6:19
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:250:9: 250:15
+                                           // + span: $DIR/reference_prop.rs:304:9: 304:15
                                            // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
       }
   
@@ -205,7 +251,7 @@
           _16 = ();                        // scope 9 at $DIR/reference_prop.rs:+17:16: +17:18
           _15 = opaque::<()>(move _16) -> bb2; // scope 9 at $DIR/reference_prop.rs:+17:9: +17:19
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:261:9: 261:15
+                                           // + span: $DIR/reference_prop.rs:315:9: 315:15
                                            // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
       }
   
@@ -232,7 +278,7 @@
           _23 = _20;                       // scope 14 at $DIR/reference_prop.rs:+26:16: +26:17
           _22 = opaque::<&*mut usize>(move _23) -> bb3; // scope 14 at $DIR/reference_prop.rs:+26:9: +26:18
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:270:9: 270:15
+                                           // + span: $DIR/reference_prop.rs:324:9: 324:15
                                            // + literal: Const { ty: fn(&*mut usize) {opaque::<&*mut usize>}, val: Value(<ZST>) }
       }
   
@@ -259,7 +305,7 @@
           _30 = _27;                       // scope 19 at $DIR/reference_prop.rs:+35:16: +35:17
           _29 = opaque::<*mut *mut usize>(move _30) -> bb4; // scope 19 at $DIR/reference_prop.rs:+35:9: +35:18
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:279:9: 279:15
+                                           // + span: $DIR/reference_prop.rs:333:9: 333:15
                                            // + literal: Const { ty: fn(*mut *mut usize) {opaque::<*mut *mut usize>}, val: Value(<ZST>) }
       }
   
@@ -284,7 +330,7 @@
           _36 = _33;                       // scope 23 at $DIR/reference_prop.rs:+43:16: +43:17
           _35 = opaque::<*mut usize>(move _36) -> bb5; // scope 23 at $DIR/reference_prop.rs:+43:9: +43:18
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:287:9: 287:15
+                                           // + span: $DIR/reference_prop.rs:341:9: 341:15
                                            // + literal: Const { ty: fn(*mut usize) {opaque::<*mut usize>}, val: Value(<ZST>) }
       }
   
@@ -314,7 +360,7 @@
           _45 = _43;                       // scope 30 at $DIR/reference_prop.rs:+56:16: +56:18
           _44 = opaque::<*mut usize>(move _45) -> bb6; // scope 30 at $DIR/reference_prop.rs:+56:9: +56:19
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:300:9: 300:15
+                                           // + span: $DIR/reference_prop.rs:354:9: 354:15
                                            // + literal: Const { ty: fn(*mut usize) {opaque::<*mut usize>}, val: Value(<ZST>) }
       }
   
@@ -340,7 +386,7 @@
           _50 = ();                        // scope 33 at $DIR/reference_prop.rs:+63:16: +63:18
           _49 = opaque::<()>(move _50) -> bb7; // scope 33 at $DIR/reference_prop.rs:+63:9: +63:19
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:307:9: 307:15
+                                           // + span: $DIR/reference_prop.rs:361:9: 361:15
                                            // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
       }
   
@@ -351,30 +397,86 @@
           StorageDead(_48);                // scope 32 at $DIR/reference_prop.rs:+64:5: +64:6
 -         StorageDead(_47);                // scope 31 at $DIR/reference_prop.rs:+64:5: +64:6
 -         StorageDead(_46);                // scope 0 at $DIR/reference_prop.rs:+64:5: +64:6
-          StorageLive(_51);                // scope 34 at $DIR/reference_prop.rs:+68:13: +68:14
-          _51 = &raw mut (*_2);            // scope 34 at $DIR/reference_prop.rs:+68:17: +68:35
-          StorageLive(_52);                // scope 35 at $DIR/reference_prop.rs:+69:20: +69:36
-          _52 = &raw mut (*_1);            // scope 35 at $DIR/reference_prop.rs:+69:20: +69:36
-          _2 = move _52;                   // scope 35 at $DIR/reference_prop.rs:+69:9: +69:36
-          StorageDead(_52);                // scope 35 at $DIR/reference_prop.rs:+69:35: +69:36
-          StorageLive(_53);                // scope 35 at $DIR/reference_prop.rs:+70:13: +70:14
-          _53 = (*_51);                    // scope 35 at $DIR/reference_prop.rs:+70:17: +70:19
-          StorageLive(_54);                // scope 36 at $DIR/reference_prop.rs:+71:9: +71:19
-          StorageLive(_55);                // scope 36 at $DIR/reference_prop.rs:+71:16: +71:18
-          _55 = ();                        // scope 36 at $DIR/reference_prop.rs:+71:16: +71:18
-          _54 = opaque::<()>(move _55) -> bb8; // scope 36 at $DIR/reference_prop.rs:+71:9: +71:19
+-         StorageLive(_51);                // scope 0 at $DIR/reference_prop.rs:+67:5: +72:6
+          StorageLive(_52);                // scope 34 at $DIR/reference_prop.rs:+68:13: +68:14
+          _52 = &raw mut (*_2);            // scope 34 at $DIR/reference_prop.rs:+68:17: +68:35
+          StorageLive(_53);                // scope 35 at $DIR/reference_prop.rs:+69:20: +69:36
+          _53 = &raw mut (*_1);            // scope 35 at $DIR/reference_prop.rs:+69:20: +69:36
+          _2 = move _53;                   // scope 35 at $DIR/reference_prop.rs:+69:9: +69:36
+          StorageDead(_53);                // scope 35 at $DIR/reference_prop.rs:+69:35: +69:36
+          StorageLive(_54);                // scope 35 at $DIR/reference_prop.rs:+70:13: +70:14
+          _54 = (*_52);                    // scope 35 at $DIR/reference_prop.rs:+70:17: +70:19
+          StorageLive(_55);                // scope 36 at $DIR/reference_prop.rs:+71:9: +71:19
+          StorageLive(_56);                // scope 36 at $DIR/reference_prop.rs:+71:16: +71:18
+          _56 = ();                        // scope 36 at $DIR/reference_prop.rs:+71:16: +71:18
+          _55 = opaque::<()>(move _56) -> bb8; // scope 36 at $DIR/reference_prop.rs:+71:9: +71:19
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:315:9: 315:15
+                                           // + span: $DIR/reference_prop.rs:369:9: 369:15
                                            // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
       }
   
       bb8: {
-          StorageDead(_55);                // scope 36 at $DIR/reference_prop.rs:+71:18: +71:19
-          StorageDead(_54);                // scope 36 at $DIR/reference_prop.rs:+71:19: +71:20
-          _0 = const ();                   // scope 34 at $DIR/reference_prop.rs:+67:5: +72:6
-          StorageDead(_53);                // scope 35 at $DIR/reference_prop.rs:+72:5: +72:6
-          StorageDead(_51);                // scope 34 at $DIR/reference_prop.rs:+72:5: +72:6
-          return;                          // scope 0 at $DIR/reference_prop.rs:+73:2: +73:2
+          StorageDead(_56);                // scope 36 at $DIR/reference_prop.rs:+71:18: +71:19
+          StorageDead(_55);                // scope 36 at $DIR/reference_prop.rs:+71:19: +71:20
+-         _51 = const ();                  // scope 34 at $DIR/reference_prop.rs:+67:5: +72:6
+          StorageDead(_54);                // scope 35 at $DIR/reference_prop.rs:+72:5: +72:6
+          StorageDead(_52);                // scope 34 at $DIR/reference_prop.rs:+72:5: +72:6
+-         StorageDead(_51);                // scope 0 at $DIR/reference_prop.rs:+72:5: +72:6
+-         StorageLive(_57);                // scope 0 at $DIR/reference_prop.rs:+75:5: +81:6
+          StorageLive(_58);                // scope 37 at $DIR/reference_prop.rs:+76:13: +76:18
+          _58 = const 5_usize;             // scope 37 at $DIR/reference_prop.rs:+76:21: +76:28
+-         StorageLive(_59);                // scope 38 at $DIR/reference_prop.rs:+77:13: +77:14
+-         _59 = &raw mut _58;              // scope 38 at $DIR/reference_prop.rs:+77:17: +77:27
+-         StorageLive(_60);                // scope 39 at $DIR/reference_prop.rs:+78:13: +78:14
+-         _60 = &_59;                      // scope 39 at $DIR/reference_prop.rs:+78:17: +78:19
+          StorageLive(_61);                // scope 40 at $DIR/reference_prop.rs:+79:13: +79:14
+-         _61 = (*_59);                    // scope 40 at $DIR/reference_prop.rs:+79:17: +79:19
++         _61 = _58;                       // scope 40 at $DIR/reference_prop.rs:+79:17: +79:19
+          StorageLive(_62);                // scope 41 at $DIR/reference_prop.rs:+80:9: +80:19
+          StorageLive(_63);                // scope 41 at $DIR/reference_prop.rs:+80:16: +80:18
+          _63 = ();                        // scope 41 at $DIR/reference_prop.rs:+80:16: +80:18
+          _62 = opaque::<()>(move _63) -> bb9; // scope 41 at $DIR/reference_prop.rs:+80:9: +80:19
+                                           // mir::Constant
+                                           // + span: $DIR/reference_prop.rs:378:9: 378:15
+                                           // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+      }
+  
+      bb9: {
+          StorageDead(_63);                // scope 41 at $DIR/reference_prop.rs:+80:18: +80:19
+          StorageDead(_62);                // scope 41 at $DIR/reference_prop.rs:+80:19: +80:20
+-         _57 = const ();                  // scope 37 at $DIR/reference_prop.rs:+75:5: +81:6
+          StorageDead(_61);                // scope 40 at $DIR/reference_prop.rs:+81:5: +81:6
+-         StorageDead(_60);                // scope 39 at $DIR/reference_prop.rs:+81:5: +81:6
+-         StorageDead(_59);                // scope 38 at $DIR/reference_prop.rs:+81:5: +81:6
+          StorageDead(_58);                // scope 37 at $DIR/reference_prop.rs:+81:5: +81:6
+-         StorageDead(_57);                // scope 0 at $DIR/reference_prop.rs:+81:5: +81:6
+          StorageLive(_64);                // scope 42 at $DIR/reference_prop.rs:+85:13: +85:18
+          _64 = const 5_usize;             // scope 42 at $DIR/reference_prop.rs:+85:21: +85:28
+-         StorageLive(_65);                // scope 43 at $DIR/reference_prop.rs:+86:13: +86:18
+-         _65 = &raw mut _64;              // scope 43 at $DIR/reference_prop.rs:+86:21: +86:31
+-         StorageLive(_66);                // scope 44 at $DIR/reference_prop.rs:+87:13: +87:14
+-         _66 = &mut _65;                  // scope 44 at $DIR/reference_prop.rs:+87:17: +87:23
+          StorageLive(_67);                // scope 45 at $DIR/reference_prop.rs:+88:13: +88:14
+-         _67 = (*_65);                    // scope 45 at $DIR/reference_prop.rs:+88:17: +88:19
++         _67 = _64;                       // scope 45 at $DIR/reference_prop.rs:+88:17: +88:19
+          StorageLive(_68);                // scope 46 at $DIR/reference_prop.rs:+89:9: +89:19
+          StorageLive(_69);                // scope 46 at $DIR/reference_prop.rs:+89:16: +89:18
+          _69 = ();                        // scope 46 at $DIR/reference_prop.rs:+89:16: +89:18
+          _68 = opaque::<()>(move _69) -> bb10; // scope 46 at $DIR/reference_prop.rs:+89:9: +89:19
+                                           // mir::Constant
+                                           // + span: $DIR/reference_prop.rs:387:9: 387:15
+                                           // + literal: Const { ty: fn(()) {opaque::<()>}, val: Value(<ZST>) }
+      }
+  
+      bb10: {
+          StorageDead(_69);                // scope 46 at $DIR/reference_prop.rs:+89:18: +89:19
+          StorageDead(_68);                // scope 46 at $DIR/reference_prop.rs:+89:19: +89:20
+          _0 = const ();                   // scope 42 at $DIR/reference_prop.rs:+84:5: +90:6
+          StorageDead(_67);                // scope 45 at $DIR/reference_prop.rs:+90:5: +90:6
+-         StorageDead(_66);                // scope 44 at $DIR/reference_prop.rs:+90:5: +90:6
+-         StorageDead(_65);                // scope 43 at $DIR/reference_prop.rs:+90:5: +90:6
+          StorageDead(_64);                // scope 42 at $DIR/reference_prop.rs:+90:5: +90:6
+          return;                          // scope 0 at $DIR/reference_prop.rs:+91:2: +91:2
       }
   }
   
diff --git a/tests/mir-opt/reference_prop.rs b/tests/mir-opt/reference_prop.rs
index 207658860d2..c8c29fb143e 100644
--- a/tests/mir-opt/reference_prop.rs
+++ b/tests/mir-opt/reference_prop.rs
@@ -80,6 +80,24 @@ fn reference_propagation<'a, T: Copy>(single: &'a T, mut multiple: &'a T) {
         let b = *a; // This should not be optimized.
         opaque(());
     }
+
+    // Fixed-point propagation through a borrowed reference.
+    {
+        let a = 5_usize;
+        let b = &a;
+        let d = &b; // first round promotes debuginfo for `d`
+        let c = *b; // second round propagates this dereference
+        opaque(());
+    }
+
+    // Fixed-point propagation through a borrowed reference.
+    {
+        let a = 5_usize;
+        let mut b = &a;
+        let d = &mut b; // first round promotes debuginfo for `d`
+        let c = *b; // second round propagates this dereference
+        opaque(());
+    }
 }
 
 fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a mut T) {
@@ -155,6 +173,24 @@ fn reference_propagation_mut<'a, T: Copy>(single: &'a mut T, mut multiple: &'a m
         let b = *a; // This should not be optimized.
         opaque(());
     }
+
+    // Fixed-point propagation through a borrowed reference.
+    {
+        let mut a = 5_usize;
+        let b = &mut a;
+        let d = &b; // first round promotes debuginfo for `d`
+        let c = *b; // second round propagates this dereference
+        opaque(());
+    }
+
+    // Fixed-point propagation through a borrowed reference.
+    {
+        let mut a = 5_usize;
+        let mut b = &mut a;
+        let d = &mut b; // first round promotes debuginfo for `d`
+        let c = *b; // second round propagates this dereference
+        opaque(());
+    }
 }
 
 fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *const T) {
@@ -239,6 +275,24 @@ fn reference_propagation_const_ptr<T: Copy>(single: *const T, mut multiple: *con
         let e = *c;
         opaque(());
     }
+
+    // Fixed-point propagation through a borrowed reference.
+    unsafe {
+        let a = 5_usize;
+        let b = &raw const a;
+        let d = &b; // first round promotes debuginfo for `d`
+        let c = *b; // second round propagates this dereference
+        opaque(());
+    }
+
+    // Fixed-point propagation through a borrowed reference.
+    unsafe {
+        let a = 5_usize;
+        let mut b = &raw const a;
+        let d = &mut b; // first round promotes debuginfo for `d`
+        let c = *b; // second round propagates this dereference
+        opaque(());
+    }
 }
 
 fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T) {
@@ -314,6 +368,24 @@ fn reference_propagation_mut_ptr<T: Copy>(single: *mut T, mut multiple: *mut T)
         let b = *a; // This should not be optimized.
         opaque(());
     }
+
+    // Fixed-point propagation through a borrowed reference.
+    unsafe {
+        let mut a = 5_usize;
+        let b = &raw mut a;
+        let d = &b; // first round promotes debuginfo for `d`
+        let c = *b; // second round propagates this dereference
+        opaque(());
+    }
+
+    // Fixed-point propagation through a borrowed reference.
+    unsafe {
+        let mut a = 5_usize;
+        let mut b = &raw mut a;
+        let d = &mut b; // first round promotes debuginfo for `d`
+        let c = *b; // second round propagates this dereference
+        opaque(());
+    }
 }
 
 #[custom_mir(dialect = "runtime", phase = "post-cleanup")]
diff --git a/tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff b/tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff
index 7ef6832570f..b754aff4755 100644
--- a/tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff
+++ b/tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff
@@ -36,7 +36,7 @@
           _5 = (*_3);                      // scope 4 at $DIR/reference_prop.rs:+5:25: +5:27
           _4 = opaque::<i32>(move _5) -> bb1; // scope 4 at $DIR/reference_prop.rs:+5:18: +5:28
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:452:18: 452:24
+                                           // + span: $DIR/reference_prop.rs:524:18: 524:24
                                            // + literal: Const { ty: fn(i32) {opaque::<i32>}, val: Value(<ZST>) }
       }
   
@@ -52,7 +52,7 @@
 +         _7 = (*_3);                      // scope 5 at $DIR/reference_prop.rs:+9:21: +9:23
           _6 = opaque::<i32>(move _7) -> bb2; // scope 5 at $DIR/reference_prop.rs:+9:14: +9:24
                                            // mir::Constant
-                                           // + span: $DIR/reference_prop.rs:456:14: 456:20
+                                           // + span: $DIR/reference_prop.rs:528:14: 528:20
                                            // + literal: Const { ty: fn(i32) {opaque::<i32>}, val: Value(<ZST>) }
       }
   
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 6fd0f936742..afdcf57815f 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
@@ -3,128 +3,79 @@
   
   fn variant_a::{closure#0}(_1: &mut [closure@$DIR/slice_filter.rs:8:25: 8:39], _2: &&(usize, usize, usize, usize)) -> bool {
       let mut _0: bool;                    // return place in scope 0 at $DIR/slice_filter.rs:+0:40: +0:40
-      let _3: &usize;                      // in scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
-      let _4: &usize;                      // in scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
-      let _5: &usize;                      // in scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
-      let _6: &usize;                      // in scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
-      let mut _7: bool;                    // in scope 0 at $DIR/slice_filter.rs:+0:40: +0:56
-      let mut _8: bool;                    // in scope 0 at $DIR/slice_filter.rs:+0:40: +0:46
-      let _9: &usize;                      // in scope 0 at $DIR/slice_filter.rs:+0:45: +0:46
-      let mut _10: bool;                   // in scope 0 at $DIR/slice_filter.rs:+0:50: +0:56
-      let _11: &usize;                     // in scope 0 at $DIR/slice_filter.rs:+0:55: +0:56
-      let mut _12: bool;                   // in scope 0 at $DIR/slice_filter.rs:+0:60: +0:76
-      let mut _13: bool;                   // in scope 0 at $DIR/slice_filter.rs:+0:60: +0:66
-      let _14: &usize;                     // in scope 0 at $DIR/slice_filter.rs:+0:65: +0:66
-      let mut _15: bool;                   // in scope 0 at $DIR/slice_filter.rs:+0:70: +0:76
-      let _16: &usize;                     // in scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
-      let mut _17: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
-      let mut _18: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
-      let mut _19: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
-      let mut _20: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
+      let mut _3: bool;                    // in scope 0 at $DIR/slice_filter.rs:+0:40: +0:56
+      let mut _4: bool;                    // in scope 0 at $DIR/slice_filter.rs:+0:40: +0:46
+      let mut _5: bool;                    // in scope 0 at $DIR/slice_filter.rs:+0:50: +0:56
+      let mut _6: bool;                    // in scope 0 at $DIR/slice_filter.rs:+0:60: +0:76
+      let mut _7: bool;                    // in scope 0 at $DIR/slice_filter.rs:+0:60: +0:66
+      let mut _8: bool;                    // in scope 0 at $DIR/slice_filter.rs:+0:70: +0:76
+      let mut _9: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
+      let mut _10: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
+      let mut _11: &(usize, usize, usize, usize); // in scope 0 at $DIR/slice_filter.rs:+0:26: +0:38
+      let mut _12: &(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
--         debug c => _5;                   // in scope 1 at $DIR/slice_filter.rs:+0:33: +0:34
--         debug d => _6;                   // in scope 1 at $DIR/slice_filter.rs:+0:36: +0:37
-+         debug a => _14;                  // in scope 1 at $DIR/slice_filter.rs:+0:27: +0:28
-+         debug b => _11;                  // in scope 1 at $DIR/slice_filter.rs:+0:30: +0:31
-+         debug c => _9;                   // in scope 1 at $DIR/slice_filter.rs:+0:33: +0:34
-+         debug d => _16;                  // in scope 1 at $DIR/slice_filter.rs:+0:36: +0:37
+          debug a => &((*_9).0: usize);    // in scope 1 at $DIR/slice_filter.rs:+0:27: +0:28
+          debug b => &((*_10).1: usize);   // in scope 1 at $DIR/slice_filter.rs:+0:30: +0:31
+          debug c => &((*_11).2: usize);   // in scope 1 at $DIR/slice_filter.rs:+0:33: +0:34
+          debug d => &((*_12).3: usize);   // in scope 1 at $DIR/slice_filter.rs:+0:36: +0:37
           scope 2 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:40: 8:46
--             debug self => &_3;           // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+             debug self => &_14;          // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              debug other => &_9;          // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              let mut _21: &usize;         // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              let mut _22: &usize;         // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              debug self => &&((*_9).0: usize); // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              debug other => &&((*_11).2: 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 => _21;       // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  debug other => _22;      // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  let mut _23: usize;      // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  let mut _24: usize;      // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  debug self => &((*_9).0: usize); // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  debug other => &((*_11).2: usize); // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  let mut _13: usize;      // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  let mut _14: 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 => &_5;           // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+             debug self => &_9;           // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              debug other => &_14;         // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              let mut _25: &usize;         // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              let mut _26: &usize;         // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              debug self => &&((*_11).2: usize); // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              debug other => &&((*_9).0: 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 => _25;       // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  debug other => _26;      // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  let mut _27: usize;      // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  let mut _28: usize;      // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  debug self => &((*_11).2: usize); // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  debug other => &((*_9).0: usize); // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  let mut _15: usize;      // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  let mut _16: 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 => &_6;           // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+             debug self => &_16;          // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              debug other => &_11;         // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              let mut _29: &usize;         // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              let mut _30: &usize;         // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              debug self => &&((*_12).3: usize); // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              debug other => &&((*_10).1: 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 => _29;       // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  debug other => _30;      // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  let mut _31: usize;      // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  let mut _32: usize;      // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  debug self => &((*_12).3: usize); // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  debug other => &((*_10).1: usize); // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  let mut _17: usize;      // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  let mut _18: 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 => &_4;           // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+             debug self => &_11;          // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              debug other => &_16;         // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              let mut _33: &usize;         // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-              let mut _34: &usize;         // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              debug self => &&((*_10).1: usize); // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
+              debug other => &&((*_12).3: 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 => _33;       // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  debug other => _34;      // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  let mut _35: usize;      // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  let mut _36: usize;      // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  debug self => &((*_10).1: usize); // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  debug other => &((*_12).3: usize); // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  let mut _19: usize;      // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+                  let mut _20: usize;      // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
               }
           }
       }
   
       bb0: {
--         StorageLive(_3);                 // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
-+         nop;                             // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
-          _17 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
--         _3 = &((*_17).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
-+         _14 = &((*_17).0: usize);        // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
-+         nop;                             // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
-          _18 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
--         _4 = &((*_18).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
-+         _11 = &((*_18).1: usize);        // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
-+         nop;                             // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
-          _19 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
--         _5 = &((*_19).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
-+         _9 = &((*_19).2: usize);         // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
-+         nop;                             // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
-          _20 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
--         _6 = &((*_20).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
-+         _16 = &((*_20).3: usize);        // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
+          _9 = deref_copy (*_2);           // scope 0 at $DIR/slice_filter.rs:+0:27: +0:28
+          _10 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:30: +0:31
+          _11 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:33: +0:34
+          _12 = deref_copy (*_2);          // scope 0 at $DIR/slice_filter.rs:+0:36: +0:37
+-         StorageLive(_3);                 // 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:45: +0:46
--         _9 = _5;                         // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
--         _21 = deref_copy _3;             // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
-+         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
-+         _21 = deref_copy _14;            // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _22 = deref_copy _9;             // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageLive(_23);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _23 = (*_21);                    // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageLive(_24);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _24 = (*_22);                    // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _8 = Le(move _23, move _24);     // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageDead(_24);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageDead(_23);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
--         StorageDead(_9);                 // scope 1 at $DIR/slice_filter.rs:+0:45: +0:46
-+         nop;                             // 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
+          StorageLive(_4);                 // scope 1 at $DIR/slice_filter.rs:+0:40: +0:46
+          StorageLive(_13);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _13 = ((*_9).0: usize);          // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageLive(_14);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _14 = ((*_11).2: usize);         // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _4 = Le(move _13, move _14);     // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_14);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_13);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          switchInt(move _4) -> [0: bb4, otherwise: bb5]; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
       }
   
       bb1: {
@@ -133,115 +84,80 @@
       }
   
       bb2: {
--         StorageLive(_12);                // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
+-         StorageLive(_6);                 // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
 +         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
-          StorageLive(_13);                // scope 1 at $DIR/slice_filter.rs:+0:60: +0:66
--         StorageLive(_14);                // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
--         _14 = _3;                        // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
--         _25 = deref_copy _5;             // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
-+         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
-+         _25 = deref_copy _9;             // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _26 = deref_copy _14;            // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageLive(_27);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _27 = (*_25);                    // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageLive(_28);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _28 = (*_26);                    // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _13 = Le(move _27, move _28);    // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageDead(_28);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageDead(_27);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
--         StorageDead(_14);                // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
-+         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:65: +0:66
-          switchInt(move _13) -> [0: bb6, otherwise: bb7]; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
+          StorageLive(_7);                 // scope 1 at $DIR/slice_filter.rs:+0:60: +0:66
+          StorageLive(_15);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _15 = ((*_11).2: usize);         // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageLive(_16);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _16 = ((*_9).0: usize);          // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _7 = Le(move _15, move _16);     // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_16);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_15);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          switchInt(move _7) -> [0: bb6, otherwise: bb7]; // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
       }
   
       bb3: {
--         StorageDead(_12);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
--         StorageDead(_7);                 // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
--         StorageDead(_6);                 // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
--         StorageDead(_5);                 // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
--         StorageDead(_4);                 // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
--         StorageDead(_3);                 // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
+-         StorageDead(_6);                 // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
+-         StorageDead(_3);                 // 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
-+         nop;                             // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
-+         nop;                             // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
-+         nop;                             // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
-+         nop;                             // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
           return;                          // scope 0 at $DIR/slice_filter.rs:+0:76: +0:76
       }
   
       bb4: {
--         StorageDead(_10);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
+-         StorageDead(_5);                 // 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
+          StorageDead(_4);                 // 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(_10);                // scope 1 at $DIR/slice_filter.rs:+0:50: +0:56
--         StorageLive(_11);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
--         _11 = _4;                        // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
--         _29 = deref_copy _6;             // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-         StorageLive(_5);                 // scope 1 at $DIR/slice_filter.rs:+0:50: +0:56
 +         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:50: +0:56
-+         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
-+         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
-+         _29 = deref_copy _16;            // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _30 = deref_copy _11;            // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageLive(_31);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _31 = (*_29);                    // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageLive(_32);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _32 = (*_30);                    // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _10 = Le(move _31, move _32);    // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageDead(_32);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageDead(_31);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
--         StorageDead(_11);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
--         _7 = move _10;                   // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
--         StorageDead(_10);                // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
-+         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
+          StorageLive(_17);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _17 = ((*_12).3: usize);         // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageLive(_18);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _18 = ((*_10).1: usize);         // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _5 = Le(move _17, move _18);     // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_18);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_17);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-         _3 = move _5;                    // scope 1 at $DIR/slice_filter.rs:+0:40: +0:56
+-         StorageDead(_5);                 // 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 _10) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
+          StorageDead(_4);                 // scope 1 at $DIR/slice_filter.rs:+0:55: +0:56
+-         switchInt(move _3) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
++         switchInt(move _5) -> [0: bb2, otherwise: bb1]; // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
       }
   
       bb6: {
--         _12 = const false;               // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
+-         _6 = 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(_15);                // scope 1 at $DIR/slice_filter.rs:+0:70: +0:76
--         StorageLive(_16);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
--         _16 = _6;                        // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
--         _33 = deref_copy _4;             // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-         StorageLive(_8);                 // scope 1 at $DIR/slice_filter.rs:+0:70: +0:76
 +         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:70: +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
-+         _33 = deref_copy _11;            // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _34 = deref_copy _16;            // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageLive(_35);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _35 = (*_33);                    // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageLive(_36);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _36 = (*_34);                    // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
--         _15 = Le(move _35, move _36);    // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+         _0 = Le(move _35, move _36);     // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageDead(_36);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          StorageDead(_35);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
--         StorageDead(_16);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
--         _12 = move _15;                  // scope 1 at $DIR/slice_filter.rs:+0:60: +0:76
-+         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
+          StorageLive(_19);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _19 = ((*_10).1: usize);         // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageLive(_20);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          _20 = ((*_12).3: usize);         // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-         _8 = Le(move _19, move _20);     // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
++         _0 = Le(move _19, move _20);     // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_20);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+          StorageDead(_19);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-         _6 = move _8;                    // 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(_15);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
+-         StorageDead(_8);                 // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
 +         nop;                             // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
-          StorageDead(_13);                // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
--         _0 = move _12;                   // scope 1 at $DIR/slice_filter.rs:+0:40: +0:76
+          StorageDead(_7);                 // scope 1 at $DIR/slice_filter.rs:+0:75: +0:76
+-         _0 = move _6;                    // 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_a-{closure#0}.ReferencePropagation.diff b/tests/mir-opt/slice_filter.variant_a-{closure#0}.ReferencePropagation.diff
index 503af523872..2534eeef432 100644
--- a/tests/mir-opt/slice_filter.variant_a-{closure#0}.ReferencePropagation.diff
+++ b/tests/mir-opt/slice_filter.variant_a-{closure#0}.ReferencePropagation.diff
@@ -38,20 +38,26 @@
       let mut _49: &usize;                 // in scope 0 at $SRC_DIR/core/src/cmp.rs:LL:COL
       let mut _50: &usize;                 // in scope 0 at $SRC_DIR/core/src/cmp.rs:LL:COL
       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
-          debug c => _5;                   // in scope 1 at $DIR/slice_filter.rs:+0:33: +0:34
-          debug d => _6;                   // in scope 1 at $DIR/slice_filter.rs:+0:36: +0:37
+-         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
+-         debug c => _5;                   // in scope 1 at $DIR/slice_filter.rs:+0:33: +0:34
+-         debug d => _6;                   // in scope 1 at $DIR/slice_filter.rs:+0:36: +0:37
++         debug a => &((*_25).0: usize);   // in scope 1 at $DIR/slice_filter.rs:+0:27: +0:28
++         debug b => &((*_26).1: usize);   // in scope 1 at $DIR/slice_filter.rs:+0:30: +0:31
++         debug c => &((*_27).2: usize);   // in scope 1 at $DIR/slice_filter.rs:+0:33: +0:34
++         debug d => &((*_28).3: usize);   // in scope 1 at $DIR/slice_filter.rs:+0:36: +0:37
           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
-+             debug self => &_3;           // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+             debug other => &_11;         // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
++             debug self => &&((*_25).0: usize); // in scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
++             debug other => &&((*_27).2: 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 => _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
+-                 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
++                 debug self => &((*_25).0: usize); // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
++                 debug other => &((*_27).2: usize); // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
                   let mut _33: usize;      // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
                   let mut _34: usize;      // in scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
               }
@@ -59,13 +65,15 @@
           scope 4 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:60: 8:66
 -             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
-+             debug self => &_5;           // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+             debug other => &_20;         // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
++             debug self => &&((*_27).2: usize); // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
++             debug other => &&((*_25).0: usize); // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
               let mut _35: &usize;         // in scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
               let mut _36: &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 => _35;       // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  debug other => _36;      // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-                 debug self => _35;       // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-                 debug other => _36;      // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
++                 debug self => &((*_27).2: usize); // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
++                 debug other => &((*_25).0: usize); // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
                   let mut _39: usize;      // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
                   let mut _40: usize;      // in scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
               }
@@ -73,13 +81,15 @@
           scope 6 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:50: 8:56
 -             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
-+             debug self => &_6;           // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+             debug other => &_15;         // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
++             debug self => &&((*_28).3: usize); // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
++             debug other => &&((*_26).1: usize); // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
               let mut _41: &usize;         // in scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
               let mut _42: &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 => _41;       // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  debug other => _42;      // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-                 debug self => _41;       // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-                 debug other => _42;      // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
++                 debug self => &((*_28).3: usize); // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
++                 debug other => &((*_26).1: usize); // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
                   let mut _45: usize;      // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
                   let mut _46: usize;      // in scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
               }
@@ -87,13 +97,15 @@
           scope 8 (inlined cmp::impls::<impl PartialOrd for &usize>::le) { // at $DIR/slice_filter.rs:8:70: 8:76
 -             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
-+             debug self => &_4;           // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+             debug other => &_24;         // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
++             debug self => &&((*_26).1: usize); // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
++             debug other => &&((*_28).3: usize); // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
               let mut _47: &usize;         // in scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
               let mut _48: &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 => _47;       // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-                  debug other => _48;      // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-                 debug self => _47;       // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-                 debug other => _48;      // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
++                 debug self => &((*_26).1: usize); // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
++                 debug other => &((*_28).3: usize); // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
                   let mut _51: usize;      // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
                   let mut _52: usize;      // in scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
               }
@@ -101,38 +113,38 @@
       }
   
       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
+-         _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
+-         _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
+-         _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
+-         _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
           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
-          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
+-         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
-+         _29 = deref_copy _3;             // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+         _30 = deref_copy _11;            // scope 2 at $SRC_DIR/core/src/cmp.rs:LL:COL
           StorageLive(_33);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _33 = (*_29);                    // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-         _33 = (*_29);                    // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
++         _33 = ((*_25).0: usize);         // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
           StorageLive(_34);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _34 = (*_30);                    // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-         _34 = (*_30);                    // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
++         _34 = ((*_27).2: usize);         // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
           _8 = Le(move _33, move _34);     // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
           StorageDead(_34);                // scope 3 at $SRC_DIR/core/src/cmp.rs:LL:COL
           StorageDead(_33);                // 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(_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
@@ -149,21 +161,21 @@
 -         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
+-         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
 -         _35 = deref_copy (*_18);         // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
 -         _36 = deref_copy (*_19);         // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+         _35 = deref_copy _5;             // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+         _36 = deref_copy _20;            // scope 4 at $SRC_DIR/core/src/cmp.rs:LL:COL
           StorageLive(_39);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _39 = (*_35);                    // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-         _39 = (*_35);                    // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
++         _39 = ((*_27).2: usize);         // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
           StorageLive(_40);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _40 = (*_36);                    // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-         _40 = (*_36);                    // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
++         _40 = ((*_25).0: usize);         // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
           _17 = Le(move _39, move _40);    // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
           StorageDead(_40);                // scope 5 at $SRC_DIR/core/src/cmp.rs:LL:COL
           StorageDead(_39);                // 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(_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
@@ -172,10 +184,10 @@
       bb3: {
           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
-          StorageDead(_6);                 // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
-          StorageDead(_5);                 // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
-          StorageDead(_4);                 // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
-          StorageDead(_3);                 // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
+-         StorageDead(_6);                 // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
+-         StorageDead(_5);                 // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
+-         StorageDead(_4);                 // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
+-         StorageDead(_3);                 // scope 0 at $DIR/slice_filter.rs:+0:75: +0:76
           return;                          // scope 0 at $DIR/slice_filter.rs:+0:76: +0:76
       }
   
@@ -191,21 +203,21 @@
 -         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
+-         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
 -         _41 = deref_copy (*_13);         // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
 -         _42 = deref_copy (*_14);         // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+         _41 = deref_copy _6;             // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+         _42 = deref_copy _15;            // scope 6 at $SRC_DIR/core/src/cmp.rs:LL:COL
           StorageLive(_45);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _45 = (*_41);                    // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-         _45 = (*_41);                    // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
++         _45 = ((*_28).3: usize);         // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
           StorageLive(_46);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _46 = (*_42);                    // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-         _46 = (*_42);                    // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
++         _46 = ((*_26).1: usize);         // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
           _12 = Le(move _45, move _46);    // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
           StorageDead(_46);                // scope 7 at $SRC_DIR/core/src/cmp.rs:LL:COL
           StorageDead(_45);                // 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(_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
@@ -224,21 +236,21 @@
 -         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
+-         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
 -         _47 = deref_copy (*_22);         // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
 -         _48 = deref_copy (*_23);         // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+         _47 = deref_copy _4;             // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
-+         _48 = deref_copy _24;            // scope 8 at $SRC_DIR/core/src/cmp.rs:LL:COL
           StorageLive(_51);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _51 = (*_47);                    // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-         _51 = (*_47);                    // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
++         _51 = ((*_26).1: usize);         // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
           StorageLive(_52);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
-          _52 = (*_48);                    // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
+-         _52 = (*_48);                    // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
++         _52 = ((*_28).3: usize);         // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
           _21 = Le(move _51, move _52);    // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
           StorageDead(_52);                // scope 9 at $SRC_DIR/core/src/cmp.rs:LL:COL
           StorageDead(_51);                // 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(_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