diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2023-09-16 17:13:30 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2023-10-25 06:46:45 +0000 |
| commit | d28405972ff8e83ac5e1be53c72eb44a43f983a8 (patch) | |
| tree | d306eb5872b366b4227c2814a6547f93bb7753c0 | |
| parent | 2e4e2a8f288f642cafcc41fff211955ceddc453d (diff) | |
| download | rust-d28405972ff8e83ac5e1be53c72eb44a43f983a8.tar.gz rust-d28405972ff8e83ac5e1be53c72eb44a43f983a8.zip | |
Do not remove unused definitions inside GVN.
28 files changed, 1348 insertions, 1126 deletions
diff --git a/compiler/rustc_mir_transform/src/gvn.rs b/compiler/rustc_mir_transform/src/gvn.rs index eece7c3e834..e7f36e5881a 100644 --- a/compiler/rustc_mir_transform/src/gvn.rs +++ b/compiler/rustc_mir_transform/src/gvn.rs @@ -118,16 +118,11 @@ fn propagate_ssa<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { let data = &mut body.basic_blocks.as_mut_preserves_cfg()[bb]; state.visit_basic_block_data(bb, data); } - let any_replacement = state.any_replacement; // For each local that is reused (`y` above), we remove its storage statements do avoid any // difficulty. Those locals are SSA, so should be easy to optimize by LLVM without storage // statements. StorageRemover { tcx, reused_locals: state.reused_locals }.visit_body_preserves_cfg(body); - - if any_replacement { - crate::simplify::remove_unused_definitions(body); - } } newtype_index! { @@ -190,7 +185,6 @@ struct VnState<'body, 'tcx> { ssa: &'body SsaLocals, dominators: &'body Dominators<BasicBlock>, reused_locals: BitSet<Local>, - any_replacement: bool, } impl<'body, 'tcx> VnState<'body, 'tcx> { @@ -212,7 +206,6 @@ impl<'body, 'tcx> VnState<'body, 'tcx> { ssa, dominators, reused_locals: BitSet::new_empty(local_decls.len()), - any_replacement: false, } } @@ -324,14 +317,12 @@ impl<'body, 'tcx> VnState<'body, 'tcx> { { *place = local.into(); self.reused_locals.insert(local); - self.any_replacement = true; } else if place_ref.local != place.local || place_ref.projection.len() < place.projection.len() { // By the invariant on `place_ref`. *place = place_ref.project_deeper(&[], self.tcx); self.reused_locals.insert(place_ref.local); - self.any_replacement = true; } Some(value) @@ -349,7 +340,6 @@ impl<'body, 'tcx> VnState<'body, 'tcx> { let value = self.simplify_place_value(place, location)?; if let Some(const_) = self.try_as_constant(value) { *operand = Operand::Constant(Box::new(const_)); - self.any_replacement = true; } Some(value) } @@ -502,13 +492,11 @@ impl<'tcx> MutVisitor<'tcx> for VnState<'_, 'tcx> { { if let Some(const_) = self.try_as_constant(value) { *rvalue = Rvalue::Use(Operand::Constant(Box::new(const_))); - self.any_replacement = true; } else if let Some(local) = self.try_as_local(value, location) && *rvalue != Rvalue::Use(Operand::Move(local.into())) { *rvalue = Rvalue::Use(Operand::Copy(local.into())); self.reused_locals.insert(local); - self.any_replacement = true; } } } diff --git a/compiler/rustc_mir_transform/src/lib.rs b/compiler/rustc_mir_transform/src/lib.rs index 9aaa54110bd..4ec91a55f1d 100644 --- a/compiler/rustc_mir_transform/src/lib.rs +++ b/compiler/rustc_mir_transform/src/lib.rs @@ -570,6 +570,7 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { &separate_const_switch::SeparateConstSwitch, &const_prop::ConstProp, &gvn::GVN, + &simplify::SimplifyLocals::AfterGVN, &dataflow_const_prop::DataflowConstProp, &const_debuginfo::ConstDebugInfo, &o1(simplify_branches::SimplifyConstCondition::AfterConstProp), diff --git a/compiler/rustc_mir_transform/src/simplify.rs b/compiler/rustc_mir_transform/src/simplify.rs index 88c89e106fd..0a1c011147a 100644 --- a/compiler/rustc_mir_transform/src/simplify.rs +++ b/compiler/rustc_mir_transform/src/simplify.rs @@ -366,6 +366,7 @@ pub fn remove_dead_blocks(body: &mut Body<'_>) { pub enum SimplifyLocals { BeforeConstProp, + AfterGVN, Final, } @@ -373,6 +374,7 @@ impl<'tcx> MirPass<'tcx> for SimplifyLocals { fn name(&self) -> &'static str { match &self { SimplifyLocals::BeforeConstProp => "SimplifyLocals-before-const-prop", + SimplifyLocals::AfterGVN => "SimplifyLocals-after-value-numbering", SimplifyLocals::Final => "SimplifyLocals-final", } } diff --git a/tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff b/tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff index 313e5dddbbb..f5d822520a7 100644 --- a/tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff +++ b/tests/mir-opt/const_debuginfo.main.ConstDebugInfo.diff @@ -4,12 +4,6 @@ fn main() -> () { let mut _0: (); let _1: u8; - let mut _5: u8; - let mut _6: u8; - let mut _7: u8; - let mut _8: u8; - let mut _12: u32; - let mut _13: u32; scope 1 { - debug x => _1; + debug x => const 1_u8; @@ -25,34 +19,34 @@ scope 4 { - debug sum => _4; + debug sum => const 6_u8; - let _9: &str; + let _5: &str; scope 5 { -- debug s => _9; +- debug s => _5; + debug s => const "hello, world!"; - let _14: bool; - let _15: bool; - let _16: u32; + let _8: bool; + let _9: bool; + let _10: u32; scope 6 { -- debug ((f: (bool, bool, u32)).0: bool) => _14; -- debug ((f: (bool, bool, u32)).1: bool) => _15; -- debug ((f: (bool, bool, u32)).2: u32) => _16; +- debug ((f: (bool, bool, u32)).0: bool) => _8; +- debug ((f: (bool, bool, u32)).1: bool) => _9; +- debug ((f: (bool, bool, u32)).2: u32) => _10; + debug ((f: (bool, bool, u32)).0: bool) => const true; + debug ((f: (bool, bool, u32)).1: bool) => const false; + debug ((f: (bool, bool, u32)).2: u32) => const 123_u32; - let _10: std::option::Option<u16>; + let _6: std::option::Option<u16>; scope 7 { -- debug o => _10; +- debug o => _6; + debug o => const Option::<u16>::Some(99_u16); - let _17: u32; - let _18: u32; + let _11: u32; + let _12: u32; scope 8 { -- debug ((p: Point).0: u32) => _17; -- debug ((p: Point).1: u32) => _18; +- debug ((p: Point).0: u32) => _11; +- debug ((p: Point).1: u32) => _12; + debug ((p: Point).0: u32) => const 32_u32; + debug ((p: Point).1: u32) => const 32_u32; - let _11: u32; + let _7: u32; scope 9 { -- debug a => _11; +- debug a => _7; + debug a => const 64_u32; } } @@ -69,30 +63,27 @@ _2 = const 2_u8; _3 = const 3_u8; StorageLive(_4); - StorageLive(_5); - _5 = const 3_u8; _4 = const 6_u8; - StorageDead(_5); + StorageLive(_5); + _5 = const "hello, world!"; + StorageLive(_8); StorageLive(_9); - _9 = const "hello, world!"; - StorageLive(_14); - StorageLive(_15); - StorageLive(_16); - _14 = const true; - _15 = const false; - _16 = const 123_u32; StorageLive(_10); - _10 = const Option::<u16>::Some(99_u16); - _17 = const 32_u32; - _18 = const 32_u32; - StorageLive(_11); - _11 = const 64_u32; - StorageDead(_11); - StorageDead(_10); - StorageDead(_14); - StorageDead(_15); - StorageDead(_16); + _8 = const true; + _9 = const false; + _10 = const 123_u32; + StorageLive(_6); + _6 = const Option::<u16>::Some(99_u16); + _11 = const 32_u32; + _12 = const 32_u32; + StorageLive(_7); + _7 = const 64_u32; + StorageDead(_7); + StorageDead(_6); + StorageDead(_8); StorageDead(_9); + StorageDead(_10); + StorageDead(_5); StorageDead(_4); return; } diff --git a/tests/mir-opt/gvn.arithmetic.GVN.panic-abort.diff b/tests/mir-opt/gvn.arithmetic.GVN.panic-abort.diff index 3f5173c189e..17ba0d3cef2 100644 --- a/tests/mir-opt/gvn.arithmetic.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.arithmetic.GVN.panic-abort.diff @@ -67,11 +67,11 @@ bb0: { StorageLive(_2); StorageLive(_3); -- StorageLive(_4); -- _4 = _1; + StorageLive(_4); + _4 = _1; - _3 = Add(move _4, const 0_u64); -- StorageDead(_4); + _3 = Add(_1, const 0_u64); + StorageDead(_4); _2 = opaque::<u64>(move _3) -> [return: bb1, unwind unreachable]; } @@ -80,11 +80,11 @@ StorageDead(_2); StorageLive(_5); StorageLive(_6); -- StorageLive(_7); -- _7 = _1; + StorageLive(_7); + _7 = _1; - _6 = Sub(move _7, const 0_u64); -- StorageDead(_7); + _6 = Sub(_1, const 0_u64); + StorageDead(_7); _5 = opaque::<u64>(move _6) -> [return: bb2, unwind unreachable]; } @@ -93,11 +93,11 @@ StorageDead(_5); StorageLive(_8); StorageLive(_9); -- StorageLive(_10); -- _10 = _1; + StorageLive(_10); + _10 = _1; - _9 = Mul(move _10, const 0_u64); -- StorageDead(_10); + _9 = Mul(_1, const 0_u64); + StorageDead(_10); _8 = opaque::<u64>(move _9) -> [return: bb3, unwind unreachable]; } @@ -106,11 +106,11 @@ StorageDead(_8); StorageLive(_11); StorageLive(_12); -- StorageLive(_13); -- _13 = _1; + StorageLive(_13); + _13 = _1; - _12 = Mul(move _13, const 1_u64); -- StorageDead(_13); + _12 = Mul(_1, const 1_u64); + StorageDead(_13); _11 = opaque::<u64>(move _12) -> [return: bb4, unwind unreachable]; } @@ -119,8 +119,8 @@ StorageDead(_11); StorageLive(_14); StorageLive(_15); -- StorageLive(_16); -- _16 = _1; + StorageLive(_16); + _16 = _1; _17 = Eq(const 0_u64, const 0_u64); - assert(!move _17, "attempt to divide `{}` by zero", _16) -> [success: bb5, unwind unreachable]; + assert(!_17, "attempt to divide `{}` by zero", _1) -> [success: bb5, unwind unreachable]; @@ -128,8 +128,8 @@ bb5: { - _15 = Div(move _16, const 0_u64); -- StorageDead(_16); + _15 = Div(_1, const 0_u64); + StorageDead(_16); _14 = opaque::<u64>(move _15) -> [return: bb6, unwind unreachable]; } @@ -138,8 +138,8 @@ StorageDead(_14); StorageLive(_18); StorageLive(_19); -- StorageLive(_20); -- _20 = _1; + StorageLive(_20); + _20 = _1; _21 = Eq(const 1_u64, const 0_u64); - assert(!move _21, "attempt to divide `{}` by zero", _20) -> [success: bb7, unwind unreachable]; + assert(!_21, "attempt to divide `{}` by zero", _1) -> [success: bb7, unwind unreachable]; @@ -147,8 +147,8 @@ bb7: { - _19 = Div(move _20, const 1_u64); -- StorageDead(_20); + _19 = Div(_1, const 1_u64); + StorageDead(_20); _18 = opaque::<u64>(move _19) -> [return: bb8, unwind unreachable]; } @@ -157,8 +157,8 @@ StorageDead(_18); StorageLive(_22); StorageLive(_23); -- StorageLive(_24); -- _24 = _1; + StorageLive(_24); + _24 = _1; - _25 = Eq(_24, const 0_u64); - assert(!move _25, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb9, unwind unreachable]; + _25 = Eq(_1, const 0_u64); @@ -167,8 +167,8 @@ bb9: { - _23 = Div(const 0_u64, move _24); -- StorageDead(_24); + _23 = Div(const 0_u64, _1); + StorageDead(_24); _22 = opaque::<u64>(move _23) -> [return: bb10, unwind unreachable]; } @@ -177,17 +177,18 @@ StorageDead(_22); StorageLive(_26); StorageLive(_27); -- StorageLive(_28); -- _28 = _1; + StorageLive(_28); + _28 = _1; - _29 = Eq(_28, const 0_u64); - assert(!move _29, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb11, unwind unreachable]; ++ _29 = _25; + assert(!_25, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb11, unwind unreachable]; } bb11: { - _27 = Div(const 1_u64, move _28); -- StorageDead(_28); + _27 = Div(const 1_u64, _1); + StorageDead(_28); _26 = opaque::<u64>(move _27) -> [return: bb12, unwind unreachable]; } @@ -196,17 +197,18 @@ StorageDead(_26); StorageLive(_30); StorageLive(_31); -- StorageLive(_32); -- _32 = _1; + StorageLive(_32); + _32 = _1; - _33 = Eq(const 0_u64, const 0_u64); - assert(!move _33, "attempt to calculate the remainder of `{}` with a divisor of zero", _32) -> [success: bb13, unwind unreachable]; ++ _33 = _17; + assert(!_17, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb13, unwind unreachable]; } bb13: { - _31 = Rem(move _32, const 0_u64); -- StorageDead(_32); + _31 = Rem(_1, const 0_u64); + StorageDead(_32); _30 = opaque::<u64>(move _31) -> [return: bb14, unwind unreachable]; } @@ -215,17 +217,18 @@ StorageDead(_30); StorageLive(_34); StorageLive(_35); -- StorageLive(_36); -- _36 = _1; + StorageLive(_36); + _36 = _1; - _37 = Eq(const 1_u64, const 0_u64); - assert(!move _37, "attempt to calculate the remainder of `{}` with a divisor of zero", _36) -> [success: bb15, unwind unreachable]; ++ _37 = _21; + assert(!_21, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb15, unwind unreachable]; } bb15: { - _35 = Rem(move _36, const 1_u64); -- StorageDead(_36); + _35 = Rem(_1, const 1_u64); + StorageDead(_36); _34 = opaque::<u64>(move _35) -> [return: bb16, unwind unreachable]; } @@ -234,17 +237,18 @@ StorageDead(_34); StorageLive(_38); StorageLive(_39); -- StorageLive(_40); -- _40 = _1; + StorageLive(_40); + _40 = _1; - _41 = Eq(_40, const 0_u64); - assert(!move _41, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb17, unwind unreachable]; ++ _41 = _25; + assert(!_25, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb17, unwind unreachable]; } bb17: { - _39 = Rem(const 0_u64, move _40); -- StorageDead(_40); + _39 = Rem(const 0_u64, _1); + StorageDead(_40); _38 = opaque::<u64>(move _39) -> [return: bb18, unwind unreachable]; } @@ -253,17 +257,18 @@ StorageDead(_38); StorageLive(_42); StorageLive(_43); -- StorageLive(_44); -- _44 = _1; + 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 1_u64) -> [success: bb19, unwind unreachable]; ++ _45 = _25; + assert(!_25, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb19, unwind unreachable]; } bb19: { - _43 = Rem(const 1_u64, move _44); -- StorageDead(_44); + _43 = Rem(const 1_u64, _1); + StorageDead(_44); _42 = opaque::<u64>(move _43) -> [return: bb20, unwind unreachable]; } @@ -272,11 +277,11 @@ StorageDead(_42); StorageLive(_46); StorageLive(_47); -- StorageLive(_48); -- _48 = _1; + StorageLive(_48); + _48 = _1; - _47 = BitAnd(move _48, const 0_u64); -- StorageDead(_48); + _47 = BitAnd(_1, const 0_u64); + StorageDead(_48); _46 = opaque::<u64>(move _47) -> [return: bb21, unwind unreachable]; } @@ -285,11 +290,11 @@ StorageDead(_46); StorageLive(_49); StorageLive(_50); -- StorageLive(_51); -- _51 = _1; + StorageLive(_51); + _51 = _1; - _50 = BitOr(move _51, const 0_u64); -- StorageDead(_51); + _50 = BitOr(_1, const 0_u64); + StorageDead(_51); _49 = opaque::<u64>(move _50) -> [return: bb22, unwind unreachable]; } @@ -298,11 +303,11 @@ StorageDead(_49); StorageLive(_52); StorageLive(_53); -- StorageLive(_54); -- _54 = _1; + StorageLive(_54); + _54 = _1; - _53 = BitXor(move _54, const 0_u64); -- StorageDead(_54); + _53 = BitXor(_1, const 0_u64); + StorageDead(_54); _52 = opaque::<u64>(move _53) -> [return: bb23, unwind unreachable]; } @@ -311,11 +316,11 @@ StorageDead(_52); StorageLive(_55); StorageLive(_56); -- StorageLive(_57); -- _57 = _1; + StorageLive(_57); + _57 = _1; - _56 = Shr(move _57, const 0_i32); -- StorageDead(_57); + _56 = Shr(_1, const 0_i32); + StorageDead(_57); _55 = opaque::<u64>(move _56) -> [return: bb24, unwind unreachable]; } @@ -324,11 +329,11 @@ StorageDead(_55); StorageLive(_58); StorageLive(_59); -- StorageLive(_60); -- _60 = _1; + StorageLive(_60); + _60 = _1; - _59 = Shl(move _60, const 0_i32); -- StorageDead(_60); + _59 = Shl(_1, const 0_i32); + StorageDead(_60); _58 = opaque::<u64>(move _59) -> [return: bb25, unwind unreachable]; } diff --git a/tests/mir-opt/gvn.arithmetic.GVN.panic-unwind.diff b/tests/mir-opt/gvn.arithmetic.GVN.panic-unwind.diff index 38da21d91d4..f14fd409bea 100644 --- a/tests/mir-opt/gvn.arithmetic.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.arithmetic.GVN.panic-unwind.diff @@ -67,11 +67,11 @@ bb0: { StorageLive(_2); StorageLive(_3); -- StorageLive(_4); -- _4 = _1; + StorageLive(_4); + _4 = _1; - _3 = Add(move _4, const 0_u64); -- StorageDead(_4); + _3 = Add(_1, const 0_u64); + StorageDead(_4); _2 = opaque::<u64>(move _3) -> [return: bb1, unwind continue]; } @@ -80,11 +80,11 @@ StorageDead(_2); StorageLive(_5); StorageLive(_6); -- StorageLive(_7); -- _7 = _1; + StorageLive(_7); + _7 = _1; - _6 = Sub(move _7, const 0_u64); -- StorageDead(_7); + _6 = Sub(_1, const 0_u64); + StorageDead(_7); _5 = opaque::<u64>(move _6) -> [return: bb2, unwind continue]; } @@ -93,11 +93,11 @@ StorageDead(_5); StorageLive(_8); StorageLive(_9); -- StorageLive(_10); -- _10 = _1; + StorageLive(_10); + _10 = _1; - _9 = Mul(move _10, const 0_u64); -- StorageDead(_10); + _9 = Mul(_1, const 0_u64); + StorageDead(_10); _8 = opaque::<u64>(move _9) -> [return: bb3, unwind continue]; } @@ -106,11 +106,11 @@ StorageDead(_8); StorageLive(_11); StorageLive(_12); -- StorageLive(_13); -- _13 = _1; + StorageLive(_13); + _13 = _1; - _12 = Mul(move _13, const 1_u64); -- StorageDead(_13); + _12 = Mul(_1, const 1_u64); + StorageDead(_13); _11 = opaque::<u64>(move _12) -> [return: bb4, unwind continue]; } @@ -119,8 +119,8 @@ StorageDead(_11); StorageLive(_14); StorageLive(_15); -- StorageLive(_16); -- _16 = _1; + StorageLive(_16); + _16 = _1; _17 = Eq(const 0_u64, const 0_u64); - assert(!move _17, "attempt to divide `{}` by zero", _16) -> [success: bb5, unwind continue]; + assert(!_17, "attempt to divide `{}` by zero", _1) -> [success: bb5, unwind continue]; @@ -128,8 +128,8 @@ bb5: { - _15 = Div(move _16, const 0_u64); -- StorageDead(_16); + _15 = Div(_1, const 0_u64); + StorageDead(_16); _14 = opaque::<u64>(move _15) -> [return: bb6, unwind continue]; } @@ -138,8 +138,8 @@ StorageDead(_14); StorageLive(_18); StorageLive(_19); -- StorageLive(_20); -- _20 = _1; + StorageLive(_20); + _20 = _1; _21 = Eq(const 1_u64, const 0_u64); - assert(!move _21, "attempt to divide `{}` by zero", _20) -> [success: bb7, unwind continue]; + assert(!_21, "attempt to divide `{}` by zero", _1) -> [success: bb7, unwind continue]; @@ -147,8 +147,8 @@ bb7: { - _19 = Div(move _20, const 1_u64); -- StorageDead(_20); + _19 = Div(_1, const 1_u64); + StorageDead(_20); _18 = opaque::<u64>(move _19) -> [return: bb8, unwind continue]; } @@ -157,8 +157,8 @@ StorageDead(_18); StorageLive(_22); StorageLive(_23); -- StorageLive(_24); -- _24 = _1; + StorageLive(_24); + _24 = _1; - _25 = Eq(_24, const 0_u64); - assert(!move _25, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb9, unwind continue]; + _25 = Eq(_1, const 0_u64); @@ -167,8 +167,8 @@ bb9: { - _23 = Div(const 0_u64, move _24); -- StorageDead(_24); + _23 = Div(const 0_u64, _1); + StorageDead(_24); _22 = opaque::<u64>(move _23) -> [return: bb10, unwind continue]; } @@ -177,17 +177,18 @@ StorageDead(_22); StorageLive(_26); StorageLive(_27); -- StorageLive(_28); -- _28 = _1; + StorageLive(_28); + _28 = _1; - _29 = Eq(_28, const 0_u64); - assert(!move _29, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb11, unwind continue]; ++ _29 = _25; + assert(!_25, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb11, unwind continue]; } bb11: { - _27 = Div(const 1_u64, move _28); -- StorageDead(_28); + _27 = Div(const 1_u64, _1); + StorageDead(_28); _26 = opaque::<u64>(move _27) -> [return: bb12, unwind continue]; } @@ -196,17 +197,18 @@ StorageDead(_26); StorageLive(_30); StorageLive(_31); -- StorageLive(_32); -- _32 = _1; + StorageLive(_32); + _32 = _1; - _33 = Eq(const 0_u64, const 0_u64); - assert(!move _33, "attempt to calculate the remainder of `{}` with a divisor of zero", _32) -> [success: bb13, unwind continue]; ++ _33 = _17; + assert(!_17, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb13, unwind continue]; } bb13: { - _31 = Rem(move _32, const 0_u64); -- StorageDead(_32); + _31 = Rem(_1, const 0_u64); + StorageDead(_32); _30 = opaque::<u64>(move _31) -> [return: bb14, unwind continue]; } @@ -215,17 +217,18 @@ StorageDead(_30); StorageLive(_34); StorageLive(_35); -- StorageLive(_36); -- _36 = _1; + StorageLive(_36); + _36 = _1; - _37 = Eq(const 1_u64, const 0_u64); - assert(!move _37, "attempt to calculate the remainder of `{}` with a divisor of zero", _36) -> [success: bb15, unwind continue]; ++ _37 = _21; + assert(!_21, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb15, unwind continue]; } bb15: { - _35 = Rem(move _36, const 1_u64); -- StorageDead(_36); + _35 = Rem(_1, const 1_u64); + StorageDead(_36); _34 = opaque::<u64>(move _35) -> [return: bb16, unwind continue]; } @@ -234,17 +237,18 @@ StorageDead(_34); StorageLive(_38); StorageLive(_39); -- StorageLive(_40); -- _40 = _1; + StorageLive(_40); + _40 = _1; - _41 = Eq(_40, const 0_u64); - assert(!move _41, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb17, unwind continue]; ++ _41 = _25; + assert(!_25, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb17, unwind continue]; } bb17: { - _39 = Rem(const 0_u64, move _40); -- StorageDead(_40); + _39 = Rem(const 0_u64, _1); + StorageDead(_40); _38 = opaque::<u64>(move _39) -> [return: bb18, unwind continue]; } @@ -253,17 +257,18 @@ StorageDead(_38); StorageLive(_42); StorageLive(_43); -- StorageLive(_44); -- _44 = _1; + 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 1_u64) -> [success: bb19, unwind continue]; ++ _45 = _25; + assert(!_25, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb19, unwind continue]; } bb19: { - _43 = Rem(const 1_u64, move _44); -- StorageDead(_44); + _43 = Rem(const 1_u64, _1); + StorageDead(_44); _42 = opaque::<u64>(move _43) -> [return: bb20, unwind continue]; } @@ -272,11 +277,11 @@ StorageDead(_42); StorageLive(_46); StorageLive(_47); -- StorageLive(_48); -- _48 = _1; + StorageLive(_48); + _48 = _1; - _47 = BitAnd(move _48, const 0_u64); -- StorageDead(_48); + _47 = BitAnd(_1, const 0_u64); + StorageDead(_48); _46 = opaque::<u64>(move _47) -> [return: bb21, unwind continue]; } @@ -285,11 +290,11 @@ StorageDead(_46); StorageLive(_49); StorageLive(_50); -- StorageLive(_51); -- _51 = _1; + StorageLive(_51); + _51 = _1; - _50 = BitOr(move _51, const 0_u64); -- StorageDead(_51); + _50 = BitOr(_1, const 0_u64); + StorageDead(_51); _49 = opaque::<u64>(move _50) -> [return: bb22, unwind continue]; } @@ -298,11 +303,11 @@ StorageDead(_49); StorageLive(_52); StorageLive(_53); -- StorageLive(_54); -- _54 = _1; + StorageLive(_54); + _54 = _1; - _53 = BitXor(move _54, const 0_u64); -- StorageDead(_54); + _53 = BitXor(_1, const 0_u64); + StorageDead(_54); _52 = opaque::<u64>(move _53) -> [return: bb23, unwind continue]; } @@ -311,11 +316,11 @@ StorageDead(_52); StorageLive(_55); StorageLive(_56); -- StorageLive(_57); -- _57 = _1; + StorageLive(_57); + _57 = _1; - _56 = Shr(move _57, const 0_i32); -- StorageDead(_57); + _56 = Shr(_1, const 0_i32); + StorageDead(_57); _55 = opaque::<u64>(move _56) -> [return: bb24, unwind continue]; } @@ -324,11 +329,11 @@ StorageDead(_55); StorageLive(_58); StorageLive(_59); -- StorageLive(_60); -- _60 = _1; + StorageLive(_60); + _60 = _1; - _59 = Shl(move _60, const 0_i32); -- StorageDead(_60); + _59 = Shl(_1, const 0_i32); + StorageDead(_60); _58 = opaque::<u64>(move _59) -> [return: bb25, unwind continue]; } diff --git a/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-abort.diff b/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-abort.diff index 0c342799e07..e586e4ac889 100644 --- a/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-abort.diff @@ -75,8 +75,8 @@ bb0: { StorageLive(_2); StorageLive(_3); -- StorageLive(_4); -- _4 = _1; + 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); @@ -85,7 +85,7 @@ bb1: { _3 = move (_5.0: u64); -- StorageDead(_4); + StorageDead(_4); _2 = opaque::<u64>(move _3) -> [return: bb2, unwind unreachable]; } @@ -94,8 +94,8 @@ StorageDead(_2); StorageLive(_6); StorageLive(_7); -- StorageLive(_8); -- _8 = _1; + 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); @@ -104,7 +104,7 @@ bb3: { _7 = move (_9.0: u64); -- StorageDead(_8); + StorageDead(_8); _6 = opaque::<u64>(move _7) -> [return: bb4, unwind unreachable]; } @@ -113,8 +113,8 @@ StorageDead(_6); StorageLive(_10); StorageLive(_11); -- StorageLive(_12); -- _12 = _1; + 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); @@ -123,7 +123,7 @@ bb5: { _11 = move (_13.0: u64); -- StorageDead(_12); + StorageDead(_12); _10 = opaque::<u64>(move _11) -> [return: bb6, unwind unreachable]; } @@ -132,8 +132,8 @@ StorageDead(_10); StorageLive(_14); StorageLive(_15); -- StorageLive(_16); -- _16 = _1; + 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); @@ -142,7 +142,7 @@ bb7: { _15 = move (_17.0: u64); -- StorageDead(_16); + StorageDead(_16); _14 = opaque::<u64>(move _15) -> [return: bb8, unwind unreachable]; } @@ -151,8 +151,8 @@ StorageDead(_14); StorageLive(_18); StorageLive(_19); -- StorageLive(_20); -- _20 = _1; + 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]; @@ -160,8 +160,8 @@ bb9: { - _19 = Div(move _20, const 0_u64); -- StorageDead(_20); + _19 = Div(_1, const 0_u64); + StorageDead(_20); _18 = opaque::<u64>(move _19) -> [return: bb10, unwind unreachable]; } @@ -170,8 +170,8 @@ StorageDead(_18); StorageLive(_22); StorageLive(_23); -- StorageLive(_24); -- _24 = _1; + 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]; @@ -179,8 +179,8 @@ bb11: { - _23 = Div(move _24, const 1_u64); -- StorageDead(_24); + _23 = Div(_1, const 1_u64); + StorageDead(_24); _22 = opaque::<u64>(move _23) -> [return: bb12, unwind unreachable]; } @@ -189,8 +189,8 @@ StorageDead(_22); StorageLive(_26); StorageLive(_27); -- StorageLive(_28); -- _28 = _1; + 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); @@ -199,8 +199,8 @@ bb13: { - _27 = Div(const 0_u64, move _28); -- StorageDead(_28); + _27 = Div(const 0_u64, _1); + StorageDead(_28); _26 = opaque::<u64>(move _27) -> [return: bb14, unwind unreachable]; } @@ -209,17 +209,18 @@ StorageDead(_26); StorageLive(_30); StorageLive(_31); -- StorageLive(_32); -- _32 = _1; + 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]; ++ _33 = _29; + 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); + StorageDead(_32); _30 = opaque::<u64>(move _31) -> [return: bb16, unwind unreachable]; } @@ -228,17 +229,18 @@ StorageDead(_30); StorageLive(_34); StorageLive(_35); -- StorageLive(_36); -- _36 = _1; + 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]; ++ _37 = _21; + 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); + StorageDead(_36); _34 = opaque::<u64>(move _35) -> [return: bb18, unwind unreachable]; } @@ -247,17 +249,18 @@ StorageDead(_34); StorageLive(_38); StorageLive(_39); -- StorageLive(_40); -- _40 = _1; + 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]; ++ _41 = _25; + 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); + StorageDead(_40); _38 = opaque::<u64>(move _39) -> [return: bb20, unwind unreachable]; } @@ -266,17 +269,18 @@ StorageDead(_38); StorageLive(_42); StorageLive(_43); -- StorageLive(_44); -- _44 = _1; + 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]; ++ _45 = _29; + 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); + StorageDead(_44); _42 = opaque::<u64>(move _43) -> [return: bb22, unwind unreachable]; } @@ -285,17 +289,18 @@ StorageDead(_42); StorageLive(_46); StorageLive(_47); -- StorageLive(_48); -- _48 = _1; + 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]; ++ _49 = _29; + 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); + StorageDead(_48); _46 = opaque::<u64>(move _47) -> [return: bb24, unwind unreachable]; } @@ -304,11 +309,11 @@ StorageDead(_46); StorageLive(_50); StorageLive(_51); -- StorageLive(_52); -- _52 = _1; + StorageLive(_52); + _52 = _1; - _51 = BitAnd(move _52, const 0_u64); -- StorageDead(_52); + _51 = BitAnd(_1, const 0_u64); + StorageDead(_52); _50 = opaque::<u64>(move _51) -> [return: bb25, unwind unreachable]; } @@ -317,11 +322,11 @@ StorageDead(_50); StorageLive(_53); StorageLive(_54); -- StorageLive(_55); -- _55 = _1; + StorageLive(_55); + _55 = _1; - _54 = BitOr(move _55, const 0_u64); -- StorageDead(_55); + _54 = BitOr(_1, const 0_u64); + StorageDead(_55); _53 = opaque::<u64>(move _54) -> [return: bb26, unwind unreachable]; } @@ -330,11 +335,11 @@ StorageDead(_53); StorageLive(_56); StorageLive(_57); -- StorageLive(_58); -- _58 = _1; + StorageLive(_58); + _58 = _1; - _57 = BitXor(move _58, const 0_u64); -- StorageDead(_58); + _57 = BitXor(_1, const 0_u64); + StorageDead(_58); _56 = opaque::<u64>(move _57) -> [return: bb27, unwind unreachable]; } @@ -343,8 +348,8 @@ StorageDead(_56); StorageLive(_59); StorageLive(_60); -- StorageLive(_61); -- _61 = _1; + 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]; @@ -354,8 +359,8 @@ bb28: { - _60 = Shr(move _61, const 0_i32); -- StorageDead(_61); + _60 = Shr(_1, const 0_i32); + StorageDead(_61); _59 = opaque::<u64>(move _60) -> [return: bb29, unwind unreachable]; } @@ -364,18 +369,20 @@ StorageDead(_59); StorageLive(_64); StorageLive(_65); -- StorageLive(_66); -- _66 = _1; + 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]; ++ _67 = _62; ++ _68 = _63; + 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); + StorageDead(_66); _64 = opaque::<u64>(move _65) -> [return: bb31, unwind unreachable]; } diff --git a/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-unwind.diff b/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-unwind.diff index 7813c29b962..f58a9116b8f 100644 --- a/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-unwind.diff @@ -75,8 +75,8 @@ bb0: { StorageLive(_2); StorageLive(_3); -- StorageLive(_4); -- _4 = _1; + 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 continue]; + _5 = CheckedAdd(_1, const 0_u64); @@ -85,7 +85,7 @@ bb1: { _3 = move (_5.0: u64); -- StorageDead(_4); + StorageDead(_4); _2 = opaque::<u64>(move _3) -> [return: bb2, unwind continue]; } @@ -94,8 +94,8 @@ StorageDead(_2); StorageLive(_6); StorageLive(_7); -- StorageLive(_8); -- _8 = _1; + 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 continue]; + _9 = CheckedSub(_1, const 0_u64); @@ -104,7 +104,7 @@ bb3: { _7 = move (_9.0: u64); -- StorageDead(_8); + StorageDead(_8); _6 = opaque::<u64>(move _7) -> [return: bb4, unwind continue]; } @@ -113,8 +113,8 @@ StorageDead(_6); StorageLive(_10); StorageLive(_11); -- StorageLive(_12); -- _12 = _1; + 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 continue]; + _13 = CheckedMul(_1, const 0_u64); @@ -123,7 +123,7 @@ bb5: { _11 = move (_13.0: u64); -- StorageDead(_12); + StorageDead(_12); _10 = opaque::<u64>(move _11) -> [return: bb6, unwind continue]; } @@ -132,8 +132,8 @@ StorageDead(_10); StorageLive(_14); StorageLive(_15); -- StorageLive(_16); -- _16 = _1; + 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 continue]; + _17 = CheckedMul(_1, const 1_u64); @@ -142,7 +142,7 @@ bb7: { _15 = move (_17.0: u64); -- StorageDead(_16); + StorageDead(_16); _14 = opaque::<u64>(move _15) -> [return: bb8, unwind continue]; } @@ -151,8 +151,8 @@ StorageDead(_14); StorageLive(_18); StorageLive(_19); -- StorageLive(_20); -- _20 = _1; + StorageLive(_20); + _20 = _1; _21 = Eq(const 0_u64, const 0_u64); - assert(!move _21, "attempt to divide `{}` by zero", _20) -> [success: bb9, unwind continue]; + assert(!_21, "attempt to divide `{}` by zero", _1) -> [success: bb9, unwind continue]; @@ -160,8 +160,8 @@ bb9: { - _19 = Div(move _20, const 0_u64); -- StorageDead(_20); + _19 = Div(_1, const 0_u64); + StorageDead(_20); _18 = opaque::<u64>(move _19) -> [return: bb10, unwind continue]; } @@ -170,8 +170,8 @@ StorageDead(_18); StorageLive(_22); StorageLive(_23); -- StorageLive(_24); -- _24 = _1; + StorageLive(_24); + _24 = _1; _25 = Eq(const 1_u64, const 0_u64); - assert(!move _25, "attempt to divide `{}` by zero", _24) -> [success: bb11, unwind continue]; + assert(!_25, "attempt to divide `{}` by zero", _1) -> [success: bb11, unwind continue]; @@ -179,8 +179,8 @@ bb11: { - _23 = Div(move _24, const 1_u64); -- StorageDead(_24); + _23 = Div(_1, const 1_u64); + StorageDead(_24); _22 = opaque::<u64>(move _23) -> [return: bb12, unwind continue]; } @@ -189,8 +189,8 @@ StorageDead(_22); StorageLive(_26); StorageLive(_27); -- StorageLive(_28); -- _28 = _1; + StorageLive(_28); + _28 = _1; - _29 = Eq(_28, const 0_u64); - assert(!move _29, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb13, unwind continue]; + _29 = Eq(_1, const 0_u64); @@ -199,8 +199,8 @@ bb13: { - _27 = Div(const 0_u64, move _28); -- StorageDead(_28); + _27 = Div(const 0_u64, _1); + StorageDead(_28); _26 = opaque::<u64>(move _27) -> [return: bb14, unwind continue]; } @@ -209,17 +209,18 @@ StorageDead(_26); StorageLive(_30); StorageLive(_31); -- StorageLive(_32); -- _32 = _1; + StorageLive(_32); + _32 = _1; - _33 = Eq(_32, const 0_u64); - assert(!move _33, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb15, unwind continue]; ++ _33 = _29; + assert(!_29, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb15, unwind continue]; } bb15: { - _31 = Div(const 1_u64, move _32); -- StorageDead(_32); + _31 = Div(const 1_u64, _1); + StorageDead(_32); _30 = opaque::<u64>(move _31) -> [return: bb16, unwind continue]; } @@ -228,17 +229,18 @@ StorageDead(_30); StorageLive(_34); StorageLive(_35); -- StorageLive(_36); -- _36 = _1; + 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 continue]; ++ _37 = _21; + assert(!_21, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb17, unwind continue]; } bb17: { - _35 = Rem(move _36, const 0_u64); -- StorageDead(_36); + _35 = Rem(_1, const 0_u64); + StorageDead(_36); _34 = opaque::<u64>(move _35) -> [return: bb18, unwind continue]; } @@ -247,17 +249,18 @@ StorageDead(_34); StorageLive(_38); StorageLive(_39); -- StorageLive(_40); -- _40 = _1; + 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 continue]; ++ _41 = _25; + assert(!_25, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb19, unwind continue]; } bb19: { - _39 = Rem(move _40, const 1_u64); -- StorageDead(_40); + _39 = Rem(_1, const 1_u64); + StorageDead(_40); _38 = opaque::<u64>(move _39) -> [return: bb20, unwind continue]; } @@ -266,17 +269,18 @@ StorageDead(_38); StorageLive(_42); StorageLive(_43); -- StorageLive(_44); -- _44 = _1; + 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 continue]; ++ _45 = _29; + assert(!_29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb21, unwind continue]; } bb21: { - _43 = Rem(const 0_u64, move _44); -- StorageDead(_44); + _43 = Rem(const 0_u64, _1); + StorageDead(_44); _42 = opaque::<u64>(move _43) -> [return: bb22, unwind continue]; } @@ -285,17 +289,18 @@ StorageDead(_42); StorageLive(_46); StorageLive(_47); -- StorageLive(_48); -- _48 = _1; + 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 continue]; ++ _49 = _29; + assert(!_29, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb23, unwind continue]; } bb23: { - _47 = Rem(const 1_u64, move _48); -- StorageDead(_48); + _47 = Rem(const 1_u64, _1); + StorageDead(_48); _46 = opaque::<u64>(move _47) -> [return: bb24, unwind continue]; } @@ -304,11 +309,11 @@ StorageDead(_46); StorageLive(_50); StorageLive(_51); -- StorageLive(_52); -- _52 = _1; + StorageLive(_52); + _52 = _1; - _51 = BitAnd(move _52, const 0_u64); -- StorageDead(_52); + _51 = BitAnd(_1, const 0_u64); + StorageDead(_52); _50 = opaque::<u64>(move _51) -> [return: bb25, unwind continue]; } @@ -317,11 +322,11 @@ StorageDead(_50); StorageLive(_53); StorageLive(_54); -- StorageLive(_55); -- _55 = _1; + StorageLive(_55); + _55 = _1; - _54 = BitOr(move _55, const 0_u64); -- StorageDead(_55); + _54 = BitOr(_1, const 0_u64); + StorageDead(_55); _53 = opaque::<u64>(move _54) -> [return: bb26, unwind continue]; } @@ -330,11 +335,11 @@ StorageDead(_53); StorageLive(_56); StorageLive(_57); -- StorageLive(_58); -- _58 = _1; + StorageLive(_58); + _58 = _1; - _57 = BitXor(move _58, const 0_u64); -- StorageDead(_58); + _57 = BitXor(_1, const 0_u64); + StorageDead(_58); _56 = opaque::<u64>(move _57) -> [return: bb27, unwind continue]; } @@ -343,8 +348,8 @@ StorageDead(_56); StorageLive(_59); StorageLive(_60); -- StorageLive(_61); -- _61 = _1; + 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 continue]; @@ -354,8 +359,8 @@ bb28: { - _60 = Shr(move _61, const 0_i32); -- StorageDead(_61); + _60 = Shr(_1, const 0_i32); + StorageDead(_61); _59 = opaque::<u64>(move _60) -> [return: bb29, unwind continue]; } @@ -364,18 +369,20 @@ StorageDead(_59); StorageLive(_64); StorageLive(_65); -- StorageLive(_66); -- _66 = _1; + 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 continue]; ++ _67 = _62; ++ _68 = _63; + assert(_63, "attempt to shift left by `{}`, which would overflow", const 0_i32) -> [success: bb30, unwind continue]; } bb30: { - _65 = Shl(move _66, const 0_i32); -- StorageDead(_66); + _65 = Shl(_1, const 0_i32); + StorageDead(_66); _64 = opaque::<u64>(move _65) -> [return: bb31, unwind continue]; } diff --git a/tests/mir-opt/gvn.arithmetic_float.GVN.panic-abort.diff b/tests/mir-opt/gvn.arithmetic_float.GVN.panic-abort.diff index 7d5ac8353fe..b332100eaf0 100644 --- a/tests/mir-opt/gvn.arithmetic_float.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.arithmetic_float.GVN.panic-abort.diff @@ -37,11 +37,11 @@ bb0: { StorageLive(_2); StorageLive(_3); -- StorageLive(_4); -- _4 = _1; + StorageLive(_4); + _4 = _1; - _3 = Add(move _4, const 0f64); -- StorageDead(_4); + _3 = Add(_1, const 0f64); + StorageDead(_4); _2 = opaque::<f64>(move _3) -> [return: bb1, unwind unreachable]; } @@ -50,11 +50,11 @@ StorageDead(_2); StorageLive(_5); StorageLive(_6); -- StorageLive(_7); -- _7 = _1; + StorageLive(_7); + _7 = _1; - _6 = Sub(move _7, const 0f64); -- StorageDead(_7); + _6 = Sub(_1, const 0f64); + StorageDead(_7); _5 = opaque::<f64>(move _6) -> [return: bb2, unwind unreachable]; } @@ -63,11 +63,11 @@ StorageDead(_5); StorageLive(_8); StorageLive(_9); -- StorageLive(_10); -- _10 = _1; + StorageLive(_10); + _10 = _1; - _9 = Mul(move _10, const 0f64); -- StorageDead(_10); + _9 = Mul(_1, const 0f64); + StorageDead(_10); _8 = opaque::<f64>(move _9) -> [return: bb3, unwind unreachable]; } @@ -76,11 +76,11 @@ StorageDead(_8); StorageLive(_11); StorageLive(_12); -- StorageLive(_13); -- _13 = _1; + StorageLive(_13); + _13 = _1; - _12 = Div(move _13, const 0f64); -- StorageDead(_13); + _12 = Div(_1, const 0f64); + StorageDead(_13); _11 = opaque::<f64>(move _12) -> [return: bb4, unwind unreachable]; } @@ -89,11 +89,11 @@ StorageDead(_11); StorageLive(_14); StorageLive(_15); -- StorageLive(_16); -- _16 = _1; + StorageLive(_16); + _16 = _1; - _15 = Div(const 0f64, move _16); -- StorageDead(_16); + _15 = Div(const 0f64, _1); + StorageDead(_16); _14 = opaque::<f64>(move _15) -> [return: bb5, unwind unreachable]; } @@ -102,11 +102,11 @@ StorageDead(_14); StorageLive(_17); StorageLive(_18); -- StorageLive(_19); -- _19 = _1; + StorageLive(_19); + _19 = _1; - _18 = Rem(move _19, const 0f64); -- StorageDead(_19); + _18 = Rem(_1, const 0f64); + StorageDead(_19); _17 = opaque::<f64>(move _18) -> [return: bb6, unwind unreachable]; } @@ -115,11 +115,11 @@ StorageDead(_17); StorageLive(_20); StorageLive(_21); -- StorageLive(_22); -- _22 = _1; + StorageLive(_22); + _22 = _1; - _21 = Rem(const 0f64, move _22); -- StorageDead(_22); + _21 = Rem(const 0f64, _1); + StorageDead(_22); _20 = opaque::<f64>(move _21) -> [return: bb7, unwind unreachable]; } @@ -128,14 +128,14 @@ StorageDead(_20); StorageLive(_23); StorageLive(_24); -- StorageLive(_25); -- _25 = _1; -- StorageLive(_26); -- _26 = _1; + StorageLive(_25); + _25 = _1; + StorageLive(_26); + _26 = _1; - _24 = Eq(move _25, move _26); -- StorageDead(_26); -- StorageDead(_25); + _24 = Eq(_1, _1); + StorageDead(_26); + StorageDead(_25); _23 = opaque::<bool>(move _24) -> [return: bb8, unwind unreachable]; } @@ -144,14 +144,14 @@ StorageDead(_23); StorageLive(_27); StorageLive(_28); -- StorageLive(_29); -- _29 = _1; -- StorageLive(_30); -- _30 = _1; + StorageLive(_29); + _29 = _1; + StorageLive(_30); + _30 = _1; - _28 = Ne(move _29, move _30); -- StorageDead(_30); -- StorageDead(_29); + _28 = Ne(_1, _1); + StorageDead(_30); + StorageDead(_29); _27 = opaque::<bool>(move _28) -> [return: bb9, unwind unreachable]; } diff --git a/tests/mir-opt/gvn.arithmetic_float.GVN.panic-unwind.diff b/tests/mir-opt/gvn.arithmetic_float.GVN.panic-unwind.diff index 36c26dc6605..28664cb0ac8 100644 --- a/tests/mir-opt/gvn.arithmetic_float.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.arithmetic_float.GVN.panic-unwind.diff @@ -37,11 +37,11 @@ bb0: { StorageLive(_2); StorageLive(_3); -- StorageLive(_4); -- _4 = _1; + StorageLive(_4); + _4 = _1; - _3 = Add(move _4, const 0f64); -- StorageDead(_4); + _3 = Add(_1, const 0f64); + StorageDead(_4); _2 = opaque::<f64>(move _3) -> [return: bb1, unwind continue]; } @@ -50,11 +50,11 @@ StorageDead(_2); StorageLive(_5); StorageLive(_6); -- StorageLive(_7); -- _7 = _1; + StorageLive(_7); + _7 = _1; - _6 = Sub(move _7, const 0f64); -- StorageDead(_7); + _6 = Sub(_1, const 0f64); + StorageDead(_7); _5 = opaque::<f64>(move _6) -> [return: bb2, unwind continue]; } @@ -63,11 +63,11 @@ StorageDead(_5); StorageLive(_8); StorageLive(_9); -- StorageLive(_10); -- _10 = _1; + StorageLive(_10); + _10 = _1; - _9 = Mul(move _10, const 0f64); -- StorageDead(_10); + _9 = Mul(_1, const 0f64); + StorageDead(_10); _8 = opaque::<f64>(move _9) -> [return: bb3, unwind continue]; } @@ -76,11 +76,11 @@ StorageDead(_8); StorageLive(_11); StorageLive(_12); -- StorageLive(_13); -- _13 = _1; + StorageLive(_13); + _13 = _1; - _12 = Div(move _13, const 0f64); -- StorageDead(_13); + _12 = Div(_1, const 0f64); + StorageDead(_13); _11 = opaque::<f64>(move _12) -> [return: bb4, unwind continue]; } @@ -89,11 +89,11 @@ StorageDead(_11); StorageLive(_14); StorageLive(_15); -- StorageLive(_16); -- _16 = _1; + StorageLive(_16); + _16 = _1; - _15 = Div(const 0f64, move _16); -- StorageDead(_16); + _15 = Div(const 0f64, _1); + StorageDead(_16); _14 = opaque::<f64>(move _15) -> [return: bb5, unwind continue]; } @@ -102,11 +102,11 @@ StorageDead(_14); StorageLive(_17); StorageLive(_18); -- StorageLive(_19); -- _19 = _1; + StorageLive(_19); + _19 = _1; - _18 = Rem(move _19, const 0f64); -- StorageDead(_19); + _18 = Rem(_1, const 0f64); + StorageDead(_19); _17 = opaque::<f64>(move _18) -> [return: bb6, unwind continue]; } @@ -115,11 +115,11 @@ StorageDead(_17); StorageLive(_20); StorageLive(_21); -- StorageLive(_22); -- _22 = _1; + StorageLive(_22); + _22 = _1; - _21 = Rem(const 0f64, move _22); -- StorageDead(_22); + _21 = Rem(const 0f64, _1); + StorageDead(_22); _20 = opaque::<f64>(move _21) -> [return: bb7, unwind continue]; } @@ -128,14 +128,14 @@ StorageDead(_20); StorageLive(_23); StorageLive(_24); -- StorageLive(_25); -- _25 = _1; -- StorageLive(_26); -- _26 = _1; + StorageLive(_25); + _25 = _1; + StorageLive(_26); + _26 = _1; - _24 = Eq(move _25, move _26); -- StorageDead(_26); -- StorageDead(_25); + _24 = Eq(_1, _1); + StorageDead(_26); + StorageDead(_25); _23 = opaque::<bool>(move _24) -> [return: bb8, unwind continue]; } @@ -144,14 +144,14 @@ StorageDead(_23); StorageLive(_27); StorageLive(_28); -- StorageLive(_29); -- _29 = _1; -- StorageLive(_30); -- _30 = _1; + StorageLive(_29); + _29 = _1; + StorageLive(_30); + _30 = _1; - _28 = Ne(move _29, move _30); -- StorageDead(_30); -- StorageDead(_29); + _28 = Ne(_1, _1); + StorageDead(_30); + StorageDead(_29); _27 = opaque::<bool>(move _28) -> [return: bb9, unwind continue]; } diff --git a/tests/mir-opt/gvn.cast.GVN.panic-abort.diff b/tests/mir-opt/gvn.cast.GVN.panic-abort.diff index 513fe60b65d..37b0d92931f 100644 --- a/tests/mir-opt/gvn.cast.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.cast.GVN.panic-abort.diff @@ -105,18 +105,22 @@ bb0: { - StorageLive(_1); ++ nop; _1 = const 1_i64; - StorageLive(_2); ++ nop; _2 = const 1_u64; - StorageLive(_3); ++ nop; _3 = const 1f64; StorageLive(_4); StorageLive(_5); -- StorageLive(_6); + StorageLive(_6); - _6 = _1; - _5 = move _6 as u8 (IntToInt); -- StorageDead(_6); ++ _6 = const 1_i64; + _5 = const 1_i64 as u8 (IntToInt); + StorageDead(_6); _4 = opaque::<u8>(move _5) -> [return: bb1, unwind unreachable]; } @@ -125,11 +129,12 @@ StorageDead(_4); StorageLive(_7); StorageLive(_8); -- StorageLive(_9); + StorageLive(_9); - _9 = _1; - _8 = move _9 as u16 (IntToInt); -- StorageDead(_9); ++ _9 = const 1_i64; + _8 = const 1_i64 as u16 (IntToInt); + StorageDead(_9); _7 = opaque::<u16>(move _8) -> [return: bb2, unwind unreachable]; } @@ -138,11 +143,12 @@ StorageDead(_7); StorageLive(_10); StorageLive(_11); -- StorageLive(_12); + StorageLive(_12); - _12 = _1; - _11 = move _12 as u32 (IntToInt); -- StorageDead(_12); ++ _12 = const 1_i64; + _11 = const 1_i64 as u32 (IntToInt); + StorageDead(_12); _10 = opaque::<u32>(move _11) -> [return: bb3, unwind unreachable]; } @@ -151,11 +157,12 @@ StorageDead(_10); StorageLive(_13); StorageLive(_14); -- StorageLive(_15); + StorageLive(_15); - _15 = _1; - _14 = move _15 as u64 (IntToInt); -- StorageDead(_15); ++ _15 = const 1_i64; + _14 = const 1_i64 as u64 (IntToInt); + StorageDead(_15); _13 = opaque::<u64>(move _14) -> [return: bb4, unwind unreachable]; } @@ -164,11 +171,12 @@ StorageDead(_13); StorageLive(_16); StorageLive(_17); -- StorageLive(_18); + StorageLive(_18); - _18 = _1; - _17 = move _18 as i8 (IntToInt); -- StorageDead(_18); ++ _18 = const 1_i64; + _17 = const 1_i64 as i8 (IntToInt); + StorageDead(_18); _16 = opaque::<i8>(move _17) -> [return: bb5, unwind unreachable]; } @@ -177,11 +185,12 @@ StorageDead(_16); StorageLive(_19); StorageLive(_20); -- StorageLive(_21); + StorageLive(_21); - _21 = _1; - _20 = move _21 as i16 (IntToInt); -- StorageDead(_21); ++ _21 = const 1_i64; + _20 = const 1_i64 as i16 (IntToInt); + StorageDead(_21); _19 = opaque::<i16>(move _20) -> [return: bb6, unwind unreachable]; } @@ -190,11 +199,12 @@ StorageDead(_19); StorageLive(_22); StorageLive(_23); -- StorageLive(_24); + StorageLive(_24); - _24 = _1; - _23 = move _24 as i32 (IntToInt); -- StorageDead(_24); ++ _24 = const 1_i64; + _23 = const 1_i64 as i32 (IntToInt); + StorageDead(_24); _22 = opaque::<i32>(move _23) -> [return: bb7, unwind unreachable]; } @@ -202,22 +212,24 @@ StorageDead(_23); StorageDead(_22); StorageLive(_25); -- StorageLive(_26); + StorageLive(_26); - _26 = _1; - _25 = opaque::<i64>(move _26) -> [return: bb8, unwind unreachable]; ++ _26 = const 1_i64; + _25 = opaque::<i64>(const 1_i64) -> [return: bb8, unwind unreachable]; } bb8: { -- StorageDead(_26); + StorageDead(_26); StorageDead(_25); StorageLive(_27); StorageLive(_28); -- StorageLive(_29); + StorageLive(_29); - _29 = _1; - _28 = move _29 as f32 (IntToFloat); -- StorageDead(_29); ++ _29 = const 1_i64; + _28 = const 1_i64 as f32 (IntToFloat); + StorageDead(_29); _27 = opaque::<f32>(move _28) -> [return: bb9, unwind unreachable]; } @@ -226,11 +238,12 @@ StorageDead(_27); StorageLive(_30); StorageLive(_31); -- StorageLive(_32); + StorageLive(_32); - _32 = _1; - _31 = move _32 as f64 (IntToFloat); -- StorageDead(_32); ++ _32 = const 1_i64; + _31 = const 1_i64 as f64 (IntToFloat); + StorageDead(_32); _30 = opaque::<f64>(move _31) -> [return: bb10, unwind unreachable]; } @@ -239,11 +252,12 @@ StorageDead(_30); StorageLive(_33); StorageLive(_34); -- StorageLive(_35); + StorageLive(_35); - _35 = _2; - _34 = move _35 as u8 (IntToInt); -- StorageDead(_35); ++ _35 = const 1_u64; + _34 = const 1_u64 as u8 (IntToInt); + StorageDead(_35); _33 = opaque::<u8>(move _34) -> [return: bb11, unwind unreachable]; } @@ -252,11 +266,12 @@ StorageDead(_33); StorageLive(_36); StorageLive(_37); -- StorageLive(_38); + StorageLive(_38); - _38 = _2; - _37 = move _38 as u16 (IntToInt); -- StorageDead(_38); ++ _38 = const 1_u64; + _37 = const 1_u64 as u16 (IntToInt); + StorageDead(_38); _36 = opaque::<u16>(move _37) -> [return: bb12, unwind unreachable]; } @@ -265,11 +280,12 @@ StorageDead(_36); StorageLive(_39); StorageLive(_40); -- StorageLive(_41); + StorageLive(_41); - _41 = _2; - _40 = move _41 as u32 (IntToInt); -- StorageDead(_41); ++ _41 = const 1_u64; + _40 = const 1_u64 as u32 (IntToInt); + StorageDead(_41); _39 = opaque::<u32>(move _40) -> [return: bb13, unwind unreachable]; } @@ -277,22 +293,24 @@ StorageDead(_40); StorageDead(_39); StorageLive(_42); -- StorageLive(_43); + StorageLive(_43); - _43 = _2; - _42 = opaque::<u64>(move _43) -> [return: bb14, unwind unreachable]; ++ _43 = const 1_u64; + _42 = opaque::<u64>(const 1_u64) -> [return: bb14, unwind unreachable]; } bb14: { -- StorageDead(_43); + StorageDead(_43); StorageDead(_42); StorageLive(_44); StorageLive(_45); -- StorageLive(_46); + StorageLive(_46); - _46 = _2; - _45 = move _46 as i8 (IntToInt); -- StorageDead(_46); ++ _46 = const 1_u64; + _45 = const 1_u64 as i8 (IntToInt); + StorageDead(_46); _44 = opaque::<i8>(move _45) -> [return: bb15, unwind unreachable]; } @@ -301,11 +319,12 @@ StorageDead(_44); StorageLive(_47); StorageLive(_48); -- StorageLive(_49); + StorageLive(_49); - _49 = _2; - _48 = move _49 as i16 (IntToInt); -- StorageDead(_49); ++ _49 = const 1_u64; + _48 = const 1_u64 as i16 (IntToInt); + StorageDead(_49); _47 = opaque::<i16>(move _48) -> [return: bb16, unwind unreachable]; } @@ -314,11 +333,12 @@ StorageDead(_47); StorageLive(_50); StorageLive(_51); -- StorageLive(_52); + StorageLive(_52); - _52 = _2; - _51 = move _52 as i32 (IntToInt); -- StorageDead(_52); ++ _52 = const 1_u64; + _51 = const 1_u64 as i32 (IntToInt); + StorageDead(_52); _50 = opaque::<i32>(move _51) -> [return: bb17, unwind unreachable]; } @@ -327,11 +347,12 @@ StorageDead(_50); StorageLive(_53); StorageLive(_54); -- StorageLive(_55); + StorageLive(_55); - _55 = _2; - _54 = move _55 as i64 (IntToInt); -- StorageDead(_55); ++ _55 = const 1_u64; + _54 = const 1_u64 as i64 (IntToInt); + StorageDead(_55); _53 = opaque::<i64>(move _54) -> [return: bb18, unwind unreachable]; } @@ -340,11 +361,12 @@ StorageDead(_53); StorageLive(_56); StorageLive(_57); -- StorageLive(_58); + StorageLive(_58); - _58 = _2; - _57 = move _58 as f32 (IntToFloat); -- StorageDead(_58); ++ _58 = const 1_u64; + _57 = const 1_u64 as f32 (IntToFloat); + StorageDead(_58); _56 = opaque::<f32>(move _57) -> [return: bb19, unwind unreachable]; } @@ -353,11 +375,12 @@ StorageDead(_56); StorageLive(_59); StorageLive(_60); -- StorageLive(_61); + StorageLive(_61); - _61 = _2; - _60 = move _61 as f64 (IntToFloat); -- StorageDead(_61); ++ _61 = const 1_u64; + _60 = const 1_u64 as f64 (IntToFloat); + StorageDead(_61); _59 = opaque::<f64>(move _60) -> [return: bb20, unwind unreachable]; } @@ -366,11 +389,12 @@ StorageDead(_59); StorageLive(_62); StorageLive(_63); -- StorageLive(_64); + StorageLive(_64); - _64 = _3; - _63 = move _64 as u8 (FloatToInt); -- StorageDead(_64); ++ _64 = const 1f64; + _63 = const 1f64 as u8 (FloatToInt); + StorageDead(_64); _62 = opaque::<u8>(move _63) -> [return: bb21, unwind unreachable]; } @@ -379,11 +403,12 @@ StorageDead(_62); StorageLive(_65); StorageLive(_66); -- StorageLive(_67); + StorageLive(_67); - _67 = _3; - _66 = move _67 as u16 (FloatToInt); -- StorageDead(_67); ++ _67 = const 1f64; + _66 = const 1f64 as u16 (FloatToInt); + StorageDead(_67); _65 = opaque::<u16>(move _66) -> [return: bb22, unwind unreachable]; } @@ -392,11 +417,12 @@ StorageDead(_65); StorageLive(_68); StorageLive(_69); -- StorageLive(_70); + StorageLive(_70); - _70 = _3; - _69 = move _70 as u32 (FloatToInt); -- StorageDead(_70); ++ _70 = const 1f64; + _69 = const 1f64 as u32 (FloatToInt); + StorageDead(_70); _68 = opaque::<u32>(move _69) -> [return: bb23, unwind unreachable]; } @@ -405,11 +431,12 @@ StorageDead(_68); StorageLive(_71); StorageLive(_72); -- StorageLive(_73); + StorageLive(_73); - _73 = _3; - _72 = move _73 as u64 (FloatToInt); -- StorageDead(_73); ++ _73 = const 1f64; + _72 = const 1f64 as u64 (FloatToInt); + StorageDead(_73); _71 = opaque::<u64>(move _72) -> [return: bb24, unwind unreachable]; } @@ -418,11 +445,12 @@ StorageDead(_71); StorageLive(_74); StorageLive(_75); -- StorageLive(_76); + StorageLive(_76); - _76 = _3; - _75 = move _76 as i8 (FloatToInt); -- StorageDead(_76); ++ _76 = const 1f64; + _75 = const 1f64 as i8 (FloatToInt); + StorageDead(_76); _74 = opaque::<i8>(move _75) -> [return: bb25, unwind unreachable]; } @@ -431,11 +459,12 @@ StorageDead(_74); StorageLive(_77); StorageLive(_78); -- StorageLive(_79); + StorageLive(_79); - _79 = _3; - _78 = move _79 as i16 (FloatToInt); -- StorageDead(_79); ++ _79 = const 1f64; + _78 = const 1f64 as i16 (FloatToInt); + StorageDead(_79); _77 = opaque::<i16>(move _78) -> [return: bb26, unwind unreachable]; } @@ -444,11 +473,12 @@ StorageDead(_77); StorageLive(_80); StorageLive(_81); -- StorageLive(_82); + StorageLive(_82); - _82 = _3; - _81 = move _82 as i32 (FloatToInt); -- StorageDead(_82); ++ _82 = const 1f64; + _81 = const 1f64 as i32 (FloatToInt); + StorageDead(_82); _80 = opaque::<i32>(move _81) -> [return: bb27, unwind unreachable]; } @@ -457,11 +487,12 @@ StorageDead(_80); StorageLive(_83); StorageLive(_84); -- StorageLive(_85); + StorageLive(_85); - _85 = _3; - _84 = move _85 as i64 (FloatToInt); -- StorageDead(_85); ++ _85 = const 1f64; + _84 = const 1f64 as i64 (FloatToInt); + StorageDead(_85); _83 = opaque::<i64>(move _84) -> [return: bb28, unwind unreachable]; } @@ -470,11 +501,12 @@ StorageDead(_83); StorageLive(_86); StorageLive(_87); -- StorageLive(_88); + StorageLive(_88); - _88 = _3; - _87 = move _88 as f32 (FloatToFloat); -- StorageDead(_88); ++ _88 = const 1f64; + _87 = const 1f64 as f32 (FloatToFloat); + StorageDead(_88); _86 = opaque::<f32>(move _87) -> [return: bb29, unwind unreachable]; } @@ -482,19 +514,23 @@ StorageDead(_87); StorageDead(_86); StorageLive(_89); -- StorageLive(_90); + StorageLive(_90); - _90 = _3; - _89 = opaque::<f64>(move _90) -> [return: bb30, unwind unreachable]; ++ _90 = const 1f64; + _89 = opaque::<f64>(const 1f64) -> [return: bb30, unwind unreachable]; } bb30: { -- StorageDead(_90); + StorageDead(_90); StorageDead(_89); _0 = const (); - StorageDead(_3); - StorageDead(_2); - StorageDead(_1); ++ nop; ++ nop; ++ nop; return; } } diff --git a/tests/mir-opt/gvn.cast.GVN.panic-unwind.diff b/tests/mir-opt/gvn.cast.GVN.panic-unwind.diff index 33192ed8de0..fbdec455188 100644 --- a/tests/mir-opt/gvn.cast.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.cast.GVN.panic-unwind.diff @@ -105,18 +105,22 @@ bb0: { - StorageLive(_1); ++ nop; _1 = const 1_i64; - StorageLive(_2); ++ nop; _2 = const 1_u64; - StorageLive(_3); ++ nop; _3 = const 1f64; StorageLive(_4); StorageLive(_5); -- StorageLive(_6); + StorageLive(_6); - _6 = _1; - _5 = move _6 as u8 (IntToInt); -- StorageDead(_6); ++ _6 = const 1_i64; + _5 = const 1_i64 as u8 (IntToInt); + StorageDead(_6); _4 = opaque::<u8>(move _5) -> [return: bb1, unwind continue]; } @@ -125,11 +129,12 @@ StorageDead(_4); StorageLive(_7); StorageLive(_8); -- StorageLive(_9); + StorageLive(_9); - _9 = _1; - _8 = move _9 as u16 (IntToInt); -- StorageDead(_9); ++ _9 = const 1_i64; + _8 = const 1_i64 as u16 (IntToInt); + StorageDead(_9); _7 = opaque::<u16>(move _8) -> [return: bb2, unwind continue]; } @@ -138,11 +143,12 @@ StorageDead(_7); StorageLive(_10); StorageLive(_11); -- StorageLive(_12); + StorageLive(_12); - _12 = _1; - _11 = move _12 as u32 (IntToInt); -- StorageDead(_12); ++ _12 = const 1_i64; + _11 = const 1_i64 as u32 (IntToInt); + StorageDead(_12); _10 = opaque::<u32>(move _11) -> [return: bb3, unwind continue]; } @@ -151,11 +157,12 @@ StorageDead(_10); StorageLive(_13); StorageLive(_14); -- StorageLive(_15); + StorageLive(_15); - _15 = _1; - _14 = move _15 as u64 (IntToInt); -- StorageDead(_15); ++ _15 = const 1_i64; + _14 = const 1_i64 as u64 (IntToInt); + StorageDead(_15); _13 = opaque::<u64>(move _14) -> [return: bb4, unwind continue]; } @@ -164,11 +171,12 @@ StorageDead(_13); StorageLive(_16); StorageLive(_17); -- StorageLive(_18); + StorageLive(_18); - _18 = _1; - _17 = move _18 as i8 (IntToInt); -- StorageDead(_18); ++ _18 = const 1_i64; + _17 = const 1_i64 as i8 (IntToInt); + StorageDead(_18); _16 = opaque::<i8>(move _17) -> [return: bb5, unwind continue]; } @@ -177,11 +185,12 @@ StorageDead(_16); StorageLive(_19); StorageLive(_20); -- StorageLive(_21); + StorageLive(_21); - _21 = _1; - _20 = move _21 as i16 (IntToInt); -- StorageDead(_21); ++ _21 = const 1_i64; + _20 = const 1_i64 as i16 (IntToInt); + StorageDead(_21); _19 = opaque::<i16>(move _20) -> [return: bb6, unwind continue]; } @@ -190,11 +199,12 @@ StorageDead(_19); StorageLive(_22); StorageLive(_23); -- StorageLive(_24); + StorageLive(_24); - _24 = _1; - _23 = move _24 as i32 (IntToInt); -- StorageDead(_24); ++ _24 = const 1_i64; + _23 = const 1_i64 as i32 (IntToInt); + StorageDead(_24); _22 = opaque::<i32>(move _23) -> [return: bb7, unwind continue]; } @@ -202,22 +212,24 @@ StorageDead(_23); StorageDead(_22); StorageLive(_25); -- StorageLive(_26); + StorageLive(_26); - _26 = _1; - _25 = opaque::<i64>(move _26) -> [return: bb8, unwind continue]; ++ _26 = const 1_i64; + _25 = opaque::<i64>(const 1_i64) -> [return: bb8, unwind continue]; } bb8: { -- StorageDead(_26); + StorageDead(_26); StorageDead(_25); StorageLive(_27); StorageLive(_28); -- StorageLive(_29); + StorageLive(_29); - _29 = _1; - _28 = move _29 as f32 (IntToFloat); -- StorageDead(_29); ++ _29 = const 1_i64; + _28 = const 1_i64 as f32 (IntToFloat); + StorageDead(_29); _27 = opaque::<f32>(move _28) -> [return: bb9, unwind continue]; } @@ -226,11 +238,12 @@ StorageDead(_27); StorageLive(_30); StorageLive(_31); -- StorageLive(_32); + StorageLive(_32); - _32 = _1; - _31 = move _32 as f64 (IntToFloat); -- StorageDead(_32); ++ _32 = const 1_i64; + _31 = const 1_i64 as f64 (IntToFloat); + StorageDead(_32); _30 = opaque::<f64>(move _31) -> [return: bb10, unwind continue]; } @@ -239,11 +252,12 @@ StorageDead(_30); StorageLive(_33); StorageLive(_34); -- StorageLive(_35); + StorageLive(_35); - _35 = _2; - _34 = move _35 as u8 (IntToInt); -- StorageDead(_35); ++ _35 = const 1_u64; + _34 = const 1_u64 as u8 (IntToInt); + StorageDead(_35); _33 = opaque::<u8>(move _34) -> [return: bb11, unwind continue]; } @@ -252,11 +266,12 @@ StorageDead(_33); StorageLive(_36); StorageLive(_37); -- StorageLive(_38); + StorageLive(_38); - _38 = _2; - _37 = move _38 as u16 (IntToInt); -- StorageDead(_38); ++ _38 = const 1_u64; + _37 = const 1_u64 as u16 (IntToInt); + StorageDead(_38); _36 = opaque::<u16>(move _37) -> [return: bb12, unwind continue]; } @@ -265,11 +280,12 @@ StorageDead(_36); StorageLive(_39); StorageLive(_40); -- StorageLive(_41); + StorageLive(_41); - _41 = _2; - _40 = move _41 as u32 (IntToInt); -- StorageDead(_41); ++ _41 = const 1_u64; + _40 = const 1_u64 as u32 (IntToInt); + StorageDead(_41); _39 = opaque::<u32>(move _40) -> [return: bb13, unwind continue]; } @@ -277,22 +293,24 @@ StorageDead(_40); StorageDead(_39); StorageLive(_42); -- StorageLive(_43); + StorageLive(_43); - _43 = _2; - _42 = opaque::<u64>(move _43) -> [return: bb14, unwind continue]; ++ _43 = const 1_u64; + _42 = opaque::<u64>(const 1_u64) -> [return: bb14, unwind continue]; } bb14: { -- StorageDead(_43); + StorageDead(_43); StorageDead(_42); StorageLive(_44); StorageLive(_45); -- StorageLive(_46); + StorageLive(_46); - _46 = _2; - _45 = move _46 as i8 (IntToInt); -- StorageDead(_46); ++ _46 = const 1_u64; + _45 = const 1_u64 as i8 (IntToInt); + StorageDead(_46); _44 = opaque::<i8>(move _45) -> [return: bb15, unwind continue]; } @@ -301,11 +319,12 @@ StorageDead(_44); StorageLive(_47); StorageLive(_48); -- StorageLive(_49); + StorageLive(_49); - _49 = _2; - _48 = move _49 as i16 (IntToInt); -- StorageDead(_49); ++ _49 = const 1_u64; + _48 = const 1_u64 as i16 (IntToInt); + StorageDead(_49); _47 = opaque::<i16>(move _48) -> [return: bb16, unwind continue]; } @@ -314,11 +333,12 @@ StorageDead(_47); StorageLive(_50); StorageLive(_51); -- StorageLive(_52); + StorageLive(_52); - _52 = _2; - _51 = move _52 as i32 (IntToInt); -- StorageDead(_52); ++ _52 = const 1_u64; + _51 = const 1_u64 as i32 (IntToInt); + StorageDead(_52); _50 = opaque::<i32>(move _51) -> [return: bb17, unwind continue]; } @@ -327,11 +347,12 @@ StorageDead(_50); StorageLive(_53); StorageLive(_54); -- StorageLive(_55); + StorageLive(_55); - _55 = _2; - _54 = move _55 as i64 (IntToInt); -- StorageDead(_55); ++ _55 = const 1_u64; + _54 = const 1_u64 as i64 (IntToInt); + StorageDead(_55); _53 = opaque::<i64>(move _54) -> [return: bb18, unwind continue]; } @@ -340,11 +361,12 @@ StorageDead(_53); StorageLive(_56); StorageLive(_57); -- StorageLive(_58); + StorageLive(_58); - _58 = _2; - _57 = move _58 as f32 (IntToFloat); -- StorageDead(_58); ++ _58 = const 1_u64; + _57 = const 1_u64 as f32 (IntToFloat); + StorageDead(_58); _56 = opaque::<f32>(move _57) -> [return: bb19, unwind continue]; } @@ -353,11 +375,12 @@ StorageDead(_56); StorageLive(_59); StorageLive(_60); -- StorageLive(_61); + StorageLive(_61); - _61 = _2; - _60 = move _61 as f64 (IntToFloat); -- StorageDead(_61); ++ _61 = const 1_u64; + _60 = const 1_u64 as f64 (IntToFloat); + StorageDead(_61); _59 = opaque::<f64>(move _60) -> [return: bb20, unwind continue]; } @@ -366,11 +389,12 @@ StorageDead(_59); StorageLive(_62); StorageLive(_63); -- StorageLive(_64); + StorageLive(_64); - _64 = _3; - _63 = move _64 as u8 (FloatToInt); -- StorageDead(_64); ++ _64 = const 1f64; + _63 = const 1f64 as u8 (FloatToInt); + StorageDead(_64); _62 = opaque::<u8>(move _63) -> [return: bb21, unwind continue]; } @@ -379,11 +403,12 @@ StorageDead(_62); StorageLive(_65); StorageLive(_66); -- StorageLive(_67); + StorageLive(_67); - _67 = _3; - _66 = move _67 as u16 (FloatToInt); -- StorageDead(_67); ++ _67 = const 1f64; + _66 = const 1f64 as u16 (FloatToInt); + StorageDead(_67); _65 = opaque::<u16>(move _66) -> [return: bb22, unwind continue]; } @@ -392,11 +417,12 @@ StorageDead(_65); StorageLive(_68); StorageLive(_69); -- StorageLive(_70); + StorageLive(_70); - _70 = _3; - _69 = move _70 as u32 (FloatToInt); -- StorageDead(_70); ++ _70 = const 1f64; + _69 = const 1f64 as u32 (FloatToInt); + StorageDead(_70); _68 = opaque::<u32>(move _69) -> [return: bb23, unwind continue]; } @@ -405,11 +431,12 @@ StorageDead(_68); StorageLive(_71); StorageLive(_72); -- StorageLive(_73); + StorageLive(_73); - _73 = _3; - _72 = move _73 as u64 (FloatToInt); -- StorageDead(_73); ++ _73 = const 1f64; + _72 = const 1f64 as u64 (FloatToInt); + StorageDead(_73); _71 = opaque::<u64>(move _72) -> [return: bb24, unwind continue]; } @@ -418,11 +445,12 @@ StorageDead(_71); StorageLive(_74); StorageLive(_75); -- StorageLive(_76); + StorageLive(_76); - _76 = _3; - _75 = move _76 as i8 (FloatToInt); -- StorageDead(_76); ++ _76 = const 1f64; + _75 = const 1f64 as i8 (FloatToInt); + StorageDead(_76); _74 = opaque::<i8>(move _75) -> [return: bb25, unwind continue]; } @@ -431,11 +459,12 @@ StorageDead(_74); StorageLive(_77); StorageLive(_78); -- StorageLive(_79); + StorageLive(_79); - _79 = _3; - _78 = move _79 as i16 (FloatToInt); -- StorageDead(_79); ++ _79 = const 1f64; + _78 = const 1f64 as i16 (FloatToInt); + StorageDead(_79); _77 = opaque::<i16>(move _78) -> [return: bb26, unwind continue]; } @@ -444,11 +473,12 @@ StorageDead(_77); StorageLive(_80); StorageLive(_81); -- StorageLive(_82); + StorageLive(_82); - _82 = _3; - _81 = move _82 as i32 (FloatToInt); -- StorageDead(_82); ++ _82 = const 1f64; + _81 = const 1f64 as i32 (FloatToInt); + StorageDead(_82); _80 = opaque::<i32>(move _81) -> [return: bb27, unwind continue]; } @@ -457,11 +487,12 @@ StorageDead(_80); StorageLive(_83); StorageLive(_84); -- StorageLive(_85); + StorageLive(_85); - _85 = _3; - _84 = move _85 as i64 (FloatToInt); -- StorageDead(_85); ++ _85 = const 1f64; + _84 = const 1f64 as i64 (FloatToInt); + StorageDead(_85); _83 = opaque::<i64>(move _84) -> [return: bb28, unwind continue]; } @@ -470,11 +501,12 @@ StorageDead(_83); StorageLive(_86); StorageLive(_87); -- StorageLive(_88); + StorageLive(_88); - _88 = _3; - _87 = move _88 as f32 (FloatToFloat); -- StorageDead(_88); ++ _88 = const 1f64; + _87 = const 1f64 as f32 (FloatToFloat); + StorageDead(_88); _86 = opaque::<f32>(move _87) -> [return: bb29, unwind continue]; } @@ -482,19 +514,23 @@ StorageDead(_87); StorageDead(_86); StorageLive(_89); -- StorageLive(_90); + StorageLive(_90); - _90 = _3; - _89 = opaque::<f64>(move _90) -> [return: bb30, unwind continue]; ++ _90 = const 1f64; + _89 = opaque::<f64>(const 1f64) -> [return: bb30, unwind continue]; } bb30: { -- StorageDead(_90); + StorageDead(_90); StorageDead(_89); _0 = const (); - StorageDead(_3); - StorageDead(_2); - StorageDead(_1); ++ nop; ++ nop; ++ nop; return; } } diff --git a/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff b/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff index ee320cf6787..46bf13985da 100644 --- a/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.dereferences.GVN.panic-abort.diff @@ -116,6 +116,7 @@ _18 = &(*_1); StorageLive(_19); - StorageLive(_20); ++ nop; _20 = (*_18); - _19 = opaque::<u32>(move _20) -> [return: bb7, unwind unreachable]; + _19 = opaque::<u32>(_20) -> [return: bb7, unwind unreachable]; @@ -123,16 +124,18 @@ bb7: { - StorageDead(_20); ++ nop; StorageDead(_19); StorageLive(_21); -- StorageLive(_22); + StorageLive(_22); - _22 = (*_18); - _21 = opaque::<u32>(move _22) -> [return: bb8, unwind unreachable]; ++ _22 = _20; + _21 = opaque::<u32>(_20) -> [return: bb8, unwind unreachable]; } bb8: { -- StorageDead(_22); + StorageDead(_22); StorageDead(_21); StorageLive(_23); StorageLive(_24); @@ -163,6 +166,7 @@ StorageDead(_27); StorageLive(_29); - StorageLive(_30); ++ nop; _30 = ((*_3).0: u32); - _29 = opaque::<u32>(move _30) -> [return: bb12, unwind unreachable]; + _29 = opaque::<u32>(_30) -> [return: bb12, unwind unreachable]; @@ -170,16 +174,18 @@ bb12: { - StorageDead(_30); ++ nop; StorageDead(_29); StorageLive(_31); -- StorageLive(_32); + StorageLive(_32); - _32 = ((*_3).0: u32); - _31 = opaque::<u32>(move _32) -> [return: bb13, unwind unreachable]; ++ _32 = _30; + _31 = opaque::<u32>(_30) -> [return: bb13, unwind unreachable]; } bb13: { -- StorageDead(_32); + StorageDead(_32); StorageDead(_31); _0 = const (); StorageDead(_18); diff --git a/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff b/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff index f627b4d5988..3e731ead859 100644 --- a/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.dereferences.GVN.panic-unwind.diff @@ -116,6 +116,7 @@ _18 = &(*_1); StorageLive(_19); - StorageLive(_20); ++ nop; _20 = (*_18); - _19 = opaque::<u32>(move _20) -> [return: bb7, unwind continue]; + _19 = opaque::<u32>(_20) -> [return: bb7, unwind continue]; @@ -123,16 +124,18 @@ bb7: { - StorageDead(_20); ++ nop; StorageDead(_19); StorageLive(_21); -- StorageLive(_22); + StorageLive(_22); - _22 = (*_18); - _21 = opaque::<u32>(move _22) -> [return: bb8, unwind continue]; ++ _22 = _20; + _21 = opaque::<u32>(_20) -> [return: bb8, unwind continue]; } bb8: { -- StorageDead(_22); + StorageDead(_22); StorageDead(_21); StorageLive(_23); StorageLive(_24); @@ -163,6 +166,7 @@ StorageDead(_27); StorageLive(_29); - StorageLive(_30); ++ nop; _30 = ((*_3).0: u32); - _29 = opaque::<u32>(move _30) -> [return: bb12, unwind continue]; + _29 = opaque::<u32>(_30) -> [return: bb12, unwind continue]; @@ -170,16 +174,18 @@ bb12: { - StorageDead(_30); ++ nop; StorageDead(_29); StorageLive(_31); -- StorageLive(_32); + StorageLive(_32); - _32 = ((*_3).0: u32); - _31 = opaque::<u32>(move _32) -> [return: bb13, unwind continue]; ++ _32 = _30; + _31 = opaque::<u32>(_30) -> [return: bb13, unwind continue]; } bb13: { -- StorageDead(_32); + StorageDead(_32); StorageDead(_31); _0 = const (); StorageDead(_18); diff --git a/tests/mir-opt/gvn.multiple_branches.GVN.panic-abort.diff b/tests/mir-opt/gvn.multiple_branches.GVN.panic-abort.diff index 0a66900283b..29ca1ba5902 100644 --- a/tests/mir-opt/gvn.multiple_branches.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.multiple_branches.GVN.panic-abort.diff @@ -39,9 +39,9 @@ let mut _34: u8; bb0: { -- StorageLive(_4); -- StorageLive(_5); -- _5 = _1; + StorageLive(_4); + StorageLive(_5); + _5 = _1; - switchInt(move _5) -> [0: bb4, otherwise: bb1]; + switchInt(_1) -> [0: bb4, otherwise: bb1]; } @@ -49,121 +49,130 @@ bb1: { StorageLive(_6); - StorageLive(_7); -- StorageLive(_8); -- _8 = _2; -- StorageLive(_9); -- _9 = _3; ++ nop; + StorageLive(_8); + _8 = _2; + StorageLive(_9); + _9 = _3; - _7 = Add(move _8, move _9); -- StorageDead(_9); -- StorageDead(_8); -- _6 = opaque::<u8>(move _7) -> [return: bb2, unwind unreachable]; + _7 = Add(_2, _3); + StorageDead(_9); + StorageDead(_8); +- _6 = opaque::<u8>(move _7) -> [return: bb2, unwind unreachable]; + _6 = opaque::<u8>(_7) -> [return: bb2, unwind unreachable]; } bb2: { - StorageDead(_7); ++ nop; StorageDead(_6); StorageLive(_10); -- StorageLive(_11); -- StorageLive(_12); -- _12 = _2; -- StorageLive(_13); -- _13 = _3; + StorageLive(_11); + StorageLive(_12); + _12 = _2; + StorageLive(_13); + _13 = _3; - _11 = Add(move _12, move _13); -- StorageDead(_13); -- StorageDead(_12); ++ _11 = _7; + StorageDead(_13); + StorageDead(_12); - _10 = opaque::<u8>(move _11) -> [return: bb3, unwind unreachable]; + _10 = opaque::<u8>(_7) -> [return: bb3, unwind unreachable]; } bb3: { -- StorageDead(_11); + StorageDead(_11); StorageDead(_10); -- _4 = const (); + _4 = const (); goto -> bb7; } bb4: { StorageLive(_14); - StorageLive(_15); -- StorageLive(_16); -- _16 = _2; -- StorageLive(_17); -- _17 = _3; ++ nop; + StorageLive(_16); + _16 = _2; + StorageLive(_17); + _17 = _3; - _15 = Add(move _16, move _17); -- StorageDead(_17); -- StorageDead(_16); -- _14 = opaque::<u8>(move _15) -> [return: bb5, unwind unreachable]; + _15 = Add(_2, _3); + StorageDead(_17); + StorageDead(_16); +- _14 = opaque::<u8>(move _15) -> [return: bb5, unwind unreachable]; + _14 = opaque::<u8>(_15) -> [return: bb5, unwind unreachable]; } bb5: { - StorageDead(_15); ++ nop; StorageDead(_14); StorageLive(_18); -- StorageLive(_19); -- StorageLive(_20); -- _20 = _2; -- StorageLive(_21); -- _21 = _3; + StorageLive(_19); + StorageLive(_20); + _20 = _2; + StorageLive(_21); + _21 = _3; - _19 = Add(move _20, move _21); -- StorageDead(_21); -- StorageDead(_20); ++ _19 = _15; + StorageDead(_21); + StorageDead(_20); - _18 = opaque::<u8>(move _19) -> [return: bb6, unwind unreachable]; + _18 = opaque::<u8>(_15) -> [return: bb6, unwind unreachable]; } bb6: { -- StorageDead(_19); + StorageDead(_19); StorageDead(_18); -- _4 = const (); + _4 = const (); goto -> bb7; } bb7: { -- StorageDead(_5); -- StorageDead(_4); + StorageDead(_5); + StorageDead(_4); StorageLive(_22); - StorageLive(_23); -- StorageLive(_24); -- _24 = _2; -- StorageLive(_25); -- _25 = _3; ++ nop; + StorageLive(_24); + _24 = _2; + StorageLive(_25); + _25 = _3; - _23 = Add(move _24, move _25); -- StorageDead(_25); -- StorageDead(_24); -- _22 = opaque::<u8>(move _23) -> [return: bb8, unwind unreachable]; + _23 = Add(_2, _3); + StorageDead(_25); + StorageDead(_24); +- _22 = opaque::<u8>(move _23) -> [return: bb8, unwind unreachable]; + _22 = opaque::<u8>(_23) -> [return: bb8, unwind unreachable]; } bb8: { - StorageDead(_23); ++ nop; StorageDead(_22); -- StorageLive(_26); -- _26 = _1; + StorageLive(_26); + _26 = _1; - switchInt(move _26) -> [0: bb11, otherwise: bb9]; + switchInt(_1) -> [0: bb11, otherwise: bb9]; } bb9: { StorageLive(_27); -- StorageLive(_28); -- StorageLive(_29); -- _29 = _2; -- StorageLive(_30); -- _30 = _3; + StorageLive(_28); + StorageLive(_29); + _29 = _2; + StorageLive(_30); + _30 = _3; - _28 = Add(move _29, move _30); -- StorageDead(_30); -- StorageDead(_29); ++ _28 = _23; + StorageDead(_30); + StorageDead(_29); - _27 = opaque::<u8>(move _28) -> [return: bb10, unwind unreachable]; + _27 = opaque::<u8>(_23) -> [return: bb10, unwind unreachable]; } bb10: { -- StorageDead(_28); + StorageDead(_28); StorageDead(_27); _0 = const (); goto -> bb13; @@ -171,27 +180,28 @@ bb11: { StorageLive(_31); -- StorageLive(_32); -- StorageLive(_33); -- _33 = _2; -- StorageLive(_34); -- _34 = _3; + StorageLive(_32); + StorageLive(_33); + _33 = _2; + StorageLive(_34); + _34 = _3; - _32 = Add(move _33, move _34); -- StorageDead(_34); -- StorageDead(_33); ++ _32 = _23; + StorageDead(_34); + StorageDead(_33); - _31 = opaque::<u8>(move _32) -> [return: bb12, unwind unreachable]; + _31 = opaque::<u8>(_23) -> [return: bb12, unwind unreachable]; } bb12: { -- StorageDead(_32); + StorageDead(_32); StorageDead(_31); _0 = const (); goto -> bb13; } bb13: { -- StorageDead(_26); + StorageDead(_26); return; } } diff --git a/tests/mir-opt/gvn.multiple_branches.GVN.panic-unwind.diff b/tests/mir-opt/gvn.multiple_branches.GVN.panic-unwind.diff index 0199f2720a9..5394dc8be8a 100644 --- a/tests/mir-opt/gvn.multiple_branches.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.multiple_branches.GVN.panic-unwind.diff @@ -39,9 +39,9 @@ let mut _34: u8; bb0: { -- StorageLive(_4); -- StorageLive(_5); -- _5 = _1; + StorageLive(_4); + StorageLive(_5); + _5 = _1; - switchInt(move _5) -> [0: bb4, otherwise: bb1]; + switchInt(_1) -> [0: bb4, otherwise: bb1]; } @@ -49,121 +49,130 @@ bb1: { StorageLive(_6); - StorageLive(_7); -- StorageLive(_8); -- _8 = _2; -- StorageLive(_9); -- _9 = _3; ++ nop; + StorageLive(_8); + _8 = _2; + StorageLive(_9); + _9 = _3; - _7 = Add(move _8, move _9); -- StorageDead(_9); -- StorageDead(_8); -- _6 = opaque::<u8>(move _7) -> [return: bb2, unwind continue]; + _7 = Add(_2, _3); + StorageDead(_9); + StorageDead(_8); +- _6 = opaque::<u8>(move _7) -> [return: bb2, unwind continue]; + _6 = opaque::<u8>(_7) -> [return: bb2, unwind continue]; } bb2: { - StorageDead(_7); ++ nop; StorageDead(_6); StorageLive(_10); -- StorageLive(_11); -- StorageLive(_12); -- _12 = _2; -- StorageLive(_13); -- _13 = _3; + StorageLive(_11); + StorageLive(_12); + _12 = _2; + StorageLive(_13); + _13 = _3; - _11 = Add(move _12, move _13); -- StorageDead(_13); -- StorageDead(_12); ++ _11 = _7; + StorageDead(_13); + StorageDead(_12); - _10 = opaque::<u8>(move _11) -> [return: bb3, unwind continue]; + _10 = opaque::<u8>(_7) -> [return: bb3, unwind continue]; } bb3: { -- StorageDead(_11); + StorageDead(_11); StorageDead(_10); -- _4 = const (); + _4 = const (); goto -> bb7; } bb4: { StorageLive(_14); - StorageLive(_15); -- StorageLive(_16); -- _16 = _2; -- StorageLive(_17); -- _17 = _3; ++ nop; + StorageLive(_16); + _16 = _2; + StorageLive(_17); + _17 = _3; - _15 = Add(move _16, move _17); -- StorageDead(_17); -- StorageDead(_16); -- _14 = opaque::<u8>(move _15) -> [return: bb5, unwind continue]; + _15 = Add(_2, _3); + StorageDead(_17); + StorageDead(_16); +- _14 = opaque::<u8>(move _15) -> [return: bb5, unwind continue]; + _14 = opaque::<u8>(_15) -> [return: bb5, unwind continue]; } bb5: { - StorageDead(_15); ++ nop; StorageDead(_14); StorageLive(_18); -- StorageLive(_19); -- StorageLive(_20); -- _20 = _2; -- StorageLive(_21); -- _21 = _3; + StorageLive(_19); + StorageLive(_20); + _20 = _2; + StorageLive(_21); + _21 = _3; - _19 = Add(move _20, move _21); -- StorageDead(_21); -- StorageDead(_20); ++ _19 = _15; + StorageDead(_21); + StorageDead(_20); - _18 = opaque::<u8>(move _19) -> [return: bb6, unwind continue]; + _18 = opaque::<u8>(_15) -> [return: bb6, unwind continue]; } bb6: { -- StorageDead(_19); + StorageDead(_19); StorageDead(_18); -- _4 = const (); + _4 = const (); goto -> bb7; } bb7: { -- StorageDead(_5); -- StorageDead(_4); + StorageDead(_5); + StorageDead(_4); StorageLive(_22); - StorageLive(_23); -- StorageLive(_24); -- _24 = _2; -- StorageLive(_25); -- _25 = _3; ++ nop; + StorageLive(_24); + _24 = _2; + StorageLive(_25); + _25 = _3; - _23 = Add(move _24, move _25); -- StorageDead(_25); -- StorageDead(_24); -- _22 = opaque::<u8>(move _23) -> [return: bb8, unwind continue]; + _23 = Add(_2, _3); + StorageDead(_25); + StorageDead(_24); +- _22 = opaque::<u8>(move _23) -> [return: bb8, unwind continue]; + _22 = opaque::<u8>(_23) -> [return: bb8, unwind continue]; } bb8: { - StorageDead(_23); ++ nop; StorageDead(_22); -- StorageLive(_26); -- _26 = _1; + StorageLive(_26); + _26 = _1; - switchInt(move _26) -> [0: bb11, otherwise: bb9]; + switchInt(_1) -> [0: bb11, otherwise: bb9]; } bb9: { StorageLive(_27); -- StorageLive(_28); -- StorageLive(_29); -- _29 = _2; -- StorageLive(_30); -- _30 = _3; + StorageLive(_28); + StorageLive(_29); + _29 = _2; + StorageLive(_30); + _30 = _3; - _28 = Add(move _29, move _30); -- StorageDead(_30); -- StorageDead(_29); ++ _28 = _23; + StorageDead(_30); + StorageDead(_29); - _27 = opaque::<u8>(move _28) -> [return: bb10, unwind continue]; + _27 = opaque::<u8>(_23) -> [return: bb10, unwind continue]; } bb10: { -- StorageDead(_28); + StorageDead(_28); StorageDead(_27); _0 = const (); goto -> bb13; @@ -171,27 +180,28 @@ bb11: { StorageLive(_31); -- StorageLive(_32); -- StorageLive(_33); -- _33 = _2; -- StorageLive(_34); -- _34 = _3; + StorageLive(_32); + StorageLive(_33); + _33 = _2; + StorageLive(_34); + _34 = _3; - _32 = Add(move _33, move _34); -- StorageDead(_34); -- StorageDead(_33); ++ _32 = _23; + StorageDead(_34); + StorageDead(_33); - _31 = opaque::<u8>(move _32) -> [return: bb12, unwind continue]; + _31 = opaque::<u8>(_23) -> [return: bb12, unwind continue]; } bb12: { -- StorageDead(_32); + StorageDead(_32); StorageDead(_31); _0 = const (); goto -> bb13; } bb13: { -- StorageDead(_26); + StorageDead(_26); return; } } diff --git a/tests/mir-opt/gvn.repeated_index.GVN.panic-abort.diff b/tests/mir-opt/gvn.repeated_index.GVN.panic-abort.diff index 4c29523d6b2..6e542d7f964 100644 --- a/tests/mir-opt/gvn.repeated_index.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.repeated_index.GVN.panic-abort.diff @@ -23,11 +23,11 @@ bb0: { StorageLive(_3); -- StorageLive(_4); -- _4 = _1; + StorageLive(_4); + _4 = _1; - _3 = [move _4; N]; -- StorageDead(_4); + _3 = [_1; N]; + StorageDead(_4); StorageLive(_5); StorageLive(_6); StorageLive(_7); @@ -55,6 +55,7 @@ - _13 = Len(_3); - _14 = Lt(_12, _13); - assert(move _14, "index out of bounds: the length is {} but the index is {}", move _13, _12) -> [success: bb3, unwind unreachable]; ++ _13 = _8; + _14 = Lt(_2, _8); + assert(move _14, "index out of bounds: the length is {} but the index is {}", _8, _2) -> [success: bb3, unwind unreachable]; } diff --git a/tests/mir-opt/gvn.repeated_index.GVN.panic-unwind.diff b/tests/mir-opt/gvn.repeated_index.GVN.panic-unwind.diff index e44f54cf3cf..a07cd49ec7c 100644 --- a/tests/mir-opt/gvn.repeated_index.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.repeated_index.GVN.panic-unwind.diff @@ -23,11 +23,11 @@ bb0: { StorageLive(_3); -- StorageLive(_4); -- _4 = _1; + StorageLive(_4); + _4 = _1; - _3 = [move _4; N]; -- StorageDead(_4); + _3 = [_1; N]; + StorageDead(_4); StorageLive(_5); StorageLive(_6); StorageLive(_7); @@ -55,6 +55,7 @@ - _13 = Len(_3); - _14 = Lt(_12, _13); - assert(move _14, "index out of bounds: the length is {} but the index is {}", move _13, _12) -> [success: bb3, unwind continue]; ++ _13 = _8; + _14 = Lt(_2, _8); + assert(move _14, "index out of bounds: the length is {} but the index is {}", _8, _2) -> [success: bb3, unwind continue]; } diff --git a/tests/mir-opt/gvn.slices.GVN.panic-abort.diff b/tests/mir-opt/gvn.slices.GVN.panic-abort.diff index de3d28d0575..d924c70d617 100644 --- a/tests/mir-opt/gvn.slices.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.slices.GVN.panic-abort.diff @@ -85,30 +85,32 @@ bb0: { - StorageLive(_1); ++ nop; _1 = const "my favourite slice"; StorageLive(_2); -- StorageLive(_3); -- _3 = _1; + StorageLive(_3); + _3 = _1; - _2 = opaque::<&str>(move _3) -> [return: bb1, unwind unreachable]; + _2 = opaque::<&str>(_1) -> [return: bb1, unwind unreachable]; } bb1: { -- StorageDead(_3); + StorageDead(_3); StorageDead(_2); StorageLive(_4); _4 = _1; StorageLive(_5); -- StorageLive(_6); + StorageLive(_6); - _6 = _4; - _5 = opaque::<&str>(move _6) -> [return: bb2, unwind unreachable]; ++ _6 = _1; + _5 = opaque::<&str>(_1) -> [return: bb2, unwind unreachable]; } bb2: { -- StorageDead(_6); + StorageDead(_6); StorageDead(_5); -- StorageLive(_7); + StorageLive(_7); StorageLive(_8); StorageLive(_9); StorageLive(_10); @@ -149,22 +151,23 @@ bb5: { StorageDead(_19); StorageDead(_18); -- _7 = const (); + _7 = const (); StorageDead(_17); StorageDead(_16); StorageDead(_15); StorageDead(_13); StorageDead(_10); StorageDead(_8); -- StorageDead(_7); + StorageDead(_7); - StorageLive(_29); ++ nop; StorageLive(_30); _30 = &(*_1); _29 = move _30 as &[u8] (Transmute); StorageDead(_30); StorageLive(_31); -- StorageLive(_32); -- _32 = _29; + StorageLive(_32); + _32 = _29; - _31 = opaque::<&[u8]>(move _32) -> [return: bb7, unwind unreachable]; + _31 = opaque::<&[u8]>(_29) -> [return: bb7, unwind unreachable]; } @@ -173,10 +176,12 @@ StorageDead(_19); StorageDead(_18); - StorageLive(_21); ++ nop; _21 = core::panicking::AssertKind::Eq; StorageLive(_22); -- StorageLive(_23); + StorageLive(_23); - _23 = move _21; ++ _23 = _21; StorageLive(_24); StorageLive(_25); _25 = &(*_15); @@ -192,9 +197,9 @@ } bb7: { -- StorageDead(_32); + StorageDead(_32); StorageDead(_31); -- StorageLive(_33); + StorageLive(_33); StorageLive(_34); StorageLive(_35); StorageLive(_36); @@ -235,18 +240,20 @@ bb10: { StorageDead(_45); StorageDead(_44); -- _33 = const (); + _33 = const (); StorageDead(_43); StorageDead(_42); StorageDead(_41); StorageDead(_39); StorageDead(_36); StorageDead(_34); -- StorageDead(_33); + StorageDead(_33); _0 = const (); - StorageDead(_29); ++ nop; StorageDead(_4); - StorageDead(_1); ++ nop; return; } @@ -254,10 +261,12 @@ StorageDead(_45); StorageDead(_44); - StorageLive(_47); ++ nop; _47 = core::panicking::AssertKind::Eq; StorageLive(_48); -- StorageLive(_49); + StorageLive(_49); - _49 = move _47; ++ _49 = _47; StorageLive(_50); StorageLive(_51); _51 = &(*_41); diff --git a/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff b/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff index f22bb25436f..63225aa0a10 100644 --- a/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.slices.GVN.panic-unwind.diff @@ -85,30 +85,32 @@ bb0: { - StorageLive(_1); ++ nop; _1 = const "my favourite slice"; StorageLive(_2); -- StorageLive(_3); -- _3 = _1; + StorageLive(_3); + _3 = _1; - _2 = opaque::<&str>(move _3) -> [return: bb1, unwind continue]; + _2 = opaque::<&str>(_1) -> [return: bb1, unwind continue]; } bb1: { -- StorageDead(_3); + StorageDead(_3); StorageDead(_2); StorageLive(_4); _4 = _1; StorageLive(_5); -- StorageLive(_6); + StorageLive(_6); - _6 = _4; - _5 = opaque::<&str>(move _6) -> [return: bb2, unwind continue]; ++ _6 = _1; + _5 = opaque::<&str>(_1) -> [return: bb2, unwind continue]; } bb2: { -- StorageDead(_6); + StorageDead(_6); StorageDead(_5); -- StorageLive(_7); + StorageLive(_7); StorageLive(_8); StorageLive(_9); StorageLive(_10); @@ -149,22 +151,23 @@ bb5: { StorageDead(_19); StorageDead(_18); -- _7 = const (); + _7 = const (); StorageDead(_17); StorageDead(_16); StorageDead(_15); StorageDead(_13); StorageDead(_10); StorageDead(_8); -- StorageDead(_7); + StorageDead(_7); - StorageLive(_29); ++ nop; StorageLive(_30); _30 = &(*_1); _29 = move _30 as &[u8] (Transmute); StorageDead(_30); StorageLive(_31); -- StorageLive(_32); -- _32 = _29; + StorageLive(_32); + _32 = _29; - _31 = opaque::<&[u8]>(move _32) -> [return: bb7, unwind continue]; + _31 = opaque::<&[u8]>(_29) -> [return: bb7, unwind continue]; } @@ -173,10 +176,12 @@ StorageDead(_19); StorageDead(_18); - StorageLive(_21); ++ nop; _21 = core::panicking::AssertKind::Eq; StorageLive(_22); -- StorageLive(_23); + StorageLive(_23); - _23 = move _21; ++ _23 = _21; StorageLive(_24); StorageLive(_25); _25 = &(*_15); @@ -192,9 +197,9 @@ } bb7: { -- StorageDead(_32); + StorageDead(_32); StorageDead(_31); -- StorageLive(_33); + StorageLive(_33); StorageLive(_34); StorageLive(_35); StorageLive(_36); @@ -235,18 +240,20 @@ bb10: { StorageDead(_45); StorageDead(_44); -- _33 = const (); + _33 = const (); StorageDead(_43); StorageDead(_42); StorageDead(_41); StorageDead(_39); StorageDead(_36); StorageDead(_34); -- StorageDead(_33); + StorageDead(_33); _0 = const (); - StorageDead(_29); ++ nop; StorageDead(_4); - StorageDead(_1); ++ nop; return; } @@ -254,10 +261,12 @@ StorageDead(_45); StorageDead(_44); - StorageLive(_47); ++ nop; _47 = core::panicking::AssertKind::Eq; StorageLive(_48); -- StorageLive(_49); + StorageLive(_49); - _49 = move _47; ++ _49 = _47; StorageLive(_50); StorageLive(_51); _51 = &(*_41); diff --git a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff index bf866e2f4d2..6c8513e3281 100644 --- a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-abort.diff @@ -197,61 +197,68 @@ bb0: { StorageLive(_4); - StorageLive(_5); -- StorageLive(_6); -- _6 = _1; -- StorageLive(_7); -- _7 = _2; ++ nop; + StorageLive(_6); + _6 = _1; + StorageLive(_7); + _7 = _2; - _5 = Add(move _6, move _7); -- StorageDead(_7); -- StorageDead(_6); -- _4 = opaque::<u64>(move _5) -> [return: bb1, unwind unreachable]; + _5 = Add(_1, _2); + StorageDead(_7); + StorageDead(_6); +- _4 = opaque::<u64>(move _5) -> [return: bb1, unwind unreachable]; + _4 = opaque::<u64>(_5) -> [return: bb1, unwind unreachable]; } bb1: { - StorageDead(_5); ++ nop; StorageDead(_4); StorageLive(_8); - StorageLive(_9); -- StorageLive(_10); -- _10 = _1; -- StorageLive(_11); -- _11 = _2; ++ nop; + StorageLive(_10); + _10 = _1; + StorageLive(_11); + _11 = _2; - _9 = Mul(move _10, move _11); -- StorageDead(_11); -- StorageDead(_10); -- _8 = opaque::<u64>(move _9) -> [return: bb2, unwind unreachable]; + _9 = Mul(_1, _2); + StorageDead(_11); + StorageDead(_10); +- _8 = opaque::<u64>(move _9) -> [return: bb2, unwind unreachable]; + _8 = opaque::<u64>(_9) -> [return: bb2, unwind unreachable]; } bb2: { - StorageDead(_9); ++ nop; StorageDead(_8); StorageLive(_12); - StorageLive(_13); -- StorageLive(_14); -- _14 = _1; -- StorageLive(_15); -- _15 = _2; ++ nop; + StorageLive(_14); + _14 = _1; + StorageLive(_15); + _15 = _2; - _13 = Sub(move _14, move _15); -- StorageDead(_15); -- StorageDead(_14); -- _12 = opaque::<u64>(move _13) -> [return: bb3, unwind unreachable]; + _13 = Sub(_1, _2); + StorageDead(_15); + StorageDead(_14); +- _12 = opaque::<u64>(move _13) -> [return: bb3, unwind unreachable]; + _12 = opaque::<u64>(_13) -> [return: bb3, unwind unreachable]; } bb3: { - StorageDead(_13); ++ nop; StorageDead(_12); StorageLive(_16); - StorageLive(_17); -- StorageLive(_18); -- _18 = _1; -- StorageLive(_19); -- _19 = _2; ++ nop; + StorageLive(_18); + _18 = _1; + StorageLive(_19); + _19 = _2; - _20 = Eq(_19, const 0_u64); - assert(!move _20, "attempt to divide `{}` by zero", _18) -> [success: bb4, unwind unreachable]; + _20 = Eq(_2, const 0_u64); @@ -260,131 +267,145 @@ bb4: { - _17 = Div(move _18, move _19); -- StorageDead(_19); -- StorageDead(_18); -- _16 = opaque::<u64>(move _17) -> [return: bb5, unwind unreachable]; + _17 = Div(_1, _2); + StorageDead(_19); + StorageDead(_18); +- _16 = opaque::<u64>(move _17) -> [return: bb5, unwind unreachable]; + _16 = opaque::<u64>(_17) -> [return: bb5, unwind unreachable]; } bb5: { - StorageDead(_17); ++ nop; StorageDead(_16); StorageLive(_21); - StorageLive(_22); -- StorageLive(_23); -- _23 = _1; -- StorageLive(_24); -- _24 = _2; ++ nop; + StorageLive(_23); + _23 = _1; + StorageLive(_24); + _24 = _2; - _25 = Eq(_24, const 0_u64); - assert(!move _25, "attempt to calculate the remainder of `{}` with a divisor of zero", _23) -> [success: bb6, unwind unreachable]; ++ _25 = _20; + assert(!_20, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb6, unwind unreachable]; } bb6: { - _22 = Rem(move _23, move _24); -- StorageDead(_24); -- StorageDead(_23); -- _21 = opaque::<u64>(move _22) -> [return: bb7, unwind unreachable]; + _22 = Rem(_1, _2); + StorageDead(_24); + StorageDead(_23); +- _21 = opaque::<u64>(move _22) -> [return: bb7, unwind unreachable]; + _21 = opaque::<u64>(_22) -> [return: bb7, unwind unreachable]; } bb7: { - StorageDead(_22); ++ nop; StorageDead(_21); StorageLive(_26); - StorageLive(_27); -- StorageLive(_28); -- _28 = _1; -- StorageLive(_29); -- _29 = _2; ++ nop; + StorageLive(_28); + _28 = _1; + StorageLive(_29); + _29 = _2; - _27 = BitAnd(move _28, move _29); -- StorageDead(_29); -- StorageDead(_28); -- _26 = opaque::<u64>(move _27) -> [return: bb8, unwind unreachable]; + _27 = BitAnd(_1, _2); + StorageDead(_29); + StorageDead(_28); +- _26 = opaque::<u64>(move _27) -> [return: bb8, unwind unreachable]; + _26 = opaque::<u64>(_27) -> [return: bb8, unwind unreachable]; } bb8: { - StorageDead(_27); ++ nop; StorageDead(_26); StorageLive(_30); - StorageLive(_31); -- StorageLive(_32); -- _32 = _1; -- StorageLive(_33); -- _33 = _2; ++ nop; + StorageLive(_32); + _32 = _1; + StorageLive(_33); + _33 = _2; - _31 = BitOr(move _32, move _33); -- StorageDead(_33); -- StorageDead(_32); -- _30 = opaque::<u64>(move _31) -> [return: bb9, unwind unreachable]; + _31 = BitOr(_1, _2); + StorageDead(_33); + StorageDead(_32); +- _30 = opaque::<u64>(move _31) -> [return: bb9, unwind unreachable]; + _30 = opaque::<u64>(_31) -> [return: bb9, unwind unreachable]; } bb9: { - StorageDead(_31); ++ nop; StorageDead(_30); StorageLive(_34); - StorageLive(_35); -- StorageLive(_36); -- _36 = _1; -- StorageLive(_37); -- _37 = _2; ++ nop; + StorageLive(_36); + _36 = _1; + StorageLive(_37); + _37 = _2; - _35 = BitXor(move _36, move _37); -- StorageDead(_37); -- StorageDead(_36); -- _34 = opaque::<u64>(move _35) -> [return: bb10, unwind unreachable]; + _35 = BitXor(_1, _2); + StorageDead(_37); + StorageDead(_36); +- _34 = opaque::<u64>(move _35) -> [return: bb10, unwind unreachable]; + _34 = opaque::<u64>(_35) -> [return: bb10, unwind unreachable]; } bb10: { - StorageDead(_35); ++ nop; StorageDead(_34); StorageLive(_38); - StorageLive(_39); -- StorageLive(_40); -- _40 = _1; -- StorageLive(_41); -- _41 = _2; ++ nop; + StorageLive(_40); + _40 = _1; + StorageLive(_41); + _41 = _2; - _39 = Shl(move _40, move _41); -- StorageDead(_41); -- StorageDead(_40); -- _38 = opaque::<u64>(move _39) -> [return: bb11, unwind unreachable]; + _39 = Shl(_1, _2); + StorageDead(_41); + StorageDead(_40); +- _38 = opaque::<u64>(move _39) -> [return: bb11, unwind unreachable]; + _38 = opaque::<u64>(_39) -> [return: bb11, unwind unreachable]; } bb11: { - StorageDead(_39); ++ nop; StorageDead(_38); StorageLive(_42); - StorageLive(_43); -- StorageLive(_44); -- _44 = _1; -- StorageLive(_45); -- _45 = _2; ++ nop; + StorageLive(_44); + _44 = _1; + StorageLive(_45); + _45 = _2; - _43 = Shr(move _44, move _45); -- StorageDead(_45); -- StorageDead(_44); -- _42 = opaque::<u64>(move _43) -> [return: bb12, unwind unreachable]; + _43 = Shr(_1, _2); + StorageDead(_45); + StorageDead(_44); +- _42 = opaque::<u64>(move _43) -> [return: bb12, unwind unreachable]; + _42 = opaque::<u64>(_43) -> [return: bb12, unwind unreachable]; } bb12: { - StorageDead(_43); ++ nop; StorageDead(_42); StorageLive(_46); StorageLive(_47); -- StorageLive(_48); -- _48 = _1; + StorageLive(_48); + _48 = _1; - _47 = move _48 as u32 (IntToInt); -- StorageDead(_48); + _47 = _1 as u32 (IntToInt); + StorageDead(_48); _46 = opaque::<u32>(move _47) -> [return: bb13, unwind unreachable]; } @@ -393,11 +414,11 @@ StorageDead(_46); StorageLive(_49); StorageLive(_50); -- StorageLive(_51); -- _51 = _1; + StorageLive(_51); + _51 = _1; - _50 = move _51 as f32 (IntToFloat); -- StorageDead(_51); + _50 = _1 as f32 (IntToFloat); + StorageDead(_51); _49 = opaque::<f32>(move _50) -> [return: bb14, unwind unreachable]; } @@ -406,25 +427,29 @@ StorageDead(_49); StorageLive(_52); - StorageLive(_53); -- StorageLive(_54); -- _54 = _1; ++ nop; + StorageLive(_54); + _54 = _1; - _53 = S::<u64>(move _54); -- StorageDead(_54); -- _52 = opaque::<S<u64>>(move _53) -> [return: bb15, unwind unreachable]; + _53 = S::<u64>(_1); + StorageDead(_54); +- _52 = opaque::<S<u64>>(move _53) -> [return: bb15, unwind unreachable]; + _52 = opaque::<S<u64>>(_53) -> [return: bb15, unwind unreachable]; } bb15: { - StorageDead(_53); ++ nop; StorageDead(_52); StorageLive(_55); - StorageLive(_56); -- StorageLive(_57); -- StorageLive(_58); -- _58 = _1; ++ nop; + StorageLive(_57); + StorageLive(_58); + _58 = _1; - _57 = S::<u64>(move _58); -- StorageDead(_58); ++ _57 = _53; + StorageDead(_58); - _56 = (_57.0: u64); - _55 = opaque::<u64>(move _56) -> [return: bb16, unwind unreachable]; + _56 = (_53.0: u64); @@ -433,24 +458,26 @@ bb16: { - StorageDead(_56); -- StorageDead(_57); ++ nop; + StorageDead(_57); StorageDead(_55); StorageLive(_59); StorageLive(_60); -- StorageLive(_61); -- StorageLive(_62); -- _62 = _1; -- StorageLive(_63); -- _63 = _2; + StorageLive(_61); + StorageLive(_62); + _62 = _1; + StorageLive(_63); + _63 = _2; - _61 = Add(move _62, move _63); -- StorageDead(_63); -- StorageDead(_62); ++ _61 = _5; + StorageDead(_63); + StorageDead(_62); StorageLive(_64); _64 = _3; - _60 = Add(move _61, move _64); + _60 = Add(_5, move _64); StorageDead(_64); -- StorageDead(_61); + StorageDead(_61); _59 = opaque::<u64>(move _60) -> [return: bb17, unwind unreachable]; } @@ -459,20 +486,21 @@ StorageDead(_59); StorageLive(_65); StorageLive(_66); -- StorageLive(_67); -- StorageLive(_68); -- _68 = _1; -- StorageLive(_69); -- _69 = _2; + StorageLive(_67); + StorageLive(_68); + _68 = _1; + StorageLive(_69); + _69 = _2; - _67 = Mul(move _68, move _69); -- StorageDead(_69); -- StorageDead(_68); ++ _67 = _9; + StorageDead(_69); + StorageDead(_68); StorageLive(_70); _70 = _3; - _66 = Add(move _67, move _70); + _66 = Add(_9, move _70); StorageDead(_70); -- StorageDead(_67); + StorageDead(_67); _65 = opaque::<u64>(move _66) -> [return: bb18, unwind unreachable]; } @@ -481,20 +509,21 @@ StorageDead(_65); StorageLive(_71); StorageLive(_72); -- StorageLive(_73); -- StorageLive(_74); -- _74 = _1; -- StorageLive(_75); -- _75 = _2; + StorageLive(_73); + StorageLive(_74); + _74 = _1; + StorageLive(_75); + _75 = _2; - _73 = Sub(move _74, move _75); -- StorageDead(_75); -- StorageDead(_74); ++ _73 = _13; + StorageDead(_75); + StorageDead(_74); StorageLive(_76); _76 = _3; - _72 = Add(move _73, move _76); + _72 = Add(_13, move _76); StorageDead(_76); -- StorageDead(_73); + StorageDead(_73); _71 = opaque::<u64>(move _72) -> [return: bb19, unwind unreachable]; } @@ -503,26 +532,28 @@ StorageDead(_71); StorageLive(_77); StorageLive(_78); -- StorageLive(_79); -- StorageLive(_80); -- _80 = _1; -- StorageLive(_81); -- _81 = _2; + StorageLive(_79); + StorageLive(_80); + _80 = _1; + StorageLive(_81); + _81 = _2; - _82 = Eq(_81, const 0_u64); - assert(!move _82, "attempt to divide `{}` by zero", _80) -> [success: bb20, unwind unreachable]; ++ _82 = _20; + assert(!_20, "attempt to divide `{}` by zero", _1) -> [success: bb20, unwind unreachable]; } bb20: { - _79 = Div(move _80, move _81); -- StorageDead(_81); -- StorageDead(_80); ++ _79 = _17; + StorageDead(_81); + StorageDead(_80); StorageLive(_83); _83 = _3; - _78 = Add(move _79, move _83); + _78 = Add(_17, move _83); StorageDead(_83); -- StorageDead(_79); + StorageDead(_79); _77 = opaque::<u64>(move _78) -> [return: bb21, unwind unreachable]; } @@ -531,26 +562,28 @@ StorageDead(_77); StorageLive(_84); StorageLive(_85); -- StorageLive(_86); -- StorageLive(_87); -- _87 = _1; -- StorageLive(_88); -- _88 = _2; + StorageLive(_86); + StorageLive(_87); + _87 = _1; + StorageLive(_88); + _88 = _2; - _89 = Eq(_88, const 0_u64); - assert(!move _89, "attempt to calculate the remainder of `{}` with a divisor of zero", _87) -> [success: bb22, unwind unreachable]; ++ _89 = _20; + assert(!_20, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb22, unwind unreachable]; } bb22: { - _86 = Rem(move _87, move _88); -- StorageDead(_88); -- StorageDead(_87); ++ _86 = _22; + StorageDead(_88); + StorageDead(_87); StorageLive(_90); _90 = _3; - _85 = Add(move _86, move _90); + _85 = Add(_22, move _90); StorageDead(_90); -- StorageDead(_86); + StorageDead(_86); _84 = opaque::<u64>(move _85) -> [return: bb23, unwind unreachable]; } @@ -559,20 +592,21 @@ StorageDead(_84); StorageLive(_91); StorageLive(_92); -- StorageLive(_93); -- StorageLive(_94); -- _94 = _1; -- StorageLive(_95); -- _95 = _2; + StorageLive(_93); + StorageLive(_94); + _94 = _1; + StorageLive(_95); + _95 = _2; - _93 = BitAnd(move _94, move _95); -- StorageDead(_95); -- StorageDead(_94); ++ _93 = _27; + StorageDead(_95); + StorageDead(_94); StorageLive(_96); _96 = _3; - _92 = Add(move _93, move _96); + _92 = Add(_27, move _96); StorageDead(_96); -- StorageDead(_93); + StorageDead(_93); _91 = opaque::<u64>(move _92) -> [return: bb24, unwind unreachable]; } @@ -581,20 +615,21 @@ StorageDead(_91); StorageLive(_97); StorageLive(_98); -- StorageLive(_99); -- StorageLive(_100); -- _100 = _1; -- StorageLive(_101); -- _101 = _2; + StorageLive(_99); + StorageLive(_100); + _100 = _1; + StorageLive(_101); + _101 = _2; - _99 = BitOr(move _100, move _101); -- StorageDead(_101); -- StorageDead(_100); ++ _99 = _31; + StorageDead(_101); + StorageDead(_100); StorageLive(_102); _102 = _3; - _98 = Add(move _99, move _102); + _98 = Add(_31, move _102); StorageDead(_102); -- StorageDead(_99); + StorageDead(_99); _97 = opaque::<u64>(move _98) -> [return: bb25, unwind unreachable]; } @@ -603,20 +638,21 @@ StorageDead(_97); StorageLive(_103); StorageLive(_104); -- StorageLive(_105); -- StorageLive(_106); -- _106 = _1; -- StorageLive(_107); -- _107 = _2; + StorageLive(_105); + StorageLive(_106); + _106 = _1; + StorageLive(_107); + _107 = _2; - _105 = BitXor(move _106, move _107); -- StorageDead(_107); -- StorageDead(_106); ++ _105 = _35; + StorageDead(_107); + StorageDead(_106); StorageLive(_108); _108 = _3; - _104 = Add(move _105, move _108); + _104 = Add(_35, move _108); StorageDead(_108); -- StorageDead(_105); + StorageDead(_105); _103 = opaque::<u64>(move _104) -> [return: bb26, unwind unreachable]; } @@ -625,20 +661,21 @@ StorageDead(_103); StorageLive(_109); StorageLive(_110); -- StorageLive(_111); -- StorageLive(_112); -- _112 = _1; -- StorageLive(_113); -- _113 = _2; + StorageLive(_111); + StorageLive(_112); + _112 = _1; + StorageLive(_113); + _113 = _2; - _111 = Shl(move _112, move _113); -- StorageDead(_113); -- StorageDead(_112); ++ _111 = _39; + StorageDead(_113); + StorageDead(_112); StorageLive(_114); _114 = _3; - _110 = Add(move _111, move _114); + _110 = Add(_39, move _114); StorageDead(_114); -- StorageDead(_111); + StorageDead(_111); _109 = opaque::<u64>(move _110) -> [return: bb27, unwind unreachable]; } @@ -647,20 +684,21 @@ StorageDead(_109); StorageLive(_115); StorageLive(_116); -- StorageLive(_117); -- StorageLive(_118); -- _118 = _1; -- StorageLive(_119); -- _119 = _2; + StorageLive(_117); + StorageLive(_118); + _118 = _1; + StorageLive(_119); + _119 = _2; - _117 = Shr(move _118, move _119); -- StorageDead(_119); -- StorageDead(_118); ++ _117 = _43; + StorageDead(_119); + StorageDead(_118); StorageLive(_120); _120 = _3; - _116 = Add(move _117, move _120); + _116 = Add(_43, move _120); StorageDead(_120); -- StorageDead(_117); + StorageDead(_117); _115 = opaque::<u64>(move _116) -> [return: bb28, unwind unreachable]; } @@ -668,68 +706,77 @@ StorageDead(_116); StorageDead(_115); StorageLive(_121); -- StorageLive(_122); -- StorageLive(_123); -- _123 = _1; + StorageLive(_122); + StorageLive(_123); + _123 = _1; - _122 = S::<u64>(move _123); -- StorageDead(_123); ++ _122 = _53; + StorageDead(_123); - _121 = opaque::<S<u64>>(move _122) -> [return: bb29, unwind unreachable]; + _121 = opaque::<S<u64>>(_53) -> [return: bb29, unwind unreachable]; } bb29: { -- StorageDead(_122); + StorageDead(_122); StorageDead(_121); StorageLive(_124); -- StorageLive(_125); -- StorageLive(_126); -- StorageLive(_127); -- _127 = _1; + StorageLive(_125); + StorageLive(_126); + StorageLive(_127); + _127 = _1; - _126 = S::<u64>(move _127); -- StorageDead(_127); ++ _126 = _53; + StorageDead(_127); - _125 = (_126.0: u64); - _124 = opaque::<u64>(move _125) -> [return: bb30, unwind unreachable]; ++ _125 = _56; + _124 = opaque::<u64>(_56) -> [return: bb30, unwind unreachable]; } bb30: { -- StorageDead(_125); -- StorageDead(_126); + StorageDead(_125); + StorageDead(_126); StorageDead(_124); StorageLive(_128); _128 = &_3; StorageLive(_129); - StorageLive(_130); - StorageLive(_131); ++ nop; ++ nop; _131 = (*_128); -- StorageLive(_132); -- _132 = _1; + StorageLive(_132); + _132 = _1; - _130 = Add(move _131, move _132); -- StorageDead(_132); ++ _130 = Add(_131, _1); + StorageDead(_132); - StorageDead(_131); - _129 = opaque::<u64>(move _130) -> [return: bb31, unwind unreachable]; -+ _130 = Add(_131, _1); ++ nop; + _129 = opaque::<u64>(_130) -> [return: bb31, unwind unreachable]; } bb31: { - StorageDead(_130); ++ nop; StorageDead(_129); StorageLive(_133); -- StorageLive(_134); -- StorageLive(_135); + StorageLive(_134); + StorageLive(_135); - _135 = (*_128); -- StorageLive(_136); -- _136 = _1; ++ _135 = _131; + StorageLive(_136); + _136 = _1; - _134 = Add(move _135, move _136); -- StorageDead(_136); -- StorageDead(_135); ++ _134 = _130; + StorageDead(_136); + StorageDead(_135); - _133 = opaque::<u64>(move _134) -> [return: bb32, unwind unreachable]; + _133 = opaque::<u64>(_130) -> [return: bb32, unwind unreachable]; } bb32: { -- StorageDead(_134); + StorageDead(_134); StorageDead(_133); StorageLive(_137); _137 = &mut _3; @@ -737,11 +784,11 @@ StorageLive(_139); StorageLive(_140); _140 = (*_137); -- StorageLive(_141); -- _141 = _1; + StorageLive(_141); + _141 = _1; - _139 = Add(move _140, move _141); -- StorageDead(_141); + _139 = Add(move _140, _1); + StorageDead(_141); StorageDead(_140); _138 = opaque::<u64>(move _139) -> [return: bb33, unwind unreachable]; } @@ -753,11 +800,11 @@ StorageLive(_143); StorageLive(_144); _144 = (*_137); -- StorageLive(_145); -- _145 = _1; + StorageLive(_145); + _145 = _1; - _143 = Add(move _144, move _145); -- StorageDead(_145); + _143 = Add(move _144, _1); + StorageDead(_145); StorageDead(_144); _142 = opaque::<u64>(move _143) -> [return: bb34, unwind unreachable]; } @@ -765,18 +812,18 @@ bb34: { StorageDead(_143); StorageDead(_142); -- StorageLive(_146); + StorageLive(_146); StorageLive(_147); _147 = &raw const _3; StorageLive(_148); StorageLive(_149); StorageLive(_150); _150 = (*_147); -- StorageLive(_151); -- _151 = _1; + StorageLive(_151); + _151 = _1; - _149 = Add(move _150, move _151); -- StorageDead(_151); + _149 = Add(move _150, _1); + StorageDead(_151); StorageDead(_150); _148 = opaque::<u64>(move _149) -> [return: bb35, unwind unreachable]; } @@ -788,11 +835,11 @@ StorageLive(_153); StorageLive(_154); _154 = (*_147); -- StorageLive(_155); -- _155 = _1; + StorageLive(_155); + _155 = _1; - _153 = Add(move _154, move _155); -- StorageDead(_155); + _153 = Add(move _154, _1); + StorageDead(_155); StorageDead(_154); _152 = opaque::<u64>(move _153) -> [return: bb36, unwind unreachable]; } @@ -806,11 +853,11 @@ StorageLive(_158); StorageLive(_159); _159 = (*_156); -- StorageLive(_160); -- _160 = _1; + StorageLive(_160); + _160 = _1; - _158 = Add(move _159, move _160); -- StorageDead(_160); + _158 = Add(move _159, _1); + StorageDead(_160); StorageDead(_159); _157 = opaque::<u64>(move _158) -> [return: bb37, unwind unreachable]; } @@ -822,11 +869,11 @@ StorageLive(_162); StorageLive(_163); _163 = (*_156); -- StorageLive(_164); -- _164 = _1; + StorageLive(_164); + _164 = _1; - _162 = Add(move _163, move _164); -- StorageDead(_164); + _162 = Add(move _163, _1); + StorageDead(_164); StorageDead(_163); _161 = opaque::<u64>(move _162) -> [return: bb38, unwind unreachable]; } @@ -834,44 +881,50 @@ bb38: { StorageDead(_162); StorageDead(_161); -- _146 = const (); + _146 = const (); StorageDead(_156); StorageDead(_147); -- StorageDead(_146); + StorageDead(_146); StorageLive(_165); _165 = &_3; StorageLive(_166); - StorageLive(_167); - StorageLive(_168); ++ nop; ++ nop; _168 = (*_165); -- StorageLive(_169); -- _169 = _1; + StorageLive(_169); + _169 = _1; - _167 = Add(move _168, move _169); -- StorageDead(_169); ++ _167 = Add(_168, _1); + StorageDead(_169); - StorageDead(_168); - _166 = opaque::<u64>(move _167) -> [return: bb39, unwind unreachable]; -+ _167 = Add(_168, _1); ++ nop; + _166 = opaque::<u64>(_167) -> [return: bb39, unwind unreachable]; } bb39: { - StorageDead(_167); ++ nop; StorageDead(_166); StorageLive(_170); -- StorageLive(_171); -- StorageLive(_172); + StorageLive(_171); + StorageLive(_172); - _172 = (*_165); -- StorageLive(_173); -- _173 = _1; ++ _172 = _168; + StorageLive(_173); + _173 = _1; - _171 = Add(move _172, move _173); -- StorageDead(_173); -- StorageDead(_172); ++ _171 = _167; + StorageDead(_173); + StorageDead(_172); - _170 = opaque::<u64>(move _171) -> [return: bb40, unwind unreachable]; + _170 = opaque::<u64>(_167) -> [return: bb40, unwind unreachable]; } bb40: { -- StorageDead(_171); + StorageDead(_171); StorageDead(_170); _0 = const (); StorageDead(_165); diff --git a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff index 68b05290719..fb2c089827d 100644 --- a/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.subexpression_elimination.GVN.panic-unwind.diff @@ -197,61 +197,68 @@ bb0: { StorageLive(_4); - StorageLive(_5); -- StorageLive(_6); -- _6 = _1; -- StorageLive(_7); -- _7 = _2; ++ nop; + StorageLive(_6); + _6 = _1; + StorageLive(_7); + _7 = _2; - _5 = Add(move _6, move _7); -- StorageDead(_7); -- StorageDead(_6); -- _4 = opaque::<u64>(move _5) -> [return: bb1, unwind continue]; + _5 = Add(_1, _2); + StorageDead(_7); + StorageDead(_6); +- _4 = opaque::<u64>(move _5) -> [return: bb1, unwind continue]; + _4 = opaque::<u64>(_5) -> [return: bb1, unwind continue]; } bb1: { - StorageDead(_5); ++ nop; StorageDead(_4); StorageLive(_8); - StorageLive(_9); -- StorageLive(_10); -- _10 = _1; -- StorageLive(_11); -- _11 = _2; ++ nop; + StorageLive(_10); + _10 = _1; + StorageLive(_11); + _11 = _2; - _9 = Mul(move _10, move _11); -- StorageDead(_11); -- StorageDead(_10); -- _8 = opaque::<u64>(move _9) -> [return: bb2, unwind continue]; + _9 = Mul(_1, _2); + StorageDead(_11); + StorageDead(_10); +- _8 = opaque::<u64>(move _9) -> [return: bb2, unwind continue]; + _8 = opaque::<u64>(_9) -> [return: bb2, unwind continue]; } bb2: { - StorageDead(_9); ++ nop; StorageDead(_8); StorageLive(_12); - StorageLive(_13); -- StorageLive(_14); -- _14 = _1; -- StorageLive(_15); -- _15 = _2; ++ nop; + StorageLive(_14); + _14 = _1; + StorageLive(_15); + _15 = _2; - _13 = Sub(move _14, move _15); -- StorageDead(_15); -- StorageDead(_14); -- _12 = opaque::<u64>(move _13) -> [return: bb3, unwind continue]; + _13 = Sub(_1, _2); + StorageDead(_15); + StorageDead(_14); +- _12 = opaque::<u64>(move _13) -> [return: bb3, unwind continue]; + _12 = opaque::<u64>(_13) -> [return: bb3, unwind continue]; } bb3: { - StorageDead(_13); ++ nop; StorageDead(_12); StorageLive(_16); - StorageLive(_17); -- StorageLive(_18); -- _18 = _1; -- StorageLive(_19); -- _19 = _2; ++ nop; + StorageLive(_18); + _18 = _1; + StorageLive(_19); + _19 = _2; - _20 = Eq(_19, const 0_u64); - assert(!move _20, "attempt to divide `{}` by zero", _18) -> [success: bb4, unwind continue]; + _20 = Eq(_2, const 0_u64); @@ -260,131 +267,145 @@ bb4: { - _17 = Div(move _18, move _19); -- StorageDead(_19); -- StorageDead(_18); -- _16 = opaque::<u64>(move _17) -> [return: bb5, unwind continue]; + _17 = Div(_1, _2); + StorageDead(_19); + StorageDead(_18); +- _16 = opaque::<u64>(move _17) -> [return: bb5, unwind continue]; + _16 = opaque::<u64>(_17) -> [return: bb5, unwind continue]; } bb5: { - StorageDead(_17); ++ nop; StorageDead(_16); StorageLive(_21); - StorageLive(_22); -- StorageLive(_23); -- _23 = _1; -- StorageLive(_24); -- _24 = _2; ++ nop; + StorageLive(_23); + _23 = _1; + StorageLive(_24); + _24 = _2; - _25 = Eq(_24, const 0_u64); - assert(!move _25, "attempt to calculate the remainder of `{}` with a divisor of zero", _23) -> [success: bb6, unwind continue]; ++ _25 = _20; + assert(!_20, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb6, unwind continue]; } bb6: { - _22 = Rem(move _23, move _24); -- StorageDead(_24); -- StorageDead(_23); -- _21 = opaque::<u64>(move _22) -> [return: bb7, unwind continue]; + _22 = Rem(_1, _2); + StorageDead(_24); + StorageDead(_23); +- _21 = opaque::<u64>(move _22) -> [return: bb7, unwind continue]; + _21 = opaque::<u64>(_22) -> [return: bb7, unwind continue]; } bb7: { - StorageDead(_22); ++ nop; StorageDead(_21); StorageLive(_26); - StorageLive(_27); -- StorageLive(_28); -- _28 = _1; -- StorageLive(_29); -- _29 = _2; ++ nop; + StorageLive(_28); + _28 = _1; + StorageLive(_29); + _29 = _2; - _27 = BitAnd(move _28, move _29); -- StorageDead(_29); -- StorageDead(_28); -- _26 = opaque::<u64>(move _27) -> [return: bb8, unwind continue]; + _27 = BitAnd(_1, _2); + StorageDead(_29); + StorageDead(_28); +- _26 = opaque::<u64>(move _27) -> [return: bb8, unwind continue]; + _26 = opaque::<u64>(_27) -> [return: bb8, unwind continue]; } bb8: { - StorageDead(_27); ++ nop; StorageDead(_26); StorageLive(_30); - StorageLive(_31); -- StorageLive(_32); -- _32 = _1; -- StorageLive(_33); -- _33 = _2; ++ nop; + StorageLive(_32); + _32 = _1; + StorageLive(_33); + _33 = _2; - _31 = BitOr(move _32, move _33); -- StorageDead(_33); -- StorageDead(_32); -- _30 = opaque::<u64>(move _31) -> [return: bb9, unwind continue]; + _31 = BitOr(_1, _2); + StorageDead(_33); + StorageDead(_32); +- _30 = opaque::<u64>(move _31) -> [return: bb9, unwind continue]; + _30 = opaque::<u64>(_31) -> [return: bb9, unwind continue]; } bb9: { - StorageDead(_31); ++ nop; StorageDead(_30); StorageLive(_34); - StorageLive(_35); -- StorageLive(_36); -- _36 = _1; -- StorageLive(_37); -- _37 = _2; ++ nop; + StorageLive(_36); + _36 = _1; + StorageLive(_37); + _37 = _2; - _35 = BitXor(move _36, move _37); -- StorageDead(_37); -- StorageDead(_36); -- _34 = opaque::<u64>(move _35) -> [return: bb10, unwind continue]; + _35 = BitXor(_1, _2); + StorageDead(_37); + StorageDead(_36); +- _34 = opaque::<u64>(move _35) -> [return: bb10, unwind continue]; + _34 = opaque::<u64>(_35) -> [return: bb10, unwind continue]; } bb10: { - StorageDead(_35); ++ nop; StorageDead(_34); StorageLive(_38); - StorageLive(_39); -- StorageLive(_40); -- _40 = _1; -- StorageLive(_41); -- _41 = _2; ++ nop; + StorageLive(_40); + _40 = _1; + StorageLive(_41); + _41 = _2; - _39 = Shl(move _40, move _41); -- StorageDead(_41); -- StorageDead(_40); -- _38 = opaque::<u64>(move _39) -> [return: bb11, unwind continue]; + _39 = Shl(_1, _2); + StorageDead(_41); + StorageDead(_40); +- _38 = opaque::<u64>(move _39) -> [return: bb11, unwind continue]; + _38 = opaque::<u64>(_39) -> [return: bb11, unwind continue]; } bb11: { - StorageDead(_39); ++ nop; StorageDead(_38); StorageLive(_42); - StorageLive(_43); -- StorageLive(_44); -- _44 = _1; -- StorageLive(_45); -- _45 = _2; ++ nop; + StorageLive(_44); + _44 = _1; + StorageLive(_45); + _45 = _2; - _43 = Shr(move _44, move _45); -- StorageDead(_45); -- StorageDead(_44); -- _42 = opaque::<u64>(move _43) -> [return: bb12, unwind continue]; + _43 = Shr(_1, _2); + StorageDead(_45); + StorageDead(_44); +- _42 = opaque::<u64>(move _43) -> [return: bb12, unwind continue]; + _42 = opaque::<u64>(_43) -> [return: bb12, unwind continue]; } bb12: { - StorageDead(_43); ++ nop; StorageDead(_42); StorageLive(_46); StorageLive(_47); -- StorageLive(_48); -- _48 = _1; + StorageLive(_48); + _48 = _1; - _47 = move _48 as u32 (IntToInt); -- StorageDead(_48); + _47 = _1 as u32 (IntToInt); + StorageDead(_48); _46 = opaque::<u32>(move _47) -> [return: bb13, unwind continue]; } @@ -393,11 +414,11 @@ StorageDead(_46); StorageLive(_49); StorageLive(_50); -- StorageLive(_51); -- _51 = _1; + StorageLive(_51); + _51 = _1; - _50 = move _51 as f32 (IntToFloat); -- StorageDead(_51); + _50 = _1 as f32 (IntToFloat); + StorageDead(_51); _49 = opaque::<f32>(move _50) -> [return: bb14, unwind continue]; } @@ -406,25 +427,29 @@ StorageDead(_49); StorageLive(_52); - StorageLive(_53); -- StorageLive(_54); -- _54 = _1; ++ nop; + StorageLive(_54); + _54 = _1; - _53 = S::<u64>(move _54); -- StorageDead(_54); -- _52 = opaque::<S<u64>>(move _53) -> [return: bb15, unwind continue]; + _53 = S::<u64>(_1); + StorageDead(_54); +- _52 = opaque::<S<u64>>(move _53) -> [return: bb15, unwind continue]; + _52 = opaque::<S<u64>>(_53) -> [return: bb15, unwind continue]; } bb15: { - StorageDead(_53); ++ nop; StorageDead(_52); StorageLive(_55); - StorageLive(_56); -- StorageLive(_57); -- StorageLive(_58); -- _58 = _1; ++ nop; + StorageLive(_57); + StorageLive(_58); + _58 = _1; - _57 = S::<u64>(move _58); -- StorageDead(_58); ++ _57 = _53; + StorageDead(_58); - _56 = (_57.0: u64); - _55 = opaque::<u64>(move _56) -> [return: bb16, unwind continue]; + _56 = (_53.0: u64); @@ -433,24 +458,26 @@ bb16: { - StorageDead(_56); -- StorageDead(_57); ++ nop; + StorageDead(_57); StorageDead(_55); StorageLive(_59); StorageLive(_60); -- StorageLive(_61); -- StorageLive(_62); -- _62 = _1; -- StorageLive(_63); -- _63 = _2; + StorageLive(_61); + StorageLive(_62); + _62 = _1; + StorageLive(_63); + _63 = _2; - _61 = Add(move _62, move _63); -- StorageDead(_63); -- StorageDead(_62); ++ _61 = _5; + StorageDead(_63); + StorageDead(_62); StorageLive(_64); _64 = _3; - _60 = Add(move _61, move _64); + _60 = Add(_5, move _64); StorageDead(_64); -- StorageDead(_61); + StorageDead(_61); _59 = opaque::<u64>(move _60) -> [return: bb17, unwind continue]; } @@ -459,20 +486,21 @@ StorageDead(_59); StorageLive(_65); StorageLive(_66); -- StorageLive(_67); -- StorageLive(_68); -- _68 = _1; -- StorageLive(_69); -- _69 = _2; + StorageLive(_67); + StorageLive(_68); + _68 = _1; + StorageLive(_69); + _69 = _2; - _67 = Mul(move _68, move _69); -- StorageDead(_69); -- StorageDead(_68); ++ _67 = _9; + StorageDead(_69); + StorageDead(_68); StorageLive(_70); _70 = _3; - _66 = Add(move _67, move _70); + _66 = Add(_9, move _70); StorageDead(_70); -- StorageDead(_67); + StorageDead(_67); _65 = opaque::<u64>(move _66) -> [return: bb18, unwind continue]; } @@ -481,20 +509,21 @@ StorageDead(_65); StorageLive(_71); StorageLive(_72); -- StorageLive(_73); -- StorageLive(_74); -- _74 = _1; -- StorageLive(_75); -- _75 = _2; + StorageLive(_73); + StorageLive(_74); + _74 = _1; + StorageLive(_75); + _75 = _2; - _73 = Sub(move _74, move _75); -- StorageDead(_75); -- StorageDead(_74); ++ _73 = _13; + StorageDead(_75); + StorageDead(_74); StorageLive(_76); _76 = _3; - _72 = Add(move _73, move _76); + _72 = Add(_13, move _76); StorageDead(_76); -- StorageDead(_73); + StorageDead(_73); _71 = opaque::<u64>(move _72) -> [return: bb19, unwind continue]; } @@ -503,26 +532,28 @@ StorageDead(_71); StorageLive(_77); StorageLive(_78); -- StorageLive(_79); -- StorageLive(_80); -- _80 = _1; -- StorageLive(_81); -- _81 = _2; + StorageLive(_79); + StorageLive(_80); + _80 = _1; + StorageLive(_81); + _81 = _2; - _82 = Eq(_81, const 0_u64); - assert(!move _82, "attempt to divide `{}` by zero", _80) -> [success: bb20, unwind continue]; ++ _82 = _20; + assert(!_20, "attempt to divide `{}` by zero", _1) -> [success: bb20, unwind continue]; } bb20: { - _79 = Div(move _80, move _81); -- StorageDead(_81); -- StorageDead(_80); ++ _79 = _17; + StorageDead(_81); + StorageDead(_80); StorageLive(_83); _83 = _3; - _78 = Add(move _79, move _83); + _78 = Add(_17, move _83); StorageDead(_83); -- StorageDead(_79); + StorageDead(_79); _77 = opaque::<u64>(move _78) -> [return: bb21, unwind continue]; } @@ -531,26 +562,28 @@ StorageDead(_77); StorageLive(_84); StorageLive(_85); -- StorageLive(_86); -- StorageLive(_87); -- _87 = _1; -- StorageLive(_88); -- _88 = _2; + StorageLive(_86); + StorageLive(_87); + _87 = _1; + StorageLive(_88); + _88 = _2; - _89 = Eq(_88, const 0_u64); - assert(!move _89, "attempt to calculate the remainder of `{}` with a divisor of zero", _87) -> [success: bb22, unwind continue]; ++ _89 = _20; + assert(!_20, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb22, unwind continue]; } bb22: { - _86 = Rem(move _87, move _88); -- StorageDead(_88); -- StorageDead(_87); ++ _86 = _22; + StorageDead(_88); + StorageDead(_87); StorageLive(_90); _90 = _3; - _85 = Add(move _86, move _90); + _85 = Add(_22, move _90); StorageDead(_90); -- StorageDead(_86); + StorageDead(_86); _84 = opaque::<u64>(move _85) -> [return: bb23, unwind continue]; } @@ -559,20 +592,21 @@ StorageDead(_84); StorageLive(_91); StorageLive(_92); -- StorageLive(_93); -- StorageLive(_94); -- _94 = _1; -- StorageLive(_95); -- _95 = _2; + StorageLive(_93); + StorageLive(_94); + _94 = _1; + StorageLive(_95); + _95 = _2; - _93 = BitAnd(move _94, move _95); -- StorageDead(_95); -- StorageDead(_94); ++ _93 = _27; + StorageDead(_95); + StorageDead(_94); StorageLive(_96); _96 = _3; - _92 = Add(move _93, move _96); + _92 = Add(_27, move _96); StorageDead(_96); -- StorageDead(_93); + StorageDead(_93); _91 = opaque::<u64>(move _92) -> [return: bb24, unwind continue]; } @@ -581,20 +615,21 @@ StorageDead(_91); StorageLive(_97); StorageLive(_98); -- StorageLive(_99); -- StorageLive(_100); -- _100 = _1; -- StorageLive(_101); -- _101 = _2; + StorageLive(_99); + StorageLive(_100); + _100 = _1; + StorageLive(_101); + _101 = _2; - _99 = BitOr(move _100, move _101); -- StorageDead(_101); -- StorageDead(_100); ++ _99 = _31; + StorageDead(_101); + StorageDead(_100); StorageLive(_102); _102 = _3; - _98 = Add(move _99, move _102); + _98 = Add(_31, move _102); StorageDead(_102); -- StorageDead(_99); + StorageDead(_99); _97 = opaque::<u64>(move _98) -> [return: bb25, unwind continue]; } @@ -603,20 +638,21 @@ StorageDead(_97); StorageLive(_103); StorageLive(_104); -- StorageLive(_105); -- StorageLive(_106); -- _106 = _1; -- StorageLive(_107); -- _107 = _2; + StorageLive(_105); + StorageLive(_106); + _106 = _1; + StorageLive(_107); + _107 = _2; - _105 = BitXor(move _106, move _107); -- StorageDead(_107); -- StorageDead(_106); ++ _105 = _35; + StorageDead(_107); + StorageDead(_106); StorageLive(_108); _108 = _3; - _104 = Add(move _105, move _108); + _104 = Add(_35, move _108); StorageDead(_108); -- StorageDead(_105); + StorageDead(_105); _103 = opaque::<u64>(move _104) -> [return: bb26, unwind continue]; } @@ -625,20 +661,21 @@ StorageDead(_103); StorageLive(_109); StorageLive(_110); -- StorageLive(_111); -- StorageLive(_112); -- _112 = _1; -- StorageLive(_113); -- _113 = _2; + StorageLive(_111); + StorageLive(_112); + _112 = _1; + StorageLive(_113); + _113 = _2; - _111 = Shl(move _112, move _113); -- StorageDead(_113); -- StorageDead(_112); ++ _111 = _39; + StorageDead(_113); + StorageDead(_112); StorageLive(_114); _114 = _3; - _110 = Add(move _111, move _114); + _110 = Add(_39, move _114); StorageDead(_114); -- StorageDead(_111); + StorageDead(_111); _109 = opaque::<u64>(move _110) -> [return: bb27, unwind continue]; } @@ -647,20 +684,21 @@ StorageDead(_109); StorageLive(_115); StorageLive(_116); -- StorageLive(_117); -- StorageLive(_118); -- _118 = _1; -- StorageLive(_119); -- _119 = _2; + StorageLive(_117); + StorageLive(_118); + _118 = _1; + StorageLive(_119); + _119 = _2; - _117 = Shr(move _118, move _119); -- StorageDead(_119); -- StorageDead(_118); ++ _117 = _43; + StorageDead(_119); + StorageDead(_118); StorageLive(_120); _120 = _3; - _116 = Add(move _117, move _120); + _116 = Add(_43, move _120); StorageDead(_120); -- StorageDead(_117); + StorageDead(_117); _115 = opaque::<u64>(move _116) -> [return: bb28, unwind continue]; } @@ -668,68 +706,77 @@ StorageDead(_116); StorageDead(_115); StorageLive(_121); -- StorageLive(_122); -- StorageLive(_123); -- _123 = _1; + StorageLive(_122); + StorageLive(_123); + _123 = _1; - _122 = S::<u64>(move _123); -- StorageDead(_123); ++ _122 = _53; + StorageDead(_123); - _121 = opaque::<S<u64>>(move _122) -> [return: bb29, unwind continue]; + _121 = opaque::<S<u64>>(_53) -> [return: bb29, unwind continue]; } bb29: { -- StorageDead(_122); + StorageDead(_122); StorageDead(_121); StorageLive(_124); -- StorageLive(_125); -- StorageLive(_126); -- StorageLive(_127); -- _127 = _1; + StorageLive(_125); + StorageLive(_126); + StorageLive(_127); + _127 = _1; - _126 = S::<u64>(move _127); -- StorageDead(_127); ++ _126 = _53; + StorageDead(_127); - _125 = (_126.0: u64); - _124 = opaque::<u64>(move _125) -> [return: bb30, unwind continue]; ++ _125 = _56; + _124 = opaque::<u64>(_56) -> [return: bb30, unwind continue]; } bb30: { -- StorageDead(_125); -- StorageDead(_126); + StorageDead(_125); + StorageDead(_126); StorageDead(_124); StorageLive(_128); _128 = &_3; StorageLive(_129); - StorageLive(_130); - StorageLive(_131); ++ nop; ++ nop; _131 = (*_128); -- StorageLive(_132); -- _132 = _1; + StorageLive(_132); + _132 = _1; - _130 = Add(move _131, move _132); -- StorageDead(_132); ++ _130 = Add(_131, _1); + StorageDead(_132); - StorageDead(_131); - _129 = opaque::<u64>(move _130) -> [return: bb31, unwind continue]; -+ _130 = Add(_131, _1); ++ nop; + _129 = opaque::<u64>(_130) -> [return: bb31, unwind continue]; } bb31: { - StorageDead(_130); ++ nop; StorageDead(_129); StorageLive(_133); -- StorageLive(_134); -- StorageLive(_135); + StorageLive(_134); + StorageLive(_135); - _135 = (*_128); -- StorageLive(_136); -- _136 = _1; ++ _135 = _131; + StorageLive(_136); + _136 = _1; - _134 = Add(move _135, move _136); -- StorageDead(_136); -- StorageDead(_135); ++ _134 = _130; + StorageDead(_136); + StorageDead(_135); - _133 = opaque::<u64>(move _134) -> [return: bb32, unwind continue]; + _133 = opaque::<u64>(_130) -> [return: bb32, unwind continue]; } bb32: { -- StorageDead(_134); + StorageDead(_134); StorageDead(_133); StorageLive(_137); _137 = &mut _3; @@ -737,11 +784,11 @@ StorageLive(_139); StorageLive(_140); _140 = (*_137); -- StorageLive(_141); -- _141 = _1; + StorageLive(_141); + _141 = _1; - _139 = Add(move _140, move _141); -- StorageDead(_141); + _139 = Add(move _140, _1); + StorageDead(_141); StorageDead(_140); _138 = opaque::<u64>(move _139) -> [return: bb33, unwind continue]; } @@ -753,11 +800,11 @@ StorageLive(_143); StorageLive(_144); _144 = (*_137); -- StorageLive(_145); -- _145 = _1; + StorageLive(_145); + _145 = _1; - _143 = Add(move _144, move _145); -- StorageDead(_145); + _143 = Add(move _144, _1); + StorageDead(_145); StorageDead(_144); _142 = opaque::<u64>(move _143) -> [return: bb34, unwind continue]; } @@ -765,18 +812,18 @@ bb34: { StorageDead(_143); StorageDead(_142); -- StorageLive(_146); + StorageLive(_146); StorageLive(_147); _147 = &raw const _3; StorageLive(_148); StorageLive(_149); StorageLive(_150); _150 = (*_147); -- StorageLive(_151); -- _151 = _1; + StorageLive(_151); + _151 = _1; - _149 = Add(move _150, move _151); -- StorageDead(_151); + _149 = Add(move _150, _1); + StorageDead(_151); StorageDead(_150); _148 = opaque::<u64>(move _149) -> [return: bb35, unwind continue]; } @@ -788,11 +835,11 @@ StorageLive(_153); StorageLive(_154); _154 = (*_147); -- StorageLive(_155); -- _155 = _1; + StorageLive(_155); + _155 = _1; - _153 = Add(move _154, move _155); -- StorageDead(_155); + _153 = Add(move _154, _1); + StorageDead(_155); StorageDead(_154); _152 = opaque::<u64>(move _153) -> [return: bb36, unwind continue]; } @@ -806,11 +853,11 @@ StorageLive(_158); StorageLive(_159); _159 = (*_156); -- StorageLive(_160); -- _160 = _1; + StorageLive(_160); + _160 = _1; - _158 = Add(move _159, move _160); -- StorageDead(_160); + _158 = Add(move _159, _1); + StorageDead(_160); StorageDead(_159); _157 = opaque::<u64>(move _158) -> [return: bb37, unwind continue]; } @@ -822,11 +869,11 @@ StorageLive(_162); StorageLive(_163); _163 = (*_156); -- StorageLive(_164); -- _164 = _1; + StorageLive(_164); + _164 = _1; - _162 = Add(move _163, move _164); -- StorageDead(_164); + _162 = Add(move _163, _1); + StorageDead(_164); StorageDead(_163); _161 = opaque::<u64>(move _162) -> [return: bb38, unwind continue]; } @@ -834,44 +881,50 @@ bb38: { StorageDead(_162); StorageDead(_161); -- _146 = const (); + _146 = const (); StorageDead(_156); StorageDead(_147); -- StorageDead(_146); + StorageDead(_146); StorageLive(_165); _165 = &_3; StorageLive(_166); - StorageLive(_167); - StorageLive(_168); ++ nop; ++ nop; _168 = (*_165); -- StorageLive(_169); -- _169 = _1; + StorageLive(_169); + _169 = _1; - _167 = Add(move _168, move _169); -- StorageDead(_169); ++ _167 = Add(_168, _1); + StorageDead(_169); - StorageDead(_168); - _166 = opaque::<u64>(move _167) -> [return: bb39, unwind continue]; -+ _167 = Add(_168, _1); ++ nop; + _166 = opaque::<u64>(_167) -> [return: bb39, unwind continue]; } bb39: { - StorageDead(_167); ++ nop; StorageDead(_166); StorageLive(_170); -- StorageLive(_171); -- StorageLive(_172); + StorageLive(_171); + StorageLive(_172); - _172 = (*_165); -- StorageLive(_173); -- _173 = _1; ++ _172 = _168; + StorageLive(_173); + _173 = _1; - _171 = Add(move _172, move _173); -- StorageDead(_173); -- StorageDead(_172); ++ _171 = _167; + StorageDead(_173); + StorageDead(_172); - _170 = opaque::<u64>(move _171) -> [return: bb40, unwind continue]; + _170 = opaque::<u64>(_167) -> [return: bb40, unwind continue]; } bb40: { -- StorageDead(_171); + StorageDead(_171); StorageDead(_170); _0 = const (); StorageDead(_165); diff --git a/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-abort.diff b/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-abort.diff index f33845502ad..2dd51934778 100644 --- a/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-abort.diff @@ -15,11 +15,11 @@ bb0: { StorageLive(_2); -- StorageLive(_3); -- _3 = _1; + StorageLive(_3); + _3 = _1; - _2 = Option::<T>::Some(move _3); -- StorageDead(_3); + _2 = Option::<T>::Some(_1); + StorageDead(_3); _4 = discriminant(_2); switchInt(move _4) -> [0: bb1, 1: bb3, otherwise: bb2]; } @@ -35,9 +35,11 @@ bb3: { - StorageLive(_5); ++ nop; _5 = ((_2 as Some).0: T); _0 = _5; - StorageDead(_5); ++ nop; StorageDead(_2); return; } diff --git a/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-unwind.diff b/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-unwind.diff index edc05f99fe2..610d70576c9 100644 --- a/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-unwind.diff @@ -15,11 +15,11 @@ bb0: { StorageLive(_2); -- StorageLive(_3); -- _3 = _1; + StorageLive(_3); + _3 = _1; - _2 = Option::<T>::Some(move _3); -- StorageDead(_3); + _2 = Option::<T>::Some(_1); + StorageDead(_3); _4 = discriminant(_2); switchInt(move _4) -> [0: bb1, 1: bb3, otherwise: bb2]; } @@ -35,9 +35,11 @@ bb3: { - StorageLive(_5); ++ nop; _5 = ((_2 as Some).0: T); _0 = _5; - StorageDead(_5); ++ nop; StorageDead(_2); return; } diff --git a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff index 9d8f272abea..b2539f391d1 100644 --- a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff +++ b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff @@ -7,22 +7,18 @@ let _2: &[T]; let mut _3: &[T; 3]; let _4: [T; 3]; - let mut _5: T; - let mut _6: T; - let mut _7: T; - let mut _8: usize; - let mut _9: usize; - let mut _10: bool; - let mut _14: !; + let mut _5: usize; + let mut _6: bool; + let mut _10: !; scope 1 { debug v => _2; - let _11: &T; - let _12: &T; - let _13: &T; + let _7: &T; + let _8: &T; + let _9: &T; scope 2 { - debug v1 => _11; - debug v2 => _12; - debug v3 => _13; + debug v1 => _7; + debug v2 => _8; + debug v3 => _9; } } @@ -33,26 +29,25 @@ _3 = &_4; _2 = move _3 as &[T] (PointerCoercion(Unsize)); StorageDead(_3); - _8 = const 3_usize; - _9 = const 3_usize; - _10 = const true; + _5 = const 3_usize; + _6 = const true; goto -> bb2; } bb1: { - _14 = core::panicking::panic(const "internal error: entered unreachable code") -> unwind unreachable; + _10 = core::panicking::panic(const "internal error: entered unreachable code") -> unwind unreachable; } bb2: { - StorageLive(_11); - _11 = &(*_2)[0 of 3]; - StorageLive(_12); - _12 = &(*_2)[1 of 3]; - StorageLive(_13); - _13 = &(*_2)[2 of 3]; - StorageDead(_13); - StorageDead(_12); - StorageDead(_11); + StorageLive(_7); + _7 = &(*_2)[0 of 3]; + StorageLive(_8); + _8 = &(*_2)[1 of 3]; + StorageLive(_9); + _9 = &(*_2)[2 of 3]; + StorageDead(_9); + StorageDead(_8); + StorageDead(_7); StorageDead(_4); return; } diff --git a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff index 738b0b1b3e5..ff7f12c093c 100644 --- a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff +++ b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff @@ -7,22 +7,18 @@ let _2: &[T]; let mut _3: &[T; 3]; let _4: [T; 3]; - let mut _5: T; - let mut _6: T; - let mut _7: T; - let mut _8: usize; - let mut _9: usize; - let mut _10: bool; - let mut _14: !; + let mut _5: usize; + let mut _6: bool; + let mut _10: !; scope 1 { debug v => _2; - let _11: &T; - let _12: &T; - let _13: &T; + let _7: &T; + let _8: &T; + let _9: &T; scope 2 { - debug v1 => _11; - debug v2 => _12; - debug v3 => _13; + debug v1 => _7; + debug v2 => _8; + debug v3 => _9; } } @@ -33,26 +29,25 @@ _3 = &_4; _2 = move _3 as &[T] (PointerCoercion(Unsize)); StorageDead(_3); - _8 = const 3_usize; - _9 = const 3_usize; - _10 = const true; + _5 = const 3_usize; + _6 = const true; goto -> bb2; } bb1: { - _14 = core::panicking::panic(const "internal error: entered unreachable code") -> unwind continue; + _10 = core::panicking::panic(const "internal error: entered unreachable code") -> unwind continue; } bb2: { - StorageLive(_11); - _11 = &(*_2)[0 of 3]; - StorageLive(_12); - _12 = &(*_2)[1 of 3]; - StorageLive(_13); - _13 = &(*_2)[2 of 3]; - StorageDead(_13); - StorageDead(_12); - StorageDead(_11); + StorageLive(_7); + _7 = &(*_2)[0 of 3]; + StorageLive(_8); + _8 = &(*_2)[1 of 3]; + StorageLive(_9); + _9 = &(*_2)[2 of 3]; + StorageDead(_9); + StorageDead(_8); + StorageDead(_7); StorageDead(_4); return; } diff --git a/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-abort.diff b/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-abort.diff index d3957158360..64a435f2245 100644 --- a/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-abort.diff +++ b/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-abort.diff @@ -3,18 +3,15 @@ fn main() -> () { let mut _0: (); - let mut _1: bool; - let _2: (); + let _1: (); bb0: { - StorageLive(_1); - _1 = const false; - switchInt(const false) -> [0: bb3, otherwise: bb1]; + goto -> bb3; } bb1: { - _2 = noop() -> [return: bb2, unwind unreachable]; + _1 = noop() -> [return: bb2, unwind unreachable]; } bb2: { @@ -26,7 +23,6 @@ } bb4: { - StorageDead(_1); return; } } diff --git a/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-unwind.diff b/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-unwind.diff index 81903c64dbd..146e00686ed 100644 --- a/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-unwind.diff +++ b/tests/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.panic-unwind.diff @@ -3,18 +3,15 @@ fn main() -> () { let mut _0: (); - let mut _1: bool; - let _2: (); + let _1: (); bb0: { - StorageLive(_1); - _1 = const false; - switchInt(const false) -> [0: bb3, otherwise: bb1]; + goto -> bb3; } bb1: { - _2 = noop() -> [return: bb2, unwind continue]; + _1 = noop() -> [return: bb2, unwind continue]; } bb2: { @@ -26,7 +23,6 @@ } bb4: { - StorageDead(_1); return; } } |
