390 lines
13 KiB
Diff
390 lines
13 KiB
Diff
|
- // MIR for `arithmetic_checked` before GVN
|
||
|
+ // MIR for `arithmetic_checked` after GVN
|
||
|
|
||
|
fn arithmetic_checked(_1: u64) -> () {
|
||
|
debug x => _1;
|
||
|
let mut _0: ();
|
||
|
let _2: ();
|
||
|
let mut _3: u64;
|
||
|
let mut _4: u64;
|
||
|
let mut _5: (u64, bool);
|
||
|
let _6: ();
|
||
|
let mut _7: u64;
|
||
|
let mut _8: u64;
|
||
|
let mut _9: (u64, bool);
|
||
|
let _10: ();
|
||
|
let mut _11: u64;
|
||
|
let mut _12: u64;
|
||
|
let mut _13: (u64, bool);
|
||
|
let _14: ();
|
||
|
let mut _15: u64;
|
||
|
let mut _16: u64;
|
||
|
let mut _17: (u64, bool);
|
||
|
let _18: ();
|
||
|
let mut _19: u64;
|
||
|
let mut _20: u64;
|
||
|
let mut _21: bool;
|
||
|
let _22: ();
|
||
|
let mut _23: u64;
|
||
|
let mut _24: u64;
|
||
|
let mut _25: bool;
|
||
|
let _26: ();
|
||
|
let mut _27: u64;
|
||
|
let mut _28: u64;
|
||
|
let mut _29: bool;
|
||
|
let _30: ();
|
||
|
let mut _31: u64;
|
||
|
let mut _32: u64;
|
||
|
let mut _33: bool;
|
||
|
let _34: ();
|
||
|
let mut _35: u64;
|
||
|
let mut _36: u64;
|
||
|
let mut _37: bool;
|
||
|
let _38: ();
|
||
|
let mut _39: u64;
|
||
|
let mut _40: u64;
|
||
|
let mut _41: bool;
|
||
|
let _42: ();
|
||
|
let mut _43: u64;
|
||
|
let mut _44: u64;
|
||
|
let mut _45: bool;
|
||
|
let _46: ();
|
||
|
let mut _47: u64;
|
||
|
let mut _48: u64;
|
||
|
let mut _49: bool;
|
||
|
let _50: ();
|
||
|
let mut _51: u64;
|
||
|
let mut _52: u64;
|
||
|
let _53: ();
|
||
|
let mut _54: u64;
|
||
|
let mut _55: u64;
|
||
|
let _56: ();
|
||
|
let mut _57: u64;
|
||
|
let mut _58: u64;
|
||
|
let _59: ();
|
||
|
let mut _60: u64;
|
||
|
let mut _61: u64;
|
||
|
let mut _62: u32;
|
||
|
let mut _63: bool;
|
||
|
let _64: ();
|
||
|
let mut _65: u64;
|
||
|
let mut _66: u64;
|
||
|
let mut _67: u32;
|
||
|
let mut _68: bool;
|
||
|
|
||
|
bb0: {
|
||
|
StorageLive(_2);
|
||
|
StorageLive(_3);
|
||
|
- StorageLive(_4);
|
||
|
- _4 = _1;
|
||
|
- _5 = CheckedAdd(_4, const 0_u64);
|
||
|
- assert(!move (_5.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, const 0_u64) -> [success: bb1, unwind unreachable];
|
||
|
+ _5 = CheckedAdd(_1, const 0_u64);
|
||
|
+ assert(!move (_5.1: bool), "attempt to compute `{} + {}`, which would overflow", _1, const 0_u64) -> [success: bb1, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb1: {
|
||
|
_3 = move (_5.0: u64);
|
||
|
- StorageDead(_4);
|
||
|
_2 = opaque::<u64>(move _3) -> [return: bb2, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb2: {
|
||
|
StorageDead(_3);
|
||
|
StorageDead(_2);
|
||
|
StorageLive(_6);
|
||
|
StorageLive(_7);
|
||
|
- StorageLive(_8);
|
||
|
- _8 = _1;
|
||
|
- _9 = CheckedSub(_8, const 0_u64);
|
||
|
- assert(!move (_9.1: bool), "attempt to compute `{} - {}`, which would overflow", move _8, const 0_u64) -> [success: bb3, unwind unreachable];
|
||
|
+ _9 = CheckedSub(_1, const 0_u64);
|
||
|
+ assert(!move (_9.1: bool), "attempt to compute `{} - {}`, which would overflow", _1, const 0_u64) -> [success: bb3, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb3: {
|
||
|
_7 = move (_9.0: u64);
|
||
|
- StorageDead(_8);
|
||
|
_6 = opaque::<u64>(move _7) -> [return: bb4, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb4: {
|
||
|
StorageDead(_7);
|
||
|
StorageDead(_6);
|
||
|
StorageLive(_10);
|
||
|
StorageLive(_11);
|
||
|
- StorageLive(_12);
|
||
|
- _12 = _1;
|
||
|
- _13 = CheckedMul(_12, const 0_u64);
|
||
|
- assert(!move (_13.1: bool), "attempt to compute `{} * {}`, which would overflow", move _12, const 0_u64) -> [success: bb5, unwind unreachable];
|
||
|
+ _13 = CheckedMul(_1, const 0_u64);
|
||
|
+ assert(!move (_13.1: bool), "attempt to compute `{} * {}`, which would overflow", _1, const 0_u64) -> [success: bb5, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb5: {
|
||
|
_11 = move (_13.0: u64);
|
||
|
- StorageDead(_12);
|
||
|
_10 = opaque::<u64>(move _11) -> [return: bb6, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb6: {
|
||
|
StorageDead(_11);
|
||
|
StorageDead(_10);
|
||
|
StorageLive(_14);
|
||
|
StorageLive(_15);
|
||
|
- StorageLive(_16);
|
||
|
- _16 = _1;
|
||
|
- _17 = CheckedMul(_16, const 1_u64);
|
||
|
- assert(!move (_17.1: bool), "attempt to compute `{} * {}`, which would overflow", move _16, const 1_u64) -> [success: bb7, unwind unreachable];
|
||
|
+ _17 = CheckedMul(_1, const 1_u64);
|
||
|
+ assert(!move (_17.1: bool), "attempt to compute `{} * {}`, which would overflow", _1, const 1_u64) -> [success: bb7, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb7: {
|
||
|
_15 = move (_17.0: u64);
|
||
|
- StorageDead(_16);
|
||
|
_14 = opaque::<u64>(move _15) -> [return: bb8, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb8: {
|
||
|
StorageDead(_15);
|
||
|
StorageDead(_14);
|
||
|
StorageLive(_18);
|
||
|
StorageLive(_19);
|
||
|
- StorageLive(_20);
|
||
|
- _20 = _1;
|
||
|
_21 = Eq(const 0_u64, const 0_u64);
|
||
|
- assert(!move _21, "attempt to divide `{}` by zero", _20) -> [success: bb9, unwind unreachable];
|
||
|
+ assert(!_21, "attempt to divide `{}` by zero", _1) -> [success: bb9, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb9: {
|
||
|
- _19 = Div(move _20, const 0_u64);
|
||
|
- StorageDead(_20);
|
||
|
+ _19 = Div(_1, const 0_u64);
|
||
|
_18 = opaque::<u64>(move _19) -> [return: bb10, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb10: {
|
||
|
StorageDead(_19);
|
||
|
StorageDead(_18);
|
||
|
StorageLive(_22);
|
||
|
StorageLive(_23);
|
||
|
- StorageLive(_24);
|
||
|
- _24 = _1;
|
||
|
_25 = Eq(const 1_u64, const 0_u64);
|
||
|
- assert(!move _25, "attempt to divide `{}` by zero", _24) -> [success: bb11, unwind unreachable];
|
||
|
+ assert(!_25, "attempt to divide `{}` by zero", _1) -> [success: bb11, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb11: {
|
||
|
- _23 = Div(move _24, const 1_u64);
|
||
|
- StorageDead(_24);
|
||
|
+ _23 = Div(_1, const 1_u64);
|
||
|
_22 = opaque::<u64>(move _23) -> [return: bb12, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb12: {
|
||
|
StorageDead(_23);
|
||
|
StorageDead(_22);
|
||
|
StorageLive(_26);
|
||
|
StorageLive(_27);
|
||
|
- StorageLive(_28);
|
||
|
- _28 = _1;
|
||
|
- _29 = Eq(_28, const 0_u64);
|
||
|
- assert(!move _29, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb13, unwind unreachable];
|
||
|
+ _29 = Eq(_1, const 0_u64);
|
||
|
+ assert(!_29, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb13, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb13: {
|
||
|
- _27 = Div(const 0_u64, move _28);
|
||
|
- StorageDead(_28);
|
||
|
+ _27 = Div(const 0_u64, _1);
|
||
|
_26 = opaque::<u64>(move _27) -> [return: bb14, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb14: {
|
||
|
StorageDead(_27);
|
||
|
StorageDead(_26);
|
||
|
StorageLive(_30);
|
||
|
StorageLive(_31);
|
||
|
- StorageLive(_32);
|
||
|
- _32 = _1;
|
||
|
- _33 = Eq(_32, const 0_u64);
|
||
|
- assert(!move _33, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb15, unwind unreachable];
|
||
|
+ assert(!_29, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb15, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb15: {
|
||
|
- _31 = Div(const 1_u64, move _32);
|
||
|
- StorageDead(_32);
|
||
|
+ _31 = Div(const 1_u64, _1);
|
||
|
_30 = opaque::<u64>(move _31) -> [return: bb16, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb16: {
|
||
|
StorageDead(_31);
|
||
|
StorageDead(_30);
|
||
|
StorageLive(_34);
|
||
|
StorageLive(_35);
|
||
|
- StorageLive(_36);
|
||
|
- _36 = _1;
|
||
|
- _37 = Eq(const 0_u64, const 0_u64);
|
||
|
- assert(!move _37, "attempt to calculate the remainder of `{}` with a divisor of zero", _36) -> [success: bb17, unwind unreachable];
|
||
|
+ assert(!_21, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb17, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb17: {
|
||
|
- _35 = Rem(move _36, const 0_u64);
|
||
|
- StorageDead(_36);
|
||
|
+ _35 = Rem(_1, const 0_u64);
|
||
|
_34 = opaque::<u64>(move _35) -> [return: bb18, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb18: {
|
||
|
StorageDead(_35);
|
||
|
StorageDead(_34);
|
||
|
StorageLive(_38);
|
||
|
StorageLive(_39);
|
||
|
- StorageLive(_40);
|
||
|
- _40 = _1;
|
||
|
- _41 = Eq(const 1_u64, const 0_u64);
|
||
|
- assert(!move _41, "attempt to calculate the remainder of `{}` with a divisor of zero", _40) -> [success: bb19, unwind unreachable];
|
||
|
+ assert(!_25, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb19, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb19: {
|
||
|
- _39 = Rem(move _40, const 1_u64);
|
||
|
- StorageDead(_40);
|
||
|
+ _39 = Rem(_1, const 1_u64);
|
||
|
_38 = opaque::<u64>(move _39) -> [return: bb20, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb20: {
|
||
|
StorageDead(_39);
|
||
|
StorageDead(_38);
|
||
|
StorageLive(_42);
|
||
|
StorageLive(_43);
|
||
|
- StorageLive(_44);
|
||
|
- _44 = _1;
|
||
|
- _45 = Eq(_44, const 0_u64);
|
||
|
- assert(!move _45, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb21, unwind unreachable];
|
||
|
+ assert(!_29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb21, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb21: {
|
||
|
- _43 = Rem(const 0_u64, move _44);
|
||
|
- StorageDead(_44);
|
||
|
+ _43 = Rem(const 0_u64, _1);
|
||
|
_42 = opaque::<u64>(move _43) -> [return: bb22, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb22: {
|
||
|
StorageDead(_43);
|
||
|
StorageDead(_42);
|
||
|
StorageLive(_46);
|
||
|
StorageLive(_47);
|
||
|
- StorageLive(_48);
|
||
|
- _48 = _1;
|
||
|
- _49 = Eq(_48, const 0_u64);
|
||
|
- assert(!move _49, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb23, unwind unreachable];
|
||
|
+ assert(!_29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb23, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb23: {
|
||
|
- _47 = Rem(const 1_u64, move _48);
|
||
|
- StorageDead(_48);
|
||
|
+ _47 = Rem(const 1_u64, _1);
|
||
|
_46 = opaque::<u64>(move _47) -> [return: bb24, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb24: {
|
||
|
StorageDead(_47);
|
||
|
StorageDead(_46);
|
||
|
StorageLive(_50);
|
||
|
StorageLive(_51);
|
||
|
- StorageLive(_52);
|
||
|
- _52 = _1;
|
||
|
- _51 = BitAnd(move _52, const 0_u64);
|
||
|
- StorageDead(_52);
|
||
|
+ _51 = BitAnd(_1, const 0_u64);
|
||
|
_50 = opaque::<u64>(move _51) -> [return: bb25, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb25: {
|
||
|
StorageDead(_51);
|
||
|
StorageDead(_50);
|
||
|
StorageLive(_53);
|
||
|
StorageLive(_54);
|
||
|
- StorageLive(_55);
|
||
|
- _55 = _1;
|
||
|
- _54 = BitOr(move _55, const 0_u64);
|
||
|
- StorageDead(_55);
|
||
|
+ _54 = BitOr(_1, const 0_u64);
|
||
|
_53 = opaque::<u64>(move _54) -> [return: bb26, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb26: {
|
||
|
StorageDead(_54);
|
||
|
StorageDead(_53);
|
||
|
StorageLive(_56);
|
||
|
StorageLive(_57);
|
||
|
- StorageLive(_58);
|
||
|
- _58 = _1;
|
||
|
- _57 = BitXor(move _58, const 0_u64);
|
||
|
- StorageDead(_58);
|
||
|
+ _57 = BitXor(_1, const 0_u64);
|
||
|
_56 = opaque::<u64>(move _57) -> [return: bb27, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb27: {
|
||
|
StorageDead(_57);
|
||
|
StorageDead(_56);
|
||
|
StorageLive(_59);
|
||
|
StorageLive(_60);
|
||
|
- StorageLive(_61);
|
||
|
- _61 = _1;
|
||
|
_62 = const 0_i32 as u32 (IntToInt);
|
||
|
- _63 = Lt(move _62, const 64_u32);
|
||
|
- assert(move _63, "attempt to shift right by `{}`, which would overflow", const 0_i32) -> [success: bb28, unwind unreachable];
|
||
|
+ _63 = Lt(_62, const 64_u32);
|
||
|
+ assert(_63, "attempt to shift right by `{}`, which would overflow", const 0_i32) -> [success: bb28, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb28: {
|
||
|
- _60 = Shr(move _61, const 0_i32);
|
||
|
- StorageDead(_61);
|
||
|
+ _60 = Shr(_1, const 0_i32);
|
||
|
_59 = opaque::<u64>(move _60) -> [return: bb29, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb29: {
|
||
|
StorageDead(_60);
|
||
|
StorageDead(_59);
|
||
|
StorageLive(_64);
|
||
|
StorageLive(_65);
|
||
|
- StorageLive(_66);
|
||
|
- _66 = _1;
|
||
|
- _67 = const 0_i32 as u32 (IntToInt);
|
||
|
- _68 = Lt(move _67, const 64_u32);
|
||
|
- assert(move _68, "attempt to shift left by `{}`, which would overflow", const 0_i32) -> [success: bb30, unwind unreachable];
|
||
|
+ assert(_63, "attempt to shift left by `{}`, which would overflow", const 0_i32) -> [success: bb30, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb30: {
|
||
|
- _65 = Shl(move _66, const 0_i32);
|
||
|
- StorageDead(_66);
|
||
|
+ _65 = Shl(_1, const 0_i32);
|
||
|
_64 = opaque::<u64>(move _65) -> [return: bb31, unwind unreachable];
|
||
|
}
|
||
|
|
||
|
bb31: {
|
||
|
StorageDead(_65);
|
||
|
StorageDead(_64);
|
||
|
_0 = const ();
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
|