2020-08-15 22:01:38 -05:00
|
|
|
- // MIR for `foo` before MatchBranchSimplification
|
|
|
|
+ // MIR for `foo` after MatchBranchSimplification
|
|
|
|
|
|
|
|
fn foo(_1: [u8; 16]) -> Option<[u8; 4]> {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug bytes => _1;
|
|
|
|
let mut _0: std::option::Option<[u8; 4]>;
|
|
|
|
let _2: [u32; 4];
|
|
|
|
let mut _3: [u8; 16];
|
|
|
|
let mut _5: [u8; 4];
|
|
|
|
let mut _6: u32;
|
2020-08-15 22:01:38 -05:00
|
|
|
scope 1 {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug dwords => _2;
|
2020-08-15 22:01:38 -05:00
|
|
|
scope 3 {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug ip => _4;
|
|
|
|
let _4: u32;
|
2022-06-10 01:16:56 -05:00
|
|
|
scope 4 {
|
|
|
|
}
|
2020-08-15 22:01:38 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
scope 2 {
|
|
|
|
}
|
|
|
|
|
|
|
|
bb0: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_2);
|
|
|
|
StorageLive(_3);
|
|
|
|
_3 = _1;
|
|
|
|
_2 = move _3 as [u32; 4] (Transmute);
|
|
|
|
StorageDead(_3);
|
|
|
|
switchInt(_2[0 of 4]) -> [0: bb1, otherwise: bb6];
|
2020-08-15 22:01:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2023-06-06 08:47:00 -05:00
|
|
|
switchInt(_2[1 of 4]) -> [0: bb2, otherwise: bb6];
|
2020-08-15 22:01:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb2: {
|
2023-06-06 08:47:00 -05:00
|
|
|
switchInt(_2[2 of 4]) -> [0: bb4, 4294901760: bb5, otherwise: bb6];
|
2020-08-15 22:01:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb3: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_5);
|
|
|
|
StorageLive(_6);
|
|
|
|
_6 = _4;
|
|
|
|
_5 = move _6 as [u8; 4] (Transmute);
|
|
|
|
StorageDead(_6);
|
|
|
|
_0 = Option::<[u8; 4]>::Some(move _5);
|
|
|
|
StorageDead(_5);
|
|
|
|
StorageDead(_4);
|
|
|
|
goto -> bb7;
|
2020-08-15 22:01:38 -05:00
|
|
|
}
|
|
|
|
|
2023-02-24 20:32:52 -06:00
|
|
|
bb4: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_4);
|
|
|
|
_4 = _2[3 of 4];
|
|
|
|
goto -> bb3;
|
2020-08-15 22:01:38 -05:00
|
|
|
}
|
|
|
|
|
2023-02-24 20:32:52 -06:00
|
|
|
bb5: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_4);
|
|
|
|
_4 = _2[3 of 4];
|
|
|
|
goto -> bb3;
|
2020-08-15 22:01:38 -05:00
|
|
|
}
|
|
|
|
|
2023-02-24 20:32:52 -06:00
|
|
|
bb6: {
|
2023-06-06 08:47:00 -05:00
|
|
|
_0 = Option::<[u8; 4]>::None;
|
|
|
|
goto -> bb7;
|
2020-08-15 22:01:38 -05:00
|
|
|
}
|
|
|
|
|
2023-02-24 20:32:52 -06:00
|
|
|
bb7: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_2);
|
|
|
|
return;
|
2020-08-15 22:01:38 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|