rust/tests/mir-opt/issue_101973.inner.ConstProp.panic-unwind.diff

83 lines
2.5 KiB
Diff
Raw Normal View History

- // MIR for `inner` before ConstProp
+ // MIR for `inner` after ConstProp
fn inner(_1: u32) -> i64 {
2023-06-06 08:47:00 -05:00
debug fields => _1;
let mut _0: i64;
let mut _2: i32;
let mut _3: u32;
let mut _4: u32;
let mut _5: u32;
let mut _6: u32;
let mut _7: u32;
let mut _8: u32;
let mut _9: u32;
let mut _10: u32;
let mut _11: bool;
let mut _12: u32;
let mut _13: bool;
scope 1 (inlined imm8) {
debug x => _1;
let mut _14: u32;
let mut _15: u32;
scope 2 {
2023-06-06 08:47:00 -05:00
debug out => _4;
}
}
2023-06-06 08:47:00 -05:00
scope 3 (inlined core::num::<impl u32>::rotate_right) {
debug self => _4;
debug n => _6;
}
bb0: {
2023-06-06 08:47:00 -05:00
StorageLive(_2);
StorageLive(_3);
StorageLive(_4);
StorageLive(_15);
StorageLive(_14);
_14 = Shr(_1, const 0_i32);
_15 = BitAnd(move _14, const 255_u32);
StorageDead(_14);
_4 = BitOr(const 0_u32, move _15);
StorageDead(_15);
StorageLive(_6);
StorageLive(_7);
StorageLive(_8);
- _10 = const 8_i32 as u32 (IntToInt);
- _11 = Lt(move _10, const 32_u32);
2023-06-23 11:53:09 -05:00
- assert(move _11, "attempt to shift right by `{}`, which would overflow", const 8_i32) -> [success: bb1, unwind continue];
2023-06-06 08:47:00 -05:00
+ _10 = const 8_u32;
+ _11 = const true;
2023-06-23 11:53:09 -05:00
+ assert(const true, "attempt to shift right by `{}`, which would overflow", const 8_i32) -> [success: bb1, unwind continue];
}
bb1: {
2023-06-06 08:47:00 -05:00
_8 = Shr(_1, const 8_i32);
_7 = BitAnd(move _8, const 15_u32);
StorageDead(_8);
- _12 = const 1_i32 as u32 (IntToInt);
- _13 = Lt(move _12, const 32_u32);
2023-06-23 11:53:09 -05:00
- assert(move _13, "attempt to shift left by `{}`, which would overflow", const 1_i32) -> [success: bb2, unwind continue];
2023-06-06 08:47:00 -05:00
+ _12 = const 1_u32;
+ _13 = const true;
2023-06-23 11:53:09 -05:00
+ assert(const true, "attempt to shift left by `{}`, which would overflow", const 1_i32) -> [success: bb2, unwind continue];
}
bb2: {
2023-06-06 08:47:00 -05:00
_6 = Shl(move _7, const 1_i32);
StorageDead(_7);
2023-07-16 08:11:10 -05:00
_3 = rotate_right::<u32>(move _4, move _6) -> [return: bb3, unwind unreachable];
}
bb3: {
2023-06-06 08:47:00 -05:00
StorageDead(_6);
StorageDead(_4);
_2 = move _3 as i32 (IntToInt);
StorageDead(_3);
_0 = move _2 as i64 (IntToInt);
StorageDead(_2);
return;
}
}