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