summaryrefslogtreecommitdiffstats
path: root/src/test/mir-opt/simplify_arm.id_result.SimplifyArmIdentity.diff
blob: 31d8453cec0157e89aca8b0cc8e6a363e6f6b549 (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 `id_result` before SimplifyArmIdentity
+ // MIR for `id_result` after SimplifyArmIdentity
  
  fn id_result(_1: Result<u8, i32>) -> Result<u8, i32> {
      debug r => _1;                       // in scope 0 at $DIR/simplify-arm.rs:+0:14: +0:15
      let mut _0: std::result::Result<u8, i32>; // return place in scope 0 at $DIR/simplify-arm.rs:+0:37: +0:52
      let mut _2: isize;                   // in scope 0 at $DIR/simplify-arm.rs:+2:9: +2:14
      let _3: u8;                          // in scope 0 at $DIR/simplify-arm.rs:+2:12: +2:13
      let mut _4: u8;                      // in scope 0 at $DIR/simplify-arm.rs:+2:21: +2:22
      let _5: i32;                         // in scope 0 at $DIR/simplify-arm.rs:+3:13: +3:14
      let mut _6: i32;                     // in scope 0 at $DIR/simplify-arm.rs:+3:23: +3:24
      scope 1 {
          debug x => _3;                   // in scope 1 at $DIR/simplify-arm.rs:+2:12: +2:13
      }
      scope 2 {
          debug y => _5;                   // in scope 2 at $DIR/simplify-arm.rs:+3:13: +3:14
      }
  
      bb0: {
          _2 = discriminant(_1);           // scope 0 at $DIR/simplify-arm.rs:+1:11: +1:12
          switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify-arm.rs:+1:5: +1:12
      }
  
      bb1: {
          StorageLive(_5);                 // scope 0 at $DIR/simplify-arm.rs:+3:13: +3:14
          _5 = ((_1 as Err).0: i32);       // scope 0 at $DIR/simplify-arm.rs:+3:13: +3:14
          StorageLive(_6);                 // scope 2 at $DIR/simplify-arm.rs:+3:23: +3:24
          _6 = _5;                         // scope 2 at $DIR/simplify-arm.rs:+3:23: +3:24
          Deinit(_0);                      // scope 2 at $DIR/simplify-arm.rs:+3:19: +3:25
          ((_0 as Err).0: i32) = move _6;  // scope 2 at $DIR/simplify-arm.rs:+3:19: +3:25
          discriminant(_0) = 1;            // scope 2 at $DIR/simplify-arm.rs:+3:19: +3:25
          StorageDead(_6);                 // scope 2 at $DIR/simplify-arm.rs:+3:24: +3:25
          StorageDead(_5);                 // scope 0 at $DIR/simplify-arm.rs:+3:24: +3:25
          goto -> bb4;                     // scope 0 at $DIR/simplify-arm.rs:+3:24: +3:25
      }
  
      bb2: {
          unreachable;                     // scope 0 at $DIR/simplify-arm.rs:+1:11: +1:12
      }
  
      bb3: {
          StorageLive(_3);                 // scope 0 at $DIR/simplify-arm.rs:+2:12: +2:13
          _3 = ((_1 as Ok).0: u8);         // scope 0 at $DIR/simplify-arm.rs:+2:12: +2:13
          StorageLive(_4);                 // scope 1 at $DIR/simplify-arm.rs:+2:21: +2:22
          _4 = _3;                         // scope 1 at $DIR/simplify-arm.rs:+2:21: +2:22
          Deinit(_0);                      // scope 1 at $DIR/simplify-arm.rs:+2:18: +2:23
          ((_0 as Ok).0: u8) = move _4;    // scope 1 at $DIR/simplify-arm.rs:+2:18: +2:23
          discriminant(_0) = 0;            // scope 1 at $DIR/simplify-arm.rs:+2:18: +2:23
          StorageDead(_4);                 // scope 1 at $DIR/simplify-arm.rs:+2:22: +2:23
          StorageDead(_3);                 // scope 0 at $DIR/simplify-arm.rs:+2:22: +2:23
          goto -> bb4;                     // scope 0 at $DIR/simplify-arm.rs:+2:22: +2:23
      }
  
      bb4: {
          return;                          // scope 0 at $DIR/simplify-arm.rs:+5:2: +5:2
      }
  }