rust/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_bigger.PreCodegen.after.panic-unwind.mir
Scott McMurray 3ec4eeddef [libs] Simplify unchecked_{shl,shr}
There's no need for the `const_eval_select` dance here.  And while I originally wrote the `.try_into().unwrap_unchecked()` implementation here, it's kinda a mess in MIR -- this new one is substantially simpler, as shown by the old one being above the inlining threshold but the new one being below it.
2023-06-16 16:03:19 -07:00

26 lines
575 B
Rust

// MIR for `unchecked_shl_unsigned_bigger` after PreCodegen
fn unchecked_shl_unsigned_bigger(_1: u64, _2: u32) -> u64 {
debug a => _1;
debug b => _2;
let mut _0: u64;
scope 1 (inlined core::num::<impl u64>::unchecked_shl) {
debug self => _1;
debug rhs => _2;
let mut _3: u64;
scope 2 {
}
}
bb0: {
StorageLive(_3);
_3 = _2 as u64 (IntToInt);
_0 = unchecked_shl::<u64>(_1, move _3) -> [return: bb1, unwind unreachable];
}
bb1: {
StorageDead(_3);
return;
}
}