|
1 | 1 | - // MIR for `opt1` before EarlyOtherwiseBranch
|
2 | 2 | + // MIR for `opt1` after EarlyOtherwiseBranch
|
3 | 3 |
|
4 |
| - fn opt1(_1: std::option::Option<usize>, _2: std::option::Option<usize>) -> usize { |
5 |
| - debug x => _1; // in scope 0 at $DIR/early_otherwise_branch.rs:5:9: 5:10 |
6 |
| - debug y => _2; // in scope 0 at $DIR/early_otherwise_branch.rs:5:27: 5:28 |
7 |
| - let mut _0: usize; // return place in scope 0 at $DIR/early_otherwise_branch.rs:5:47: 5:52 |
8 |
| - let mut _3: (std::option::Option<usize>, std::option::Option<usize>); // in scope 0 at $DIR/early_otherwise_branch.rs:6:11: 6:16 |
9 |
| - let mut _4: std::option::Option<usize>; // in scope 0 at $DIR/early_otherwise_branch.rs:6:12: 6:13 |
10 |
| - let mut _5: std::option::Option<usize>; // in scope 0 at $DIR/early_otherwise_branch.rs:6:14: 6:15 |
11 |
| - let mut _6: isize; // in scope 0 at $DIR/early_otherwise_branch.rs:7:19: 7:26 |
12 |
| - let mut _7: isize; // in scope 0 at $DIR/early_otherwise_branch.rs:7:10: 7:17 |
13 |
| - let _8: usize; // in scope 0 at $DIR/early_otherwise_branch.rs:7:15: 7:16 |
14 |
| - let _9: usize; // in scope 0 at $DIR/early_otherwise_branch.rs:7:24: 7:25 |
15 |
| -+ let mut _10: isize; // in scope 0 at $DIR/early_otherwise_branch.rs:7:19: 7:26 |
16 |
| -+ let mut _11: bool; // in scope 0 at $DIR/early_otherwise_branch.rs:7:19: 7:26 |
| 4 | + fn opt1(_1: Option<u32>, _2: Option<u32>) -> u32 { |
| 5 | + debug x => _1; // in scope 0 at $DIR/early_otherwise_branch.rs:3:9: 3:10 |
| 6 | + debug y => _2; // in scope 0 at $DIR/early_otherwise_branch.rs:3:25: 3:26 |
| 7 | + let mut _0: u32; // return place in scope 0 at $DIR/early_otherwise_branch.rs:3:44: 3:47 |
| 8 | + let mut _3: (std::option::Option<u32>, std::option::Option<u32>); // in scope 0 at $DIR/early_otherwise_branch.rs:4:11: 4:17 |
| 9 | + let mut _4: std::option::Option<u32>; // in scope 0 at $DIR/early_otherwise_branch.rs:4:12: 4:13 |
| 10 | + let mut _5: std::option::Option<u32>; // in scope 0 at $DIR/early_otherwise_branch.rs:4:15: 4:16 |
| 11 | + let mut _6: isize; // in scope 0 at $DIR/early_otherwise_branch.rs:5:19: 5:26 |
| 12 | + let mut _7: isize; // in scope 0 at $DIR/early_otherwise_branch.rs:5:10: 5:17 |
| 13 | + let _8: u32; // in scope 0 at $DIR/early_otherwise_branch.rs:5:15: 5:16 |
| 14 | + let _9: u32; // in scope 0 at $DIR/early_otherwise_branch.rs:5:24: 5:25 |
| 15 | ++ let mut _10: isize; // in scope 0 at $DIR/early_otherwise_branch.rs:5:19: 5:26 |
| 16 | ++ let mut _11: bool; // in scope 0 at $DIR/early_otherwise_branch.rs:5:19: 5:26 |
17 | 17 | scope 1 {
|
18 |
| - debug a => _8; // in scope 1 at $DIR/early_otherwise_branch.rs:7:15: 7:16 |
19 |
| - debug b => _9; // in scope 1 at $DIR/early_otherwise_branch.rs:7:24: 7:25 |
| 18 | + debug a => _8; // in scope 1 at $DIR/early_otherwise_branch.rs:5:15: 5:16 |
| 19 | + debug b => _9; // in scope 1 at $DIR/early_otherwise_branch.rs:5:24: 5:25 |
20 | 20 | }
|
21 | 21 |
|
22 | 22 | bb0: {
|
23 |
| - StorageLive(_3); // scope 0 at $DIR/early_otherwise_branch.rs:6:11: 6:16 |
24 |
| - StorageLive(_4); // scope 0 at $DIR/early_otherwise_branch.rs:6:12: 6:13 |
25 |
| - _4 = _1; // scope 0 at $DIR/early_otherwise_branch.rs:6:12: 6:13 |
26 |
| - StorageLive(_5); // scope 0 at $DIR/early_otherwise_branch.rs:6:14: 6:15 |
27 |
| - _5 = _2; // scope 0 at $DIR/early_otherwise_branch.rs:6:14: 6:15 |
28 |
| - (_3.0: std::option::Option<usize>) = move _4; // scope 0 at $DIR/early_otherwise_branch.rs:6:11: 6:16 |
29 |
| - (_3.1: std::option::Option<usize>) = move _5; // scope 0 at $DIR/early_otherwise_branch.rs:6:11: 6:16 |
30 |
| - StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch.rs:6:15: 6:16 |
31 |
| - StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch.rs:6:15: 6:16 |
32 |
| - _7 = discriminant((_3.0: std::option::Option<usize>)); // scope 0 at $DIR/early_otherwise_branch.rs:7:10: 7:17 |
33 |
| -- switchInt(move _7) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:7:10: 7:17 |
34 |
| -+ StorageLive(_10); // scope 0 at $DIR/early_otherwise_branch.rs:7:10: 7:17 |
35 |
| -+ _10 = discriminant((_3.1: std::option::Option<usize>)); // scope 0 at $DIR/early_otherwise_branch.rs:7:10: 7:17 |
36 |
| -+ StorageLive(_11); // scope 0 at $DIR/early_otherwise_branch.rs:7:10: 7:17 |
37 |
| -+ _11 = Ne(_10, _7); // scope 0 at $DIR/early_otherwise_branch.rs:7:10: 7:17 |
38 |
| -+ StorageDead(_10); // scope 0 at $DIR/early_otherwise_branch.rs:7:10: 7:17 |
39 |
| -+ switchInt(move _11) -> [false: bb6, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:7:10: 7:17 |
| 23 | + StorageLive(_3); // scope 0 at $DIR/early_otherwise_branch.rs:4:11: 4:17 |
| 24 | + StorageLive(_4); // scope 0 at $DIR/early_otherwise_branch.rs:4:12: 4:13 |
| 25 | + _4 = _1; // scope 0 at $DIR/early_otherwise_branch.rs:4:12: 4:13 |
| 26 | + StorageLive(_5); // scope 0 at $DIR/early_otherwise_branch.rs:4:15: 4:16 |
| 27 | + _5 = _2; // scope 0 at $DIR/early_otherwise_branch.rs:4:15: 4:16 |
| 28 | + (_3.0: std::option::Option<u32>) = move _4; // scope 0 at $DIR/early_otherwise_branch.rs:4:11: 4:17 |
| 29 | + (_3.1: std::option::Option<u32>) = move _5; // scope 0 at $DIR/early_otherwise_branch.rs:4:11: 4:17 |
| 30 | + StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch.rs:4:16: 4:17 |
| 31 | + StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch.rs:4:16: 4:17 |
| 32 | + _7 = discriminant((_3.0: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:5:10: 5:17 |
| 33 | +- switchInt(move _7) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:5:10: 5:17 |
| 34 | ++ StorageLive(_10); // scope 0 at $DIR/early_otherwise_branch.rs:5:10: 5:17 |
| 35 | ++ _10 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:5:10: 5:17 |
| 36 | ++ StorageLive(_11); // scope 0 at $DIR/early_otherwise_branch.rs:5:10: 5:17 |
| 37 | ++ _11 = Ne(_10, _7); // scope 0 at $DIR/early_otherwise_branch.rs:5:10: 5:17 |
| 38 | ++ StorageDead(_10); // scope 0 at $DIR/early_otherwise_branch.rs:5:10: 5:17 |
| 39 | ++ switchInt(move _11) -> [false: bb6, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:5:10: 5:17 |
40 | 40 | }
|
41 | 41 |
|
42 | 42 | bb1: {
|
43 |
| - _0 = const 1_usize; // scope 0 at $DIR/early_otherwise_branch.rs:8:14: 8:15 |
44 |
| - // ty::Const |
45 |
| - // + ty: usize |
46 |
| - // + val: Value(Scalar(0x0000000000000001)) |
47 |
| - // mir::Constant |
48 |
| - // + span: $DIR/early_otherwise_branch.rs:8:14: 8:15 |
49 |
| - // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) } |
50 |
| - goto -> bb4; // scope 0 at $DIR/early_otherwise_branch.rs:6:5: 9:6 |
| 43 | + _0 = const 1_u32; // scope 0 at $DIR/early_otherwise_branch.rs:6:14: 6:15 |
| 44 | + goto -> bb4; // scope 0 at $DIR/early_otherwise_branch.rs:4:5: 7:6 |
51 | 45 | }
|
52 | 46 |
|
53 | 47 | bb2: {
|
54 |
| - _6 = discriminant((_3.1: std::option::Option<usize>)); // scope 0 at $DIR/early_otherwise_branch.rs:7:19: 7:26 |
55 |
| - switchInt(move _6) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:7:19: 7:26 |
| 48 | + _6 = discriminant((_3.1: std::option::Option<u32>)); // scope 0 at $DIR/early_otherwise_branch.rs:5:19: 5:26 |
| 49 | + switchInt(move _6) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:5:19: 5:26 |
56 | 50 | }
|
57 | 51 |
|
58 | 52 | bb3: {
|
59 |
| - StorageLive(_8); // scope 0 at $DIR/early_otherwise_branch.rs:7:15: 7:16 |
60 |
| - _8 = (((_3.0: std::option::Option<usize>) as Some).0: usize); // scope 0 at $DIR/early_otherwise_branch.rs:7:15: 7:16 |
61 |
| - StorageLive(_9); // scope 0 at $DIR/early_otherwise_branch.rs:7:24: 7:25 |
62 |
| - _9 = (((_3.1: std::option::Option<usize>) as Some).0: usize); // scope 0 at $DIR/early_otherwise_branch.rs:7:24: 7:25 |
63 |
| - _0 = const 0_usize; // scope 1 at $DIR/early_otherwise_branch.rs:7:31: 7:32 |
64 |
| - // ty::Const |
65 |
| - // + ty: usize |
66 |
| - // + val: Value(Scalar(0x0000000000000000)) |
67 |
| - // mir::Constant |
68 |
| - // + span: $DIR/early_otherwise_branch.rs:7:31: 7:32 |
69 |
| - // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) } |
70 |
| - StorageDead(_9); // scope 0 at $DIR/early_otherwise_branch.rs:7:31: 7:32 |
71 |
| - StorageDead(_8); // scope 0 at $DIR/early_otherwise_branch.rs:7:31: 7:32 |
72 |
| - goto -> bb4; // scope 0 at $DIR/early_otherwise_branch.rs:6:5: 9:6 |
| 53 | + StorageLive(_8); // scope 0 at $DIR/early_otherwise_branch.rs:5:15: 5:16 |
| 54 | + _8 = (((_3.0: std::option::Option<u32>) as Some).0: u32); // scope 0 at $DIR/early_otherwise_branch.rs:5:15: 5:16 |
| 55 | + StorageLive(_9); // scope 0 at $DIR/early_otherwise_branch.rs:5:24: 5:25 |
| 56 | + _9 = (((_3.1: std::option::Option<u32>) as Some).0: u32); // scope 0 at $DIR/early_otherwise_branch.rs:5:24: 5:25 |
| 57 | + _0 = const 0_u32; // scope 1 at $DIR/early_otherwise_branch.rs:5:31: 5:32 |
| 58 | + StorageDead(_9); // scope 0 at $DIR/early_otherwise_branch.rs:5:31: 5:32 |
| 59 | + StorageDead(_8); // scope 0 at $DIR/early_otherwise_branch.rs:5:31: 5:32 |
| 60 | + goto -> bb4; // scope 0 at $DIR/early_otherwise_branch.rs:4:5: 7:6 |
73 | 61 | }
|
74 | 62 |
|
75 | 63 | bb4: {
|
76 |
| - StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch.rs:10:1: 10:2 |
77 |
| - return; // scope 0 at $DIR/early_otherwise_branch.rs:10:2: 10:2 |
| 64 | + StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch.rs:8:1: 8:2 |
| 65 | + return; // scope 0 at $DIR/early_otherwise_branch.rs:8:2: 8:2 |
78 | 66 | + }
|
79 | 67 | +
|
80 | 68 | + bb5 (cleanup): {
|
81 |
| -+ resume; // scope 0 at $DIR/early_otherwise_branch.rs:5:1: 10:2 |
| 69 | ++ resume; // scope 0 at $DIR/early_otherwise_branch.rs:3:1: 8:2 |
82 | 70 | + }
|
83 | 71 | +
|
84 | 72 | + bb6: {
|
85 |
| -+ switchInt(_7) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:7:19: 7:26 |
| 73 | ++ switchInt(_7) -> [1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/early_otherwise_branch.rs:5:19: 5:26 |
86 | 74 | }
|
87 | 75 | }
|
88 | 76 |
|
0 commit comments