rust/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_smaller.Inline.panic-abort.diff
2023-06-15 15:19:11 -04:00

136 lines
4.2 KiB
Diff

- // MIR for `unchecked_shr_signed_smaller` before Inline
+ // MIR for `unchecked_shr_signed_smaller` after Inline
fn unchecked_shr_signed_smaller(_1: i16, _2: u32) -> i16 {
debug a => _1;
debug b => _2;
let mut _0: i16;
let mut _3: i16;
let mut _4: u32;
+ scope 1 (inlined core::num::<impl i16>::unchecked_shr) {
+ debug self => _3;
+ debug rhs => _4;
+ let mut _5: i16;
+ scope 2 {
+ scope 3 (inlined core::num::<impl i16>::unchecked_shr::conv) {
+ debug x => _4;
+ let mut _6: std::option::Option<i16>;
+ let mut _7: std::result::Result<i16, std::num::TryFromIntError>;
+ scope 4 {
+ scope 5 (inlined <u32 as TryInto<i16>>::try_into) {
+ debug self => _4;
+ scope 6 (inlined convert::num::<impl TryFrom<u32> for i16>::try_from) {
+ debug u => _4;
+ let mut _8: bool;
+ let mut _9: u32;
+ let mut _10: i16;
+ }
+ }
+ scope 7 (inlined Result::<i16, TryFromIntError>::ok) {
+ debug self => _7;
+ let mut _11: isize;
+ let _12: i16;
+ scope 8 {
+ debug x => _12;
+ }
+ }
+ scope 9 (inlined #[track_caller] Option::<i16>::unwrap_unchecked) {
+ debug self => _6;
+ let mut _13: &std::option::Option<i16>;
+ let mut _14: isize;
+ scope 10 {
+ debug val => _5;
+ }
+ scope 11 {
+ scope 13 (inlined unreachable_unchecked) {
+ scope 14 {
+ scope 15 (inlined unreachable_unchecked::runtime) {
+ }
+ }
+ }
+ }
+ scope 12 (inlined Option::<i16>::is_some) {
+ debug self => _13;
+ }
+ }
+ }
+ }
+ }
+ }
bb0: {
StorageLive(_3);
_3 = _1;
StorageLive(_4);
_4 = _2;
- _0 = core::num::<impl i16>::unchecked_shr(move _3, move _4) -> [return: bb1, unwind unreachable];
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+ StorageLive(_9);
+ _9 = const 32767_u32;
+ _8 = Gt(_4, move _9);
+ StorageDead(_9);
+ switchInt(move _8) -> [0: bb3, otherwise: bb2];
}
bb1: {
+ StorageDead(_5);
StorageDead(_4);
StorageDead(_3);
return;
+ }
+
+ bb2: {
+ _7 = Result::<i16, TryFromIntError>::Err(const TryFromIntError(()));
+ goto -> bb4;
+ }
+
+ bb3: {
+ StorageLive(_10);
+ _10 = _4 as i16 (IntToInt);
+ _7 = Result::<i16, TryFromIntError>::Ok(move _10);
+ StorageDead(_10);
+ goto -> bb4;
+ }
+
+ bb4: {
+ StorageDead(_8);
+ StorageLive(_12);
+ _11 = discriminant(_7);
+ switchInt(move _11) -> [0: bb7, 1: bb5, otherwise: bb6];
+ }
+
+ bb5: {
+ _6 = Option::<i16>::None;
+ goto -> bb8;
+ }
+
+ bb6: {
+ unreachable;
+ }
+
+ bb7: {
+ _12 = move ((_7 as Ok).0: i16);
+ _6 = Option::<i16>::Some(move _12);
+ goto -> bb8;
+ }
+
+ bb8: {
+ StorageDead(_12);
+ StorageDead(_7);
+ StorageLive(_13);
+ _14 = discriminant(_6);
+ switchInt(move _14) -> [1: bb9, otherwise: bb6];
+ }
+
+ bb9: {
+ _5 = move ((_6 as Some).0: i16);
+ StorageDead(_13);
+ StorageDead(_6);
+ _0 = unchecked_shr::<i16>(_3, move _5) -> [return: bb1, unwind unreachable];
}
}