about summary refs log tree commit diff
path: root/tests/mir-opt/gvn_copy_constant_projection.compare_constant_index.GVN.panic-abort.diff
blob: e2e55304921b25faac1433f69d9d7eca63ce955c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
- // MIR for `compare_constant_index` before GVN
+ // MIR for `compare_constant_index` after GVN
  
  fn compare_constant_index(_1: [i32; 1], _2: [i32; 1]) -> std::cmp::Ordering {
      debug x => _1;
      debug y => _2;
      let mut _0: std::cmp::Ordering;
      let _3: &i32;
      let _4: usize;
      let mut _5: bool;
      let _6: &i32;
      let _7: usize;
      let mut _8: bool;
      scope 1 (inlined std::cmp::impls::<impl Ord for i32>::cmp) {
          let mut _9: i32;
          let mut _10: i32;
      }
  
      bb0: {
-         StorageLive(_4);
+         nop;
          _4 = const 0_usize;
-         _5 = Lt(copy _4, const 1_usize);
-         assert(move _5, "index out of bounds: the length is {} but the index is {}", const 1_usize, copy _4) -> [success: bb1, unwind unreachable];
+         _5 = const true;
+         assert(const true, "index out of bounds: the length is {} but the index is {}", const 1_usize, const 0_usize) -> [success: bb1, unwind unreachable];
      }
  
      bb1: {
-         _3 = &_1[_4];
+         _3 = &_1[0 of 1];
          StorageLive(_7);
          _7 = const 0_usize;
-         _8 = Lt(copy _7, const 1_usize);
-         assert(move _8, "index out of bounds: the length is {} but the index is {}", const 1_usize, copy _7) -> [success: bb2, unwind unreachable];
+         _8 = const true;
+         assert(const true, "index out of bounds: the length is {} but the index is {}", const 1_usize, const 0_usize) -> [success: bb2, unwind unreachable];
      }
  
      bb2: {
-         _6 = &_2[_7];
+         _6 = &_2[0 of 1];
          StorageLive(_9);
-         _9 = copy (*_3);
+         _9 = copy _1[0 of 1];
          StorageLive(_10);
-         _10 = copy (*_6);
+         _10 = copy _2[0 of 1];
          _0 = Cmp(move _9, move _10);
          StorageDead(_10);
          StorageDead(_9);
          StorageDead(_7);
-         StorageDead(_4);
+         nop;
          return;
      }
  }