summary refs log tree commit diff
path: root/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-04-30 20:48:29 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2024-05-29 23:54:57 +0000
commit5fa0ec6ad17cd002e9359345bbeae4601c03fd53 (patch)
tree1372c5bf774de4d106909dbb50ce3c41c922609e /tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir
parentdebd22da66cfa97c74040ebf68e420672ac8560e (diff)
downloadrust-5fa0ec6ad17cd002e9359345bbeae4601c03fd53.tar.gz
rust-5fa0ec6ad17cd002e9359345bbeae4601c03fd53.zip
Enable DestinationPropagation by default.
Diffstat (limited to 'tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir')
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir56
1 files changed, 25 insertions, 31 deletions
diff --git a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir
index 5b6441cfb3b..751e14441d4 100644
--- a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir
@@ -6,28 +6,27 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
     let mut _0: ();
     let mut _3: usize;
     let mut _4: usize;
-    let mut _9: std::option::Option<usize>;
-    let mut _11: usize;
-    let mut _12: bool;
-    let mut _14: &impl Fn(usize, &T);
-    let mut _15: (usize, &T);
-    let _16: ();
+    let mut _8: std::option::Option<usize>;
+    let mut _10: usize;
+    let mut _11: bool;
+    let mut _13: &impl Fn(usize, &T);
+    let mut _14: (usize, &T);
+    let _15: ();
     scope 1 {
         debug ((iter: std::ops::Range<usize>).0: usize) => _4;
         debug ((iter: std::ops::Range<usize>).1: usize) => _3;
-        let _10: usize;
+        let _9: usize;
         scope 2 {
-            debug i => _10;
-            let _13: &T;
+            debug i => _9;
+            let _12: &T;
             scope 3 {
-                debug x => _13;
+                debug x => _12;
             }
         }
         scope 5 (inlined iter::range::<impl Iterator for std::ops::Range<usize>>::next) {
             scope 6 (inlined <std::ops::Range<usize> as iter::range::RangeIteratorImpl>::spec_next) {
                 let mut _6: bool;
                 let _7: usize;
-                let mut _8: usize;
                 scope 7 {
                 }
                 scope 8 (inlined std::cmp::impls::<impl PartialOrd for usize>::lt) {
@@ -41,13 +40,12 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
 
     bb0: {
         _3 = Len((*_1));
-        StorageLive(_4);
         _4 = const 0_usize;
         goto -> bb1;
     }
 
     bb1: {
-        StorageLive(_9);
+        StorageLive(_8);
         StorageLive(_7);
         StorageLive(_6);
         StorageLive(_5);
@@ -60,8 +58,7 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
     bb2: {
         StorageDead(_6);
         StorageDead(_7);
-        StorageDead(_9);
-        StorageDead(_4);
+        StorageDead(_8);
         drop(_2) -> [return: bb3, unwind continue];
     }
 
@@ -71,35 +68,32 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
 
     bb4: {
         _7 = _4;
-        StorageLive(_8);
-        _8 = <usize as Step>::forward_unchecked(_7, const 1_usize) -> [return: bb5, unwind: bb8];
+        _4 = <usize as Step>::forward_unchecked(_7, const 1_usize) -> [return: bb5, unwind: bb8];
     }
 
     bb5: {
-        _4 = move _8;
-        StorageDead(_8);
-        _9 = Option::<usize>::Some(_7);
+        _8 = Option::<usize>::Some(_7);
         StorageDead(_6);
         StorageDead(_7);
-        _10 = ((_9 as Some).0: usize);
-        _11 = Len((*_1));
-        _12 = Lt(_10, _11);
-        assert(move _12, "index out of bounds: the length is {} but the index is {}", move _11, _10) -> [success: bb6, unwind: bb8];
+        _9 = ((_8 as Some).0: usize);
+        _10 = Len((*_1));
+        _11 = Lt(_9, _10);
+        assert(move _11, "index out of bounds: the length is {} but the index is {}", move _10, _9) -> [success: bb6, unwind: bb8];
     }
 
     bb6: {
-        _13 = &(*_1)[_10];
+        _12 = &(*_1)[_9];
+        StorageLive(_13);
+        _13 = &_2;
         StorageLive(_14);
-        _14 = &_2;
-        StorageLive(_15);
-        _15 = (_10, _13);
-        _16 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _14, move _15) -> [return: bb7, unwind: bb8];
+        _14 = (_9, _12);
+        _15 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _13, move _14) -> [return: bb7, unwind: bb8];
     }
 
     bb7: {
-        StorageDead(_15);
         StorageDead(_14);
-        StorageDead(_9);
+        StorageDead(_13);
+        StorageDead(_8);
         goto -> bb1;
     }