2023-02-26 07:42:28 -06:00
|
|
|
- // MIR for `too_complex` before JumpThreading
|
|
|
|
+ // MIR for `too_complex` after JumpThreading
|
2021-06-09 17:34:58 -05:00
|
|
|
|
|
|
|
fn too_complex(_1: Result<i32, usize>) -> Option<i32> {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug x => _1;
|
|
|
|
let mut _0: std::option::Option<i32>;
|
|
|
|
let mut _2: std::ops::ControlFlow<usize, i32>;
|
|
|
|
let mut _3: isize;
|
|
|
|
let _4: i32;
|
2024-01-06 12:34:25 -06:00
|
|
|
let _5: usize;
|
|
|
|
let mut _6: isize;
|
|
|
|
let _7: i32;
|
|
|
|
let _8: usize;
|
2021-06-09 17:34:58 -05:00
|
|
|
scope 1 {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug v => _4;
|
2021-06-09 17:34:58 -05:00
|
|
|
}
|
|
|
|
scope 2 {
|
2024-01-06 12:34:25 -06:00
|
|
|
debug r => _5;
|
2021-06-09 17:34:58 -05:00
|
|
|
}
|
|
|
|
scope 3 {
|
2024-01-06 12:34:25 -06:00
|
|
|
debug v => _7;
|
2021-06-09 17:34:58 -05:00
|
|
|
}
|
|
|
|
scope 4 {
|
2024-01-06 12:34:25 -06:00
|
|
|
debug r => _8;
|
2021-06-09 17:34:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb0: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_2);
|
|
|
|
_3 = discriminant(_1);
|
2024-02-28 08:35:41 -06:00
|
|
|
switchInt(move _3) -> [0: bb3, 1: bb2, otherwise: bb1];
|
2021-06-09 17:34:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2024-02-28 08:35:41 -06:00
|
|
|
unreachable;
|
|
|
|
}
|
|
|
|
|
|
|
|
bb2: {
|
2024-08-18 16:26:34 -05:00
|
|
|
_5 = copy ((_1 as Err).0: usize);
|
|
|
|
_2 = ControlFlow::<usize, i32>::Break(copy _5);
|
2024-02-28 08:35:41 -06:00
|
|
|
- goto -> bb4;
|
2023-02-26 07:42:28 -06:00
|
|
|
+ goto -> bb8;
|
2021-06-09 17:34:58 -05:00
|
|
|
}
|
|
|
|
|
2024-02-28 08:35:41 -06:00
|
|
|
bb3: {
|
2024-08-18 16:26:34 -05:00
|
|
|
_4 = copy ((_1 as Ok).0: i32);
|
|
|
|
_2 = ControlFlow::<usize, i32>::Continue(copy _4);
|
2024-02-28 08:35:41 -06:00
|
|
|
goto -> bb4;
|
2023-01-25 12:34:19 -06:00
|
|
|
}
|
|
|
|
|
2024-02-28 08:35:41 -06:00
|
|
|
bb4: {
|
2024-01-06 12:34:25 -06:00
|
|
|
_6 = discriminant(_2);
|
2024-02-28 08:35:41 -06:00
|
|
|
- switchInt(move _6) -> [0: bb6, 1: bb5, otherwise: bb1];
|
|
|
|
+ goto -> bb6;
|
2021-06-09 17:34:58 -05:00
|
|
|
}
|
|
|
|
|
2024-02-28 08:35:41 -06:00
|
|
|
bb5: {
|
2024-01-06 12:34:25 -06:00
|
|
|
StorageLive(_8);
|
2024-08-18 16:26:34 -05:00
|
|
|
_8 = copy ((_2 as Break).0: usize);
|
2024-01-06 12:34:25 -06:00
|
|
|
_0 = const Option::<i32>::None;
|
|
|
|
StorageDead(_8);
|
2024-02-28 08:35:41 -06:00
|
|
|
goto -> bb7;
|
2021-06-09 17:34:58 -05:00
|
|
|
}
|
|
|
|
|
2024-02-28 08:35:41 -06:00
|
|
|
bb6: {
|
2024-08-18 16:26:34 -05:00
|
|
|
_7 = copy ((_2 as Continue).0: i32);
|
|
|
|
_0 = Option::<i32>::Some(copy _7);
|
2024-02-28 08:35:41 -06:00
|
|
|
goto -> bb7;
|
2021-06-09 17:34:58 -05:00
|
|
|
}
|
|
|
|
|
2024-02-28 08:35:41 -06:00
|
|
|
bb7: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_2);
|
|
|
|
return;
|
2023-02-26 07:42:28 -06:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ bb8: {
|
|
|
|
+ _6 = discriminant(_2);
|
2024-02-28 08:35:41 -06:00
|
|
|
+ goto -> bb5;
|
2024-01-07 08:59:59 -06:00
|
|
|
}
|
2021-06-09 17:34:58 -05:00
|
|
|
}
|
|
|
|
|
2024-01-06 12:34:25 -06:00
|
|
|
ALLOC0 (size: 8, align: 4) {
|
|
|
|
00 00 00 00 __ __ __ __ │ ....░░░░
|
|
|
|
}
|
|
|
|
|