rust/tests/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff

105 lines
2.9 KiB
Diff
Raw Normal View History

- // MIR for `identity` before SeparateConstSwitch
+ // MIR for `identity` after SeparateConstSwitch
fn identity(_1: Result<i32, i32>) -> Result<i32, i32> {
2023-06-06 08:47:00 -05:00
debug x => _1;
let mut _0: std::result::Result<i32, i32>;
let mut _2: i32;
let mut _3: std::ops::ControlFlow<std::result::Result<std::convert::Infallible, i32>, i32>;
let mut _4: std::result::Result<i32, i32>;
let mut _5: isize;
let _6: std::result::Result<std::convert::Infallible, i32>;
let mut _7: std::result::Result<std::convert::Infallible, i32>;
let _8: i32;
scope 1 {
2023-06-06 08:47:00 -05:00
debug residual => _6;
scope 2 {
2023-06-06 08:47:00 -05:00
scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) {
debug residual => _6;
let _13: i32;
let mut _14: i32;
scope 9 {
2023-06-06 08:47:00 -05:00
debug e => _13;
scope 10 (inlined <i32 as From<i32>>::from) {
debug t => _13;
2023-01-02 00:01:29 -06:00
}
}
}
}
}
scope 3 {
2023-06-06 08:47:00 -05:00
debug val => _8;
scope 4 {
}
}
2023-06-06 08:47:00 -05:00
scope 5 (inlined <Result<i32, i32> as Try>::branch) {
debug self => _1;
let mut _9: isize;
let _10: i32;
let _11: i32;
let mut _12: std::result::Result<std::convert::Infallible, i32>;
scope 6 {
2023-06-06 08:47:00 -05:00
debug v => _10;
}
scope 7 {
2023-06-06 08:47:00 -05:00
debug e => _11;
}
}
bb0: {
2023-06-06 08:47:00 -05:00
StorageLive(_3);
2023-10-04 12:50:03 -05:00
StorageLive(_9);
2023-06-06 08:47:00 -05:00
StorageLive(_10);
StorageLive(_11);
_9 = discriminant(_1);
switchInt(move _9) -> [0: bb7, 1: bb5, otherwise: bb6];
}
bb1: {
2023-06-06 08:47:00 -05:00
StorageDead(_11);
StorageDead(_10);
2023-10-04 12:50:03 -05:00
StorageDead(_9);
2023-06-06 08:47:00 -05:00
_5 = discriminant(_3);
switchInt(move _5) -> [0: bb2, 1: bb4, otherwise: bb3];
2023-01-25 12:34:19 -06:00
}
bb2: {
2023-06-06 08:47:00 -05:00
_8 = ((_3 as Continue).0: i32);
_0 = Result::<i32, i32>::Ok(_8);
StorageDead(_3);
return;
}
2023-01-25 12:34:19 -06:00
bb3: {
2023-06-06 08:47:00 -05:00
unreachable;
2022-07-26 08:17:02 -05:00
}
2023-01-25 12:34:19 -06:00
bb4: {
2023-06-06 08:47:00 -05:00
_6 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>);
_13 = ((_6 as Err).0: i32);
_0 = Result::<i32, i32>::Err(move _13);
StorageDead(_3);
return;
}
2023-01-25 12:34:19 -06:00
bb5: {
2023-06-06 08:47:00 -05:00
_11 = ((_1 as Err).0: i32);
StorageLive(_12);
_12 = Result::<Infallible, i32>::Err(move _11);
_3 = ControlFlow::<Result<Infallible, i32>, i32>::Break(move _12);
StorageDead(_12);
goto -> bb1;
}
2023-01-25 12:34:19 -06:00
bb6: {
2023-06-06 08:47:00 -05:00
unreachable;
}
2023-01-25 12:34:19 -06:00
bb7: {
2023-06-06 08:47:00 -05:00
_10 = ((_1 as Ok).0: i32);
_3 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(move _10);
goto -> bb1;
}
}