summaryrefslogtreecommitdiff
path: root/tests/mir-opt/reference_prop.maybe_dead.ReferencePropagation.diff
blob: 920755bdd1df94592ec0ca3a98ad6c74f19c22b7 (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
- // MIR for `maybe_dead` before ReferencePropagation
+ // MIR for `maybe_dead` after ReferencePropagation
  
  fn maybe_dead(_1: bool) -> () {
      let mut _0: ();                      // return place in scope 0 at $DIR/reference_prop.rs:+0:24: +0:24
      let mut _2: i32;                     // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
      let mut _3: i32;                     // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
      let mut _4: &i32;                    // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
      let mut _5: &mut i32;                // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
      let mut _6: i32;                     // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
      let mut _7: i32;                     // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
      let mut _8: i32;                     // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
  
      bb0: {
          StorageLive(_2);                 // scope 0 at $DIR/reference_prop.rs:+7:13: +7:27
          StorageLive(_3);                 // scope 0 at $DIR/reference_prop.rs:+8:13: +8:27
          _2 = const 5_i32;                // scope 0 at $DIR/reference_prop.rs:+9:13: +9:18
          _3 = const 5_i32;                // scope 0 at $DIR/reference_prop.rs:+10:13: +10:18
          _4 = &_2;                        // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
          _5 = &mut _3;                    // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
          (*_5) = const 7_i32;             // scope 0 at $DIR/reference_prop.rs:+14:13: +14:19
-         _6 = (*_4);                      // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+         _6 = _2;                         // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
          switchInt(_1) -> [1: bb1, otherwise: bb2]; // scope 0 at $DIR/reference_prop.rs:+17:13: +17:46
      }
  
      bb1: {
          StorageDead(_2);                 // scope 0 at $DIR/reference_prop.rs:+20:13: +20:27
          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
                                           // + literal: Const { ty: fn(i32) {opaque::<i32>}, val: Value(<ZST>) }
      }
  
      bb2: {
          _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
                                           // + literal: Const { ty: fn(i32) {opaque::<i32>}, val: Value(<ZST>) }
      }
  
      bb3: {
          _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
                                           // + literal: Const { ty: fn(i32) {opaque::<i32>}, val: Value(<ZST>) }
      }
  
      bb4: {
          return;                          // scope 0 at $DIR/reference_prop.rs:+36:13: +36:21
      }
  }