From dc0db358abe19481e475e10c32149b53370f1a1c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 05:57:31 +0200 Subject: Merging upstream version 1.72.1+dfsg1. Signed-off-by: Daniel Baumann --- ...s.{impl#0}-clone.InstSimplify.panic-unwind.diff | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-unwind.diff (limited to 'tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-unwind.diff') diff --git a/tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-unwind.diff b/tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-unwind.diff new file mode 100644 index 000000000..1a4372afe --- /dev/null +++ b/tests/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-unwind.diff @@ -0,0 +1,73 @@ +- // MIR for `::clone` before InstSimplify ++ // MIR for `::clone` after InstSimplify + + fn ::clone(_1: &MyThing) -> MyThing { + debug self => _1; + let mut _0: MyThing; + let mut _2: T; + let mut _3: &T; + let _4: &T; + let mut _5: u64; + let mut _6: &u64; + let _7: &u64; + let mut _8: [f32; 3]; + let mut _9: &[f32; 3]; + let _10: &[f32; 3]; + + bb0: { + StorageLive(_2); + StorageLive(_3); + StorageLive(_4); + _4 = &((*_1).0: T); +- _3 = &(*_4); ++ _3 = _4; + _2 = ::clone(move _3) -> [return: bb1, unwind continue]; + } + + bb1: { + StorageDead(_3); + StorageLive(_5); + StorageLive(_6); + StorageLive(_7); + _7 = &((*_1).1: u64); +- _6 = &(*_7); +- _5 = ::clone(move _6) -> [return: bb2, unwind: bb4]; ++ _6 = _7; ++ _5 = (*_6); ++ goto -> bb2; + } + + bb2: { + StorageDead(_6); + StorageLive(_8); + StorageLive(_9); + StorageLive(_10); + _10 = &((*_1).2: [f32; 3]); +- _9 = &(*_10); +- _8 = <[f32; 3] as Clone>::clone(move _9) -> [return: bb3, unwind: bb4]; ++ _9 = _10; ++ _8 = (*_9); ++ goto -> bb3; + } + + bb3: { + StorageDead(_9); + _0 = MyThing:: { v: move _2, i: move _5, a: move _8 }; + StorageDead(_8); + StorageDead(_5); + StorageDead(_2); + StorageDead(_10); + StorageDead(_7); + StorageDead(_4); + return; + } + + bb4 (cleanup): { + drop(_2) -> [return: bb5, unwind terminate]; + } + + bb5 (cleanup): { + resume; + } + } + -- cgit v1.2.3