summaryrefslogtreecommitdiff
path: root/tests/mir-opt/reference_prop.unique_with_copies.ReferencePropagation.diff
blob: b754aff47550d9c6544f32d9896d13e087370749 (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
59
60
61
62
63
64
65
66
67
- // MIR for `unique_with_copies` before ReferencePropagation
+ // MIR for `unique_with_copies` after ReferencePropagation
  
  fn unique_with_copies() -> () {
      let mut _0: ();                      // return place in scope 0 at $DIR/reference_prop.rs:+0:25: +0:25
      let _1: *mut i32;                    // in scope 0 at $DIR/reference_prop.rs:+1:9: +1:10
      let mut _2: i32;                     // in scope 0 at $DIR/reference_prop.rs:+2:13: +2:18
      let _4: ();                          // in scope 0 at $DIR/reference_prop.rs:+5:18: +5:28
      let mut _5: i32;                     // in scope 0 at $DIR/reference_prop.rs:+5:25: +5:27
      let _6: ();                          // in scope 0 at $DIR/reference_prop.rs:+9:14: +9:24
      let mut _7: i32;                     // in scope 0 at $DIR/reference_prop.rs:+9:21: +9:23
      scope 1 {
-         debug y => _1;                   // in scope 1 at $DIR/reference_prop.rs:+1:9: +1:10
+         debug y => _3;                   // in scope 1 at $DIR/reference_prop.rs:+1:9: +1:10
          scope 5 {
          }
      }
      scope 2 {
          debug a => _2;                   // in scope 2 at $DIR/reference_prop.rs:+2:13: +2:18
          let _3: *mut i32;                // in scope 2 at $DIR/reference_prop.rs:+3:13: +3:14
          scope 3 {
              debug x => _3;               // in scope 3 at $DIR/reference_prop.rs:+3:13: +3:14
              scope 4 {
              }
          }
      }
  
      bb0: {
-         StorageLive(_1);                 // scope 0 at $DIR/reference_prop.rs:+1:9: +1:10
          StorageLive(_2);                 // scope 0 at $DIR/reference_prop.rs:+2:13: +2:18
          _2 = const 0_i32;                // scope 0 at $DIR/reference_prop.rs:+2:21: +2:22
-         StorageLive(_3);                 // scope 2 at $DIR/reference_prop.rs:+3:13: +3:14
          _3 = &raw mut _2;                // scope 2 at $DIR/reference_prop.rs:+3:17: +3:27
          StorageLive(_4);                 // scope 3 at $DIR/reference_prop.rs:+5:9: +5:30
          StorageLive(_5);                 // scope 4 at $DIR/reference_prop.rs:+5:25: +5:27
          _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:524:18: 524:24
                                           // + literal: Const { ty: fn(i32) {opaque::<i32>}, val: Value(<ZST>) }
      }
  
      bb1: {
          StorageDead(_5);                 // scope 4 at $DIR/reference_prop.rs:+5:27: +5:28
          StorageDead(_4);                 // scope 3 at $DIR/reference_prop.rs:+5:30: +5:31
-         _1 = _3;                         // scope 3 at $DIR/reference_prop.rs:+6:9: +6:10
-         StorageDead(_3);                 // scope 2 at $DIR/reference_prop.rs:+7:5: +7:6
          StorageDead(_2);                 // scope 0 at $DIR/reference_prop.rs:+7:5: +7:6
          StorageLive(_6);                 // scope 1 at $DIR/reference_prop.rs:+9:5: +9:26
          StorageLive(_7);                 // scope 5 at $DIR/reference_prop.rs:+9:21: +9:23
-         _7 = (*_1);                      // scope 5 at $DIR/reference_prop.rs:+9:21: +9:23
+         _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:528:14: 528:20
                                           // + literal: Const { ty: fn(i32) {opaque::<i32>}, val: Value(<ZST>) }
      }
  
      bb2: {
          StorageDead(_7);                 // scope 5 at $DIR/reference_prop.rs:+9:23: +9:24
          StorageDead(_6);                 // scope 1 at $DIR/reference_prop.rs:+9:26: +9:27
          _0 = const ();                   // scope 0 at $DIR/reference_prop.rs:+0:25: +10:2
-         StorageDead(_1);                 // scope 0 at $DIR/reference_prop.rs:+10:1: +10:2
          return;                          // scope 0 at $DIR/reference_prop.rs:+10:2: +10:2
      }
  }