diff --git a/compiler/rustc_mir_transform/src/inline.rs b/compiler/rustc_mir_transform/src/inline.rs index 60513a674af..1182a738402 100644 --- a/compiler/rustc_mir_transform/src/inline.rs +++ b/compiler/rustc_mir_transform/src/inline.rs @@ -11,7 +11,7 @@ use rustc_middle::mir::*; use rustc_middle::ty::TypeVisitableExt; use rustc_middle::ty::{self, Instance, InstanceDef, ParamEnv, Ty, TyCtxt}; -use rustc_session::config::OptLevel; +use rustc_session::config::{DebugInfo, OptLevel}; use rustc_span::source_map::Spanned; use rustc_span::sym; use rustc_target::abi::FieldIdx; @@ -699,7 +699,9 @@ fn dest_needs_borrow(place: Place<'_>) -> bool { // Insert all of the (mapped) parts of the callee body into the caller. caller_body.local_decls.extend(callee_body.drain_vars_and_temps()); caller_body.source_scopes.extend(&mut callee_body.source_scopes.drain(..)); - caller_body.var_debug_info.append(&mut callee_body.var_debug_info); + if self.tcx.sess.opts.debuginfo != DebugInfo::None { + caller_body.var_debug_info.append(&mut callee_body.var_debug_info); + } caller_body.basic_blocks_mut().extend(callee_body.basic_blocks_mut().drain(..)); caller_body[callsite.block].terminator = Some(Terminator { diff --git a/tests/codegen/mem-replace-simple-type.rs b/tests/codegen/mem-replace-simple-type.rs index 50b43f5854a..7209fa21925 100644 --- a/tests/codegen/mem-replace-simple-type.rs +++ b/tests/codegen/mem-replace-simple-type.rs @@ -34,18 +34,20 @@ pub fn replace_ref_str<'a>(r: &mut &'a str, v: &'a str) -> &'a str { #[no_mangle] // CHECK-LABEL: @replace_short_array_3( +// CHECK-SAME: ptr{{.+}}sret{{.+}}%[[RET:.+]], ptr{{.+}}%r, ptr{{.+}}%v pub fn replace_short_array_3(r: &mut [u32; 3], v: [u32; 3]) -> [u32; 3] { // CHECK-NOT: alloca - // CHECK: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %result, ptr align 4 %r, i64 12, i1 false) + // CHECK: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %[[RET]], ptr align 4 %r, i64 12, i1 false) // CHECK: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %r, ptr align 4 %v, i64 12, i1 false) std::mem::replace(r, v) } #[no_mangle] // CHECK-LABEL: @replace_short_array_4( +// CHECK-SAME: ptr{{.+}}sret{{.+}}%[[RET:.+]], ptr{{.+}}%r, ptr{{.+}}%v pub fn replace_short_array_4(r: &mut [u32; 4], v: [u32; 4]) -> [u32; 4] { // CHECK-NOT: alloca - // CHECK: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %result, ptr align 4 %r, i64 16, i1 false) + // CHECK: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %[[RET]], ptr align 4 %r, i64 16, i1 false) // CHECK: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %r, ptr align 4 %v, i64 16, i1 false) std::mem::replace(r, v) } diff --git a/tests/codegen/slice-ref-equality.rs b/tests/codegen/slice-ref-equality.rs index 85d9c34a30b..7ab70108fe0 100644 --- a/tests/codegen/slice-ref-equality.rs +++ b/tests/codegen/slice-ref-equality.rs @@ -43,48 +43,48 @@ // equality for non-byte types also just emit a `bcmp`, not a loop. // CHECK-LABEL: @eq_slice_of_nested_u8( -// CHECK-SAME: [[USIZE:i16|i32|i64]] noundef %1 -// CHECK-SAME: [[USIZE]] noundef %3 +// CHECK-SAME: [[USIZE:i16|i32|i64]] noundef %x.1 +// CHECK-SAME: [[USIZE]] noundef %y.1 #[no_mangle] fn eq_slice_of_nested_u8(x: &[[u8; 3]], y: &[[u8; 3]]) -> bool { - // CHECK: icmp eq [[USIZE]] %1, %3 - // CHECK: %[[BYTES:.+]] = mul nsw [[USIZE]] %1, 3 + // CHECK: icmp eq [[USIZE]] %x.1, %y.1 + // CHECK: %[[BYTES:.+]] = mul nsw [[USIZE]] {{%x.1|%y.1}}, 3 // CHECK: tail call{{( noundef)?}} i32 @{{bcmp|memcmp}}(ptr // CHECK-SAME: , [[USIZE]]{{( noundef)?}} %[[BYTES]]) x == y } // CHECK-LABEL: @eq_slice_of_i32( -// CHECK-SAME: [[USIZE:i16|i32|i64]] noundef %1 -// CHECK-SAME: [[USIZE]] noundef %3 +// CHECK-SAME: [[USIZE:i16|i32|i64]] noundef %x.1 +// CHECK-SAME: [[USIZE]] noundef %y.1 #[no_mangle] fn eq_slice_of_i32(x: &[i32], y: &[i32]) -> bool { - // CHECK: icmp eq [[USIZE]] %1, %3 - // CHECK: %[[BYTES:.+]] = shl nsw [[USIZE]] %1, 2 + // CHECK: icmp eq [[USIZE]] %x.1, %y.1 + // CHECK: %[[BYTES:.+]] = shl nsw [[USIZE]] {{%x.1|%y.1}}, 2 // CHECK: tail call{{( noundef)?}} i32 @{{bcmp|memcmp}}(ptr // CHECK-SAME: , [[USIZE]]{{( noundef)?}} %[[BYTES]]) x == y } // CHECK-LABEL: @eq_slice_of_nonzero( -// CHECK-SAME: [[USIZE:i16|i32|i64]] noundef %1 -// CHECK-SAME: [[USIZE]] noundef %3 +// CHECK-SAME: [[USIZE:i16|i32|i64]] noundef %x.1 +// CHECK-SAME: [[USIZE]] noundef %y.1 #[no_mangle] fn eq_slice_of_nonzero(x: &[NonZero], y: &[NonZero]) -> bool { - // CHECK: icmp eq [[USIZE]] %1, %3 - // CHECK: %[[BYTES:.+]] = shl nsw [[USIZE]] %1, 2 + // CHECK: icmp eq [[USIZE]] %x.1, %y.1 + // CHECK: %[[BYTES:.+]] = shl nsw [[USIZE]] {{%x.1|%y.1}}, 2 // CHECK: tail call{{( noundef)?}} i32 @{{bcmp|memcmp}}(ptr // CHECK-SAME: , [[USIZE]]{{( noundef)?}} %[[BYTES]]) x == y } // CHECK-LABEL: @eq_slice_of_option_of_nonzero( -// CHECK-SAME: [[USIZE:i16|i32|i64]] noundef %1 -// CHECK-SAME: [[USIZE]] noundef %3 +// CHECK-SAME: [[USIZE:i16|i32|i64]] noundef %x.1 +// CHECK-SAME: [[USIZE]] noundef %y.1 #[no_mangle] fn eq_slice_of_option_of_nonzero(x: &[Option>], y: &[Option>]) -> bool { - // CHECK: icmp eq [[USIZE]] %1, %3 - // CHECK: %[[BYTES:.+]] = shl nsw [[USIZE]] %1, 1 + // CHECK: icmp eq [[USIZE]] %x.1, %y.1 + // CHECK: %[[BYTES:.+]] = shl nsw [[USIZE]] {{%x.1|%y.1}}, 1 // CHECK: tail call{{( noundef)?}} i32 @{{bcmp|memcmp}}(ptr // CHECK-SAME: , [[USIZE]]{{( noundef)?}} %[[BYTES]]) x == y diff --git a/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-abort.diff index 4c2df228eb8..8c5a0df94f4 100644 --- a/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-abort.diff @@ -9,8 +9,6 @@ scope 1 { } scope 2 (inlined #[track_caller] ::add) { - debug self => _2; - debug other => _3; let mut _4: (u8, bool); } diff --git a/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-unwind.diff index c4e666b489e..7887a8a9072 100644 --- a/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-unwind.diff @@ -9,8 +9,6 @@ scope 1 { } scope 2 (inlined #[track_caller] ::add) { - debug self => _2; - debug other => _3; let mut _4: (u8, bool); } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff index 44e73b56098..8005bc23cf6 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff @@ -12,16 +12,13 @@ let _3: std::ptr::Unique<[bool]>; let mut _4: std::ptr::Unique<[bool; 0]>; scope 3 { - debug ptr => _3; } scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { let _6: *mut [bool; 0]; scope 6 { - debug ptr => _6; scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { - debug ptr => _6; let mut _8: bool; let _9: (); let mut _10: *mut (); @@ -37,7 +34,6 @@ scope 8 (inlined align_of::<[bool; 0]>) { } scope 9 (inlined without_provenance_mut::<[bool; 0]>) { - debug addr => _7; } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff index 6cef8b692ba..42b1be32387 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff @@ -12,16 +12,13 @@ let _3: std::ptr::Unique<[bool]>; let mut _4: std::ptr::Unique<[bool; 0]>; scope 3 { - debug ptr => _3; } scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { let _6: *mut [bool; 0]; scope 6 { - debug ptr => _6; scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { - debug ptr => _6; let mut _8: bool; let _9: (); let mut _10: *mut (); @@ -37,7 +34,6 @@ scope 8 (inlined align_of::<[bool; 0]>) { } scope 9 (inlined without_provenance_mut::<[bool; 0]>) { - debug addr => _7; } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff index 6efccded993..7b57b0db50c 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff @@ -12,16 +12,13 @@ let _3: std::ptr::Unique<[bool]>; let mut _4: std::ptr::Unique<[bool; 0]>; scope 3 { - debug ptr => _3; } scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { let _6: *mut [bool; 0]; scope 6 { - debug ptr => _6; scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { - debug ptr => _6; let mut _8: bool; let _9: (); let mut _10: *mut (); @@ -37,7 +34,6 @@ scope 8 (inlined align_of::<[bool; 0]>) { } scope 9 (inlined without_provenance_mut::<[bool; 0]>) { - debug addr => _7; } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-unwind.diff index a705d0064cb..2e75a63e290 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-unwind.diff @@ -12,16 +12,13 @@ let _3: std::ptr::Unique<[bool]>; let mut _4: std::ptr::Unique<[bool; 0]>; scope 3 { - debug ptr => _3; } scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { let _6: *mut [bool; 0]; scope 6 { - debug ptr => _6; scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { - debug ptr => _6; let mut _8: bool; let _9: (); let mut _10: *mut (); @@ -37,7 +34,6 @@ scope 8 (inlined align_of::<[bool; 0]>) { } scope 9 (inlined without_provenance_mut::<[bool; 0]>) { - debug addr => _7; } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff index f9c854ca3f4..ca445046279 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff @@ -12,16 +12,13 @@ let _3: std::ptr::Unique<[bool]>; let mut _4: std::ptr::Unique<[bool; 0]>; scope 3 { - debug ptr => _3; } scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { let _6: *mut [bool; 0]; scope 6 { - debug ptr => _6; scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { - debug ptr => _6; let mut _8: bool; let _9: (); let mut _10: *mut (); @@ -37,7 +34,6 @@ scope 8 (inlined align_of::<[bool; 0]>) { } scope 9 (inlined without_provenance_mut::<[bool; 0]>) { - debug addr => _7; } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff index 333726689d7..1f498c65fa7 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff @@ -12,16 +12,13 @@ let _3: std::ptr::Unique<[bool]>; let mut _4: std::ptr::Unique<[bool; 0]>; scope 3 { - debug ptr => _3; } scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { let _6: *mut [bool; 0]; scope 6 { - debug ptr => _6; scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { - debug ptr => _6; let mut _8: bool; let _9: (); let mut _10: *mut (); @@ -37,7 +34,6 @@ scope 8 (inlined align_of::<[bool; 0]>) { } scope 9 (inlined without_provenance_mut::<[bool; 0]>) { - debug addr => _7; } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff index e1841760077..da72e581496 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff @@ -12,16 +12,13 @@ let _3: std::ptr::Unique<[bool]>; let mut _4: std::ptr::Unique<[bool; 0]>; scope 3 { - debug ptr => _3; } scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { let _6: *mut [bool; 0]; scope 6 { - debug ptr => _6; scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { - debug ptr => _6; let mut _8: bool; let _9: (); let mut _10: *mut (); @@ -37,7 +34,6 @@ scope 8 (inlined align_of::<[bool; 0]>) { } scope 9 (inlined without_provenance_mut::<[bool; 0]>) { - debug addr => _7; } } } diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff index 7aa02556ec5..920e66452e3 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff @@ -12,16 +12,13 @@ let _3: std::ptr::Unique<[bool]>; let mut _4: std::ptr::Unique<[bool; 0]>; scope 3 { - debug ptr => _3; } scope 4 (inlined Unique::<[bool; 0]>::dangling) { let mut _5: std::ptr::NonNull<[bool; 0]>; scope 5 (inlined NonNull::<[bool; 0]>::dangling) { let _6: *mut [bool; 0]; scope 6 { - debug ptr => _6; scope 10 (inlined NonNull::<[bool; 0]>::new_unchecked) { - debug ptr => _6; let mut _8: bool; let _9: (); let mut _10: *mut (); @@ -37,7 +34,6 @@ scope 8 (inlined align_of::<[bool; 0]>) { } scope 9 (inlined without_provenance_mut::<[bool; 0]>) { - debug addr => _7; } } } diff --git a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff index 09fc48043b9..ca1bd737caf 100644 --- a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff @@ -9,8 +9,6 @@ scope 1 { } scope 2 (inlined #[track_caller] ::add) { - debug self => _2; - debug other => _3; let mut _4: (u8, bool); } diff --git a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff index c0b26080f56..0d7fe9360c1 100644 --- a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff @@ -9,8 +9,6 @@ scope 1 { } scope 2 (inlined #[track_caller] ::add) { - debug self => _2; - debug other => _3; let mut _4: (u8, bool); } diff --git a/tests/mir-opt/dest-prop/union.rs b/tests/mir-opt/dest-prop/union.rs index abd1f1b2c93..66fadd84712 100644 --- a/tests/mir-opt/dest-prop/union.rs +++ b/tests/mir-opt/dest-prop/union.rs @@ -1,7 +1,7 @@ // skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY //! Tests that we can propagate into places that are projections into unions -//@ compile-flags: -Zunsound-mir-opts +//@ compile-flags: -Zunsound-mir-opts -C debuginfo=full fn val() -> u32 { 1 } diff --git a/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff b/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff index bd346af6d16..8a701641ff9 100644 --- a/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff +++ b/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-abort.diff @@ -29,13 +29,11 @@ debug precision => _8; let _8: usize; scope 5 (inlined Formatter::<'_>::precision) { - debug self => _1; } } } } scope 4 (inlined Formatter::<'_>::sign_plus) { - debug self => _1; let mut _20: u32; let mut _21: u32; } diff --git a/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-unwind.diff b/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-unwind.diff index 422cbeaa224..5e65700ee4a 100644 --- a/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-unwind.diff +++ b/tests/mir-opt/funky_arms.float_to_exponential_common.GVN.panic-unwind.diff @@ -29,13 +29,11 @@ debug precision => _8; let _8: usize; scope 5 (inlined Formatter::<'_>::precision) { - debug self => _1; } } } } scope 4 (inlined Formatter::<'_>::sign_plus) { - debug self => _1; let mut _20: u32; let mut _21: u32; } diff --git a/tests/mir-opt/inline/asm_unwind.rs b/tests/mir-opt/inline/asm_unwind.rs index 7708f567c71..8a102b2f561 100644 --- a/tests/mir-opt/inline/asm_unwind.rs +++ b/tests/mir-opt/inline/asm_unwind.rs @@ -3,7 +3,7 @@ // EMIT_MIR_FOR_EACH_PANIC_STRATEGY //@ needs-asm-support //@ needs-unwind -//@ compile-flags: -Zinline-mir-hint-threshold=1000 +//@ compile-flags: -Zinline-mir-hint-threshold=1000 -C debuginfo=full #![feature(asm_unwind)] struct D; diff --git a/tests/mir-opt/inline/cycle.rs b/tests/mir-opt/inline/cycle.rs index b2eacfe33b1..cb50638473f 100644 --- a/tests/mir-opt/inline/cycle.rs +++ b/tests/mir-opt/inline/cycle.rs @@ -1,5 +1,5 @@ // EMIT_MIR_FOR_EACH_PANIC_STRATEGY -//@ compile-flags: -Zinline-mir-hint-threshold=1000 +//@ compile-flags: -Zinline-mir-hint-threshold=1000 -C debuginfo=full // EMIT_MIR cycle.f.Inline.diff #[inline(always)] diff --git a/tests/mir-opt/inline/dyn_trait.rs b/tests/mir-opt/inline/dyn_trait.rs index ecf220a85e6..d991403a5ac 100644 --- a/tests/mir-opt/inline/dyn_trait.rs +++ b/tests/mir-opt/inline/dyn_trait.rs @@ -1,4 +1,5 @@ // EMIT_MIR_FOR_EACH_PANIC_STRATEGY +//@ compile-flags: -C debuginfo=full #![crate_type = "lib"] use std::fmt::Debug; diff --git a/tests/mir-opt/inline/inline_any_operand.rs b/tests/mir-opt/inline/inline_any_operand.rs index 8151949214b..b34f71a6979 100644 --- a/tests/mir-opt/inline/inline_any_operand.rs +++ b/tests/mir-opt/inline/inline_any_operand.rs @@ -1,4 +1,4 @@ -//@ compile-flags: -Z span_free_formats +//@ compile-flags: -Z span_free_formats -C debuginfo=full // Tests that MIR inliner works for any operand diff --git a/tests/mir-opt/inline/inline_closure.rs b/tests/mir-opt/inline/inline_closure.rs index 9a3cf54ef07..a5954955c0f 100644 --- a/tests/mir-opt/inline/inline_closure.rs +++ b/tests/mir-opt/inline/inline_closure.rs @@ -1,4 +1,4 @@ -//@ compile-flags: -Z span_free_formats +//@ compile-flags: -Z span_free_formats -C debuginfo=full // Tests that MIR inliner can handle closure arguments. (#45894) diff --git a/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir b/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir index 6e77a9bc575..a6198ca053b 100644 --- a/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir +++ b/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir @@ -14,10 +14,7 @@ fn foo(_1: T, _2: &i32) -> i32 { scope 1 { debug x => _3; scope 2 (inlined foo::::{closure#0}) { - debug r => _8; - debug _s => _9; scope 3 { - debug variable => _8; } } } diff --git a/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir b/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir index 10b81e59b5f..2f9d28ea093 100644 --- a/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir +++ b/tests/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir @@ -14,9 +14,6 @@ fn foo(_1: T, _2: i32) -> (i32, T) { scope 1 { debug x => _3; scope 2 (inlined foo::::{closure#0}) { - debug _q => _9; - debug q => (*((*_6).0: &i32)); - debug t => (*((*_6).1: &T)); let mut _10: &i32; let mut _11: i32; let mut _12: &T; diff --git a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff index 859082c3111..fcfa5953fc2 100644 --- a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff @@ -16,7 +16,6 @@ + scope 3 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new) { + debug pointer => _3; + scope 4 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new_unchecked) { -+ debug pointer => _3; + } + } + scope 5 (inlined g::{closure#0}) { diff --git a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff index 44b06c34972..69c632a9043 100644 --- a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff @@ -16,7 +16,6 @@ + scope 3 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new) { + debug pointer => _3; + scope 4 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new_unchecked) { -+ debug pointer => _3; + } + } + scope 5 (inlined g::{closure#0}) { diff --git a/tests/mir-opt/inline/inline_coroutine.rs b/tests/mir-opt/inline/inline_coroutine.rs index 9500c2261cc..180f9d4a6fd 100644 --- a/tests/mir-opt/inline/inline_coroutine.rs +++ b/tests/mir-opt/inline/inline_coroutine.rs @@ -1,5 +1,5 @@ // EMIT_MIR_FOR_EACH_PANIC_STRATEGY -//@ compile-flags: -Zinline-mir-hint-threshold=1000 +//@ compile-flags: -Zinline-mir-hint-threshold=1000 -C debuginfo=full #![feature(coroutines, coroutine_trait)] use std::ops::Coroutine; diff --git a/tests/mir-opt/inline/inline_cycle.rs b/tests/mir-opt/inline/inline_cycle.rs index e3dd082556b..1826e38f894 100644 --- a/tests/mir-opt/inline/inline_cycle.rs +++ b/tests/mir-opt/inline/inline_cycle.rs @@ -1,4 +1,5 @@ // skip-filecheck +//@ compile-flags: -C debuginfo=full // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // Check that inliner handles various forms of recursion and doesn't fall into // an infinite inlining cycle. The particular outcome of inlining is not diff --git a/tests/mir-opt/inline/inline_diverging.rs b/tests/mir-opt/inline/inline_diverging.rs index 89ef0fc4a61..e1cea3618f1 100644 --- a/tests/mir-opt/inline/inline_diverging.rs +++ b/tests/mir-opt/inline/inline_diverging.rs @@ -1,7 +1,7 @@ // Tests inlining of diverging calls. // // EMIT_MIR_FOR_EACH_PANIC_STRATEGY -//@ compile-flags: -Zinline-mir-hint-threshold=1000 +//@ compile-flags: -Zinline-mir-hint-threshold=1000 -C debuginfo=full #![crate_type = "lib"] // EMIT_MIR inline_diverging.f.Inline.diff diff --git a/tests/mir-opt/inline/inline_retag.rs b/tests/mir-opt/inline/inline_retag.rs index 5cf7f768f91..81e63637887 100644 --- a/tests/mir-opt/inline/inline_retag.rs +++ b/tests/mir-opt/inline/inline_retag.rs @@ -1,4 +1,4 @@ -//@ compile-flags: -Z span_free_formats -Z mir-emit-retag +//@ compile-flags: -Z span_free_formats -Z mir-emit-retag -C debuginfo=full // Tests that MIR inliner fixes up `Retag`'s `fn_entry` flag diff --git a/tests/mir-opt/inline/inline_trait_method_2.rs b/tests/mir-opt/inline/inline_trait_method_2.rs index c3a71e63783..2ca71afad4c 100644 --- a/tests/mir-opt/inline/inline_trait_method_2.rs +++ b/tests/mir-opt/inline/inline_trait_method_2.rs @@ -1,5 +1,5 @@ // EMIT_MIR_FOR_EACH_PANIC_STRATEGY -//@ compile-flags: -Z span_free_formats -Z mir-opt-level=4 +//@ compile-flags: -Z span_free_formats -Z mir-opt-level=4 -C debuginfo=full // EMIT_MIR inline_trait_method_2.test2.Inline.after.mir fn test2(x: &dyn X) -> bool { diff --git a/tests/mir-opt/inline/issue_106141.rs b/tests/mir-opt/inline/issue_106141.rs index 592b4d9b723..1cca7d76b25 100644 --- a/tests/mir-opt/inline/issue_106141.rs +++ b/tests/mir-opt/inline/issue_106141.rs @@ -1,3 +1,4 @@ +//@ compile-flags: -C debuginfo=full // Verify that we do not ICE inlining a function which uses _0 as an index. // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.rs b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.rs index 4517c88d713..d8a5c47850d 100644 --- a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.rs +++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.rs @@ -1,3 +1,5 @@ +//@ compile-flags: -C debuginfo=full + // EMIT_MIR issue_58867_inline_as_ref_as_mut.a.Inline.after.mir pub fn a(x: &mut [T]) -> &mut [T] { // CHECK-LABEL: fn a( diff --git a/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir b/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir index ba4f91b28d5..63d3ae2a869 100644 --- a/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir +++ b/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.main.Inline.after.mir @@ -2,8 +2,8 @@ fn main() -> () { let mut _0: (); - let _1: {closure@$DIR/issue_76997_inline_scopes_parenting.rs:15:13: 15:16}; - let mut _2: &{closure@$DIR/issue_76997_inline_scopes_parenting.rs:15:13: 15:16}; + let _1: {closure@$DIR/issue_76997_inline_scopes_parenting.rs:16:13: 16:16}; + let mut _2: &{closure@$DIR/issue_76997_inline_scopes_parenting.rs:16:13: 16:16}; let mut _3: ((),); let mut _4: (); let mut _5: (); @@ -19,7 +19,7 @@ fn main() -> () { bb0: { StorageLive(_1); - _1 = {closure@$DIR/issue_76997_inline_scopes_parenting.rs:15:13: 15:16}; + _1 = {closure@$DIR/issue_76997_inline_scopes_parenting.rs:16:13: 16:16}; StorageLive(_2); _2 = &_1; StorageLive(_3); diff --git a/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.rs b/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.rs index 2fb363c1904..75772c16127 100644 --- a/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.rs +++ b/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.rs @@ -1,3 +1,4 @@ +//@ compile-flags: -C debuginfo=full // Tests that MIR inliner can handle `SourceScopeData` parenting correctly. (#76997) // EMIT_MIR issue_76997_inline_scopes_parenting.main.Inline.after.mir diff --git a/tests/mir-opt/inline/issue_78442.rs b/tests/mir-opt/inline/issue_78442.rs index 2fbe0c6c64c..6dc875f9a40 100644 --- a/tests/mir-opt/inline/issue_78442.rs +++ b/tests/mir-opt/inline/issue_78442.rs @@ -1,4 +1,4 @@ -//@ compile-flags: -Z mir-opt-level=3 -Z inline-mir +//@ compile-flags: -Z mir-opt-level=3 -Z inline-mir -C debuginfo=full // EMIT_MIR_FOR_EACH_PANIC_STRATEGY #![crate_type = "lib"] diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff index cc1b8b9b70f..a624ab78dad 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-abort.diff @@ -8,8 +8,6 @@ let mut _3: u16; let mut _4: u32; + scope 1 (inlined core::num::::unchecked_shl) { -+ debug self => _3; -+ debug rhs => _4; + } bb0: { diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff index f244f378bce..81a0a5b39f7 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.panic-unwind.diff @@ -8,8 +8,6 @@ let mut _3: u16; let mut _4: u32; + scope 1 (inlined core::num::::unchecked_shl) { -+ debug self => _3; -+ debug rhs => _4; + } bb0: { diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-abort.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-abort.mir index c96983c18cb..9e3802b7501 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-abort.mir @@ -5,8 +5,6 @@ fn unchecked_shl_unsigned_smaller(_1: u16, _2: u32) -> u16 { debug b => _2; let mut _0: u16; scope 1 (inlined core::num::::unchecked_shl) { - debug self => _1; - debug rhs => _2; } bb0: { diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-unwind.mir index c96983c18cb..9e3802b7501 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shl_unsigned_smaller.PreCodegen.after.panic-unwind.mir @@ -5,8 +5,6 @@ fn unchecked_shl_unsigned_smaller(_1: u16, _2: u32) -> u16 { debug b => _2; let mut _0: u16; scope 1 (inlined core::num::::unchecked_shl) { - debug self => _1; - debug rhs => _2; } bb0: { diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff index 74518db370f..a2b3ad4b3ba 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-abort.diff @@ -8,8 +8,6 @@ let mut _3: i64; let mut _4: u32; + scope 1 (inlined core::num::::unchecked_shr) { -+ debug self => _3; -+ debug rhs => _4; + } bb0: { diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff index aab04624f6c..2ff6b532d61 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.Inline.panic-unwind.diff @@ -8,8 +8,6 @@ let mut _3: i64; let mut _4: u32; + scope 1 (inlined core::num::::unchecked_shr) { -+ debug self => _3; -+ debug rhs => _4; + } bb0: { diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-abort.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-abort.mir index 1dd8cb27314..f3961982648 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-abort.mir @@ -5,8 +5,6 @@ fn unchecked_shr_signed_bigger(_1: i64, _2: u32) -> i64 { debug b => _2; let mut _0: i64; scope 1 (inlined core::num::::unchecked_shr) { - debug self => _1; - debug rhs => _2; } bb0: { diff --git a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-unwind.mir index 1dd8cb27314..f3961982648 100644 --- a/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/inline/unchecked_shifts.unchecked_shr_signed_bigger.PreCodegen.after.panic-unwind.mir @@ -5,8 +5,6 @@ fn unchecked_shr_signed_bigger(_1: i64, _2: u32) -> i64 { debug b => _2; let mut _0: i64; scope 1 (inlined core::num::::unchecked_shr) { - debug self => _1; - debug rhs => _2; } bb0: { diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-abort.diff b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-abort.diff index 814eda10459..c1f7879cf0e 100644 --- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-abort.diff +++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-abort.diff @@ -6,10 +6,8 @@ let mut _0: T; let mut _2: std::option::Option; + scope 1 (inlined #[track_caller] Option::::unwrap_unchecked) { -+ debug self => _2; + let mut _3: isize; + scope 2 { -+ debug val => _0; + } + scope 3 (inlined unreachable_unchecked) { + let mut _4: bool; diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-unwind.diff b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-unwind.diff index d5d69074382..5271e538daf 100644 --- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.Inline.panic-unwind.diff @@ -6,10 +6,8 @@ let mut _0: T; let mut _2: std::option::Option; + scope 1 (inlined #[track_caller] Option::::unwrap_unchecked) { -+ debug self => _2; + let mut _3: isize; + scope 2 { -+ debug val => _0; + } + scope 3 (inlined unreachable_unchecked) { + let mut _4: bool; diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-abort.mir b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-abort.mir index 7c24a97166c..dcab8a679a8 100644 --- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-abort.mir @@ -4,10 +4,8 @@ fn unwrap_unchecked(_1: Option) -> T { debug slf => _1; let mut _0: T; scope 1 (inlined #[track_caller] Option::::unwrap_unchecked) { - debug self => _1; let mut _2: isize; scope 2 { - debug val => _0; } scope 3 (inlined unreachable_unchecked) { scope 4 (inlined core::ub_checks::check_language_ub) { diff --git a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-unwind.mir index 7c24a97166c..dcab8a679a8 100644 --- a/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/inline/unwrap_unchecked.unwrap_unchecked.PreCodegen.after.panic-unwind.mir @@ -4,10 +4,8 @@ fn unwrap_unchecked(_1: Option) -> T { debug slf => _1; let mut _0: T; scope 1 (inlined #[track_caller] Option::::unwrap_unchecked) { - debug self => _1; let mut _2: isize; scope 2 { - debug val => _0; } scope 3 (inlined unreachable_unchecked) { scope 4 (inlined core::ub_checks::check_language_ub) { diff --git a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff index f8cceacd7e6..f8715789cec 100644 --- a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff +++ b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff @@ -21,8 +21,6 @@ scope 3 { } + scope 6 (inlined ActionPermit::<'_, T>::perform::{closure#0}) { -+ debug _task_context => _31; -+ debug self => ((*(_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()})).0: ActionPermit<'_, T>); + let _11: ActionPermit<'_, T>; + let mut _12: std::future::Ready<()>; + let mut _13: std::future::Ready<()>; @@ -52,28 +50,22 @@ + let mut _39: &mut {async fn body of ActionPermit<'_, T>::perform()}; + let mut _40: &mut {async fn body of ActionPermit<'_, T>::perform()}; + scope 7 { -+ debug self => (((*(_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()})) as variant#3).0: ActionPermit<'_, T>); + let mut _15: std::future::Ready<()>; + scope 8 { -+ debug __awaitee => (((*(_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()})) as variant#3).1: std::future::Ready<()>); + let _26: (); + scope 9 { -+ debug result => _26; + } + } + scope 10 (inlined ready::<()>) { -+ debug t => _14; + let mut _41: std::option::Option<()>; + } + } + } } + scope 5 (inlined Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}>::new_unchecked) { -+ debug pointer => _5; + } } + scope 4 (inlined ActionPermit::<'_, T>::perform) { -+ debug self => _3; + } bb0: { diff --git a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff index fd080d22d3a..494f5591e32 100644 --- a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff +++ b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff @@ -21,8 +21,6 @@ scope 3 { } + scope 6 (inlined ActionPermit::<'_, T>::perform::{closure#0}) { -+ debug _task_context => _31; -+ debug self => ((*(_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()})).0: ActionPermit<'_, T>); + let _11: ActionPermit<'_, T>; + let mut _12: std::future::Ready<()>; + let mut _13: std::future::Ready<()>; @@ -54,28 +52,22 @@ + let mut _41: &mut {async fn body of ActionPermit<'_, T>::perform()}; + let mut _42: &mut {async fn body of ActionPermit<'_, T>::perform()}; + scope 7 { -+ debug self => (((*(_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()})) as variant#3).0: ActionPermit<'_, T>); + let mut _15: std::future::Ready<()>; + scope 8 { -+ debug __awaitee => (((*(_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()})) as variant#3).1: std::future::Ready<()>); + let _26: (); + scope 9 { -+ debug result => _26; + } + } + scope 10 (inlined ready::<()>) { -+ debug t => _14; + let mut _43: std::option::Option<()>; + } + } + } } + scope 5 (inlined Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}>::new_unchecked) { -+ debug pointer => _5; + } } + scope 4 (inlined ActionPermit::<'_, T>::perform) { -+ debug self => _3; + } bb0: { diff --git a/tests/mir-opt/inline_generically_if_sized.call.Inline.diff b/tests/mir-opt/inline_generically_if_sized.call.Inline.diff index 0cf4565dc99..fc5833f54ec 100644 --- a/tests/mir-opt/inline_generically_if_sized.call.Inline.diff +++ b/tests/mir-opt/inline_generically_if_sized.call.Inline.diff @@ -6,7 +6,6 @@ let mut _0: i32; let mut _2: &T; + scope 1 (inlined ::bar) { -+ debug self => _2; + } bb0: { diff --git a/tests/mir-opt/instsimplify/casts.redundant.InstSimplify.diff b/tests/mir-opt/instsimplify/casts.redundant.InstSimplify.diff index 9e1bce1ee20..e7451d55777 100644 --- a/tests/mir-opt/instsimplify/casts.redundant.InstSimplify.diff +++ b/tests/mir-opt/instsimplify/casts.redundant.InstSimplify.diff @@ -8,7 +8,6 @@ let mut _3: *const &u8; let mut _4: *const &u8; scope 1 (inlined generic_cast::<&u8, &u8>) { - debug x => _4; let mut _5: *const &u8; } diff --git a/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify.diff b/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify.diff index 6d6c9c9a7a1..4d8d6589842 100644 --- a/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify.diff +++ b/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify.diff @@ -6,10 +6,8 @@ let mut _0: i32; let mut _2: std::option::Option; scope 1 (inlined #[track_caller] Option::::unwrap_unchecked) { - debug self => _2; let mut _3: isize; scope 2 { - debug val => _0; } scope 3 (inlined unreachable_unchecked) { let mut _4: bool; diff --git a/tests/mir-opt/issue_101973.inner.GVN.panic-abort.diff b/tests/mir-opt/issue_101973.inner.GVN.panic-abort.diff index 187290785c0..311de9e1c93 100644 --- a/tests/mir-opt/issue_101973.inner.GVN.panic-abort.diff +++ b/tests/mir-opt/issue_101973.inner.GVN.panic-abort.diff @@ -17,15 +17,11 @@ let mut _12: u32; let mut _13: bool; scope 1 (inlined imm8) { - debug x => _5; let mut _14: u32; scope 2 { - debug out => _4; } } scope 3 (inlined core::num::::rotate_right) { - debug self => _4; - debug n => _6; } bb0: { @@ -34,7 +30,7 @@ StorageLive(_4); StorageLive(_5); _5 = _1; - _4 = const 0_u32; + nop; - StorageLive(_14); - _14 = BitAnd(_5, const 255_u32); - _4 = BitOr(const 0_u32, move _14); @@ -74,7 +70,8 @@ bb2: { _6 = Shl(move _7, const 1_i32); StorageDead(_7); - _3 = rotate_right::(move _4, move _6) -> [return: bb3, unwind unreachable]; +- _3 = rotate_right::(move _4, move _6) -> [return: bb3, unwind unreachable]; ++ _3 = rotate_right::(_14, move _6) -> [return: bb3, unwind unreachable]; } bb3: { diff --git a/tests/mir-opt/issue_101973.inner.GVN.panic-unwind.diff b/tests/mir-opt/issue_101973.inner.GVN.panic-unwind.diff index 99350bac478..c5fd042161d 100644 --- a/tests/mir-opt/issue_101973.inner.GVN.panic-unwind.diff +++ b/tests/mir-opt/issue_101973.inner.GVN.panic-unwind.diff @@ -17,15 +17,11 @@ let mut _12: u32; let mut _13: bool; scope 1 (inlined imm8) { - debug x => _5; let mut _14: u32; scope 2 { - debug out => _4; } } scope 3 (inlined core::num::::rotate_right) { - debug self => _4; - debug n => _6; } bb0: { @@ -34,7 +30,7 @@ StorageLive(_4); StorageLive(_5); _5 = _1; - _4 = const 0_u32; + nop; - StorageLive(_14); - _14 = BitAnd(_5, const 255_u32); - _4 = BitOr(const 0_u32, move _14); @@ -74,7 +70,8 @@ bb2: { _6 = Shl(move _7, const 1_i32); StorageDead(_7); - _3 = rotate_right::(move _4, move _6) -> [return: bb3, unwind unreachable]; +- _3 = rotate_right::(move _4, move _6) -> [return: bb3, unwind unreachable]; ++ _3 = rotate_right::(_14, move _6) -> [return: bb3, unwind unreachable]; } bb3: { diff --git a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir index bc12002490a..8da56d59aaa 100644 --- a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-abort.mir @@ -3,66 +3,56 @@ fn num_to_digit(_1: char) -> u32 { debug num => _1; let mut _0: u32; - let mut _5: std::option::Option; + let mut _4: std::option::Option; scope 1 (inlined char::methods::::is_digit) { - debug self => _1; - debug radix => const 8_u32; let _2: std::option::Option; - let mut _3: &std::option::Option; scope 2 (inlined Option::::is_some) { - debug self => _3; - let mut _4: isize; + let mut _3: isize; } } scope 3 (inlined #[track_caller] Option::::unwrap) { - debug self => _5; - let mut _6: isize; - let mut _7: !; + let mut _5: isize; + let mut _6: !; scope 4 { - debug val => _0; } } bb0: { - StorageLive(_3); StorageLive(_2); _2 = char::methods::::to_digit(_1, const 8_u32) -> [return: bb1, unwind unreachable]; } bb1: { - _3 = &_2; - StorageLive(_4); - _4 = discriminant(_2); - switchInt(move _4) -> [1: bb2, 0: bb6, otherwise: bb8]; + StorageLive(_3); + _3 = discriminant(_2); + switchInt(move _3) -> [1: bb2, 0: bb6, otherwise: bb8]; } bb2: { - StorageDead(_4); StorageDead(_3); StorageDead(_2); - StorageLive(_5); - _5 = char::methods::::to_digit(move _1, const 8_u32) -> [return: bb3, unwind unreachable]; + StorageLive(_4); + _4 = char::methods::::to_digit(move _1, const 8_u32) -> [return: bb3, unwind unreachable]; } bb3: { - StorageLive(_6); - _6 = discriminant(_5); - switchInt(move _6) -> [0: bb4, 1: bb5, otherwise: bb8]; + StorageLive(_5); + _5 = discriminant(_4); + switchInt(move _5) -> [0: bb4, 1: bb5, otherwise: bb8]; } bb4: { - _7 = option::unwrap_failed() -> unwind unreachable; + _6 = option::unwrap_failed() -> unwind unreachable; } bb5: { - _0 = move ((_5 as Some).0: u32); - StorageDead(_6); + _0 = move ((_4 as Some).0: u32); StorageDead(_5); + StorageDead(_4); goto -> bb7; } bb6: { - StorageDead(_4); StorageDead(_3); StorageDead(_2); _0 = const 0_u32; diff --git a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir index 6c7e10a4525..61bc09d901c 100644 --- a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.panic-unwind.mir @@ -3,66 +3,56 @@ fn num_to_digit(_1: char) -> u32 { debug num => _1; let mut _0: u32; - let mut _5: std::option::Option; + let mut _4: std::option::Option; scope 1 (inlined char::methods::::is_digit) { - debug self => _1; - debug radix => const 8_u32; let _2: std::option::Option; - let mut _3: &std::option::Option; scope 2 (inlined Option::::is_some) { - debug self => _3; - let mut _4: isize; + let mut _3: isize; } } scope 3 (inlined #[track_caller] Option::::unwrap) { - debug self => _5; - let mut _6: isize; - let mut _7: !; + let mut _5: isize; + let mut _6: !; scope 4 { - debug val => _0; } } bb0: { - StorageLive(_3); StorageLive(_2); _2 = char::methods::::to_digit(_1, const 8_u32) -> [return: bb1, unwind continue]; } bb1: { - _3 = &_2; - StorageLive(_4); - _4 = discriminant(_2); - switchInt(move _4) -> [1: bb2, 0: bb6, otherwise: bb8]; + StorageLive(_3); + _3 = discriminant(_2); + switchInt(move _3) -> [1: bb2, 0: bb6, otherwise: bb8]; } bb2: { - StorageDead(_4); StorageDead(_3); StorageDead(_2); - StorageLive(_5); - _5 = char::methods::::to_digit(move _1, const 8_u32) -> [return: bb3, unwind continue]; + StorageLive(_4); + _4 = char::methods::::to_digit(move _1, const 8_u32) -> [return: bb3, unwind continue]; } bb3: { - StorageLive(_6); - _6 = discriminant(_5); - switchInt(move _6) -> [0: bb4, 1: bb5, otherwise: bb8]; + StorageLive(_5); + _5 = discriminant(_4); + switchInt(move _5) -> [0: bb4, 1: bb5, otherwise: bb8]; } bb4: { - _7 = option::unwrap_failed() -> unwind continue; + _6 = option::unwrap_failed() -> unwind continue; } bb5: { - _0 = move ((_5 as Some).0: u32); - StorageDead(_6); + _0 = move ((_4 as Some).0: u32); StorageDead(_5); + StorageDead(_4); goto -> bb7; } bb6: { - StorageDead(_4); StorageDead(_3); StorageDead(_2); _0 = const 0_u32; diff --git a/tests/mir-opt/jump_threading.identity.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.identity.JumpThreading.panic-abort.diff index d67477ab1b9..65379ae8b89 100644 --- a/tests/mir-opt/jump_threading.identity.JumpThreading.panic-abort.diff +++ b/tests/mir-opt/jump_threading.identity.JumpThreading.panic-abort.diff @@ -16,13 +16,10 @@ debug residual => _6; scope 2 { scope 8 (inlined #[track_caller] as FromResidual>>::from_residual) { - debug residual => _8; let _14: i32; let mut _15: i32; scope 9 { - debug e => _14; scope 10 (inlined >::from) { - debug t => _14; } } } @@ -34,16 +31,13 @@ } } scope 5 (inlined as Try>::branch) { - debug self => _4; let mut _10: isize; let _11: i32; let _12: i32; let mut _13: std::result::Result; scope 6 { - debug v => _11; } scope 7 { - debug e => _12; } } diff --git a/tests/mir-opt/jump_threading.identity.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.identity.JumpThreading.panic-unwind.diff index d67477ab1b9..65379ae8b89 100644 --- a/tests/mir-opt/jump_threading.identity.JumpThreading.panic-unwind.diff +++ b/tests/mir-opt/jump_threading.identity.JumpThreading.panic-unwind.diff @@ -16,13 +16,10 @@ debug residual => _6; scope 2 { scope 8 (inlined #[track_caller] as FromResidual>>::from_residual) { - debug residual => _8; let _14: i32; let mut _15: i32; scope 9 { - debug e => _14; scope 10 (inlined >::from) { - debug t => _14; } } } @@ -34,16 +31,13 @@ } } scope 5 (inlined as Try>::branch) { - debug self => _4; let mut _10: isize; let _11: i32; let _12: i32; let mut _13: std::result::Result; scope 6 { - debug v => _11; } scope 7 { - debug e => _12; } } diff --git a/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.mir index 845673601b2..cadebcdf1f8 100644 --- a/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.mir @@ -13,17 +13,11 @@ fn checked_shl(_1: u32, _2: u32) -> Option { debug b => _5; } scope 3 (inlined core::num::::overflowing_shl) { - debug self => _1; - debug rhs => _2; let mut _4: u32; let mut _5: bool; scope 4 (inlined core::num::::wrapping_shl) { - debug self => _1; - debug rhs => _2; let mut _3: u32; scope 5 (inlined core::num::::unchecked_shl) { - debug self => _1; - debug rhs => _3; } } } diff --git a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.mir index f1d0da28b4e..abbd170b4b9 100644 --- a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.mir @@ -4,12 +4,89 @@ fn step_forward(_1: u32, _2: usize) -> u32 { debug x => _1; debug n => _2; let mut _0: u32; + scope 1 (inlined ::forward) { + debug start => _1; + debug n => _2; + let mut _8: u32; + scope 2 { + } + scope 3 (inlined ::forward_checked) { + scope 4 { + scope 6 (inlined core::num::::checked_add) { + let mut _7: bool; + scope 7 { + } + scope 8 (inlined core::num::::overflowing_add) { + let mut _5: (u32, bool); + let _6: bool; + scope 9 { + } + } + } + } + scope 5 (inlined convert::num::ptr_try_from_impls:: for u32>::try_from) { + let mut _3: bool; + let mut _4: u32; + } + } + scope 10 (inlined Option::::is_none) { + scope 11 (inlined Option::::is_some) { + } + } + scope 12 (inlined core::num::::wrapping_add) { + } + } bb0: { - _0 = ::forward(move _1, move _2) -> [return: bb1, unwind continue]; + StorageLive(_4); + StorageLive(_3); + _3 = Gt(_2, const 4294967295_usize); + switchInt(move _3) -> [0: bb1, otherwise: bb5]; } bb1: { + _4 = _2 as u32 (IntToInt); + StorageDead(_3); + StorageLive(_6); + StorageLive(_5); + _5 = CheckedAdd(_1, _4); + _6 = (_5.1: bool); + StorageDead(_5); + StorageLive(_7); + _7 = unlikely(move _6) -> [return: bb2, unwind unreachable]; + } + + bb2: { + switchInt(move _7) -> [0: bb3, otherwise: bb4]; + } + + bb3: { + StorageDead(_7); + StorageDead(_6); + goto -> bb7; + } + + bb4: { + StorageDead(_7); + StorageDead(_6); + goto -> bb6; + } + + bb5: { + StorageDead(_3); + goto -> bb6; + } + + bb6: { + assert(!const true, "attempt to compute `{} + {}`, which would overflow", const core::num::::MAX, const 1_u32) -> [success: bb7, unwind continue]; + } + + bb7: { + StorageLive(_8); + _8 = _2 as u32 (IntToInt); + _0 = Add(_1, _8); + StorageDead(_8); + StorageDead(_4); return; } } diff --git a/tests/mir-opt/pre-codegen/derived_ord.{impl#0}-partial_cmp.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/derived_ord.{impl#0}-partial_cmp.PreCodegen.after.mir index a6c64425912..47f10451b05 100644 --- a/tests/mir-opt/pre-codegen/derived_ord.{impl#0}-partial_cmp.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/derived_ord.{impl#0}-partial_cmp.PreCodegen.after.mir @@ -4,71 +4,51 @@ fn ::partial_cmp(_1: &MultiField, _2: &M debug self => _1; debug other => _2; let mut _0: std::option::Option; - let mut _3: &char; - let mut _4: &char; - let mut _8: std::option::Option; - let mut _9: i8; - let mut _10: &i16; - let mut _11: &i16; + let mut _6: std::option::Option; + let mut _7: i8; scope 1 { - debug cmp => _8; + debug cmp => _6; } scope 2 (inlined std::cmp::impls::::partial_cmp) { - debug self => _3; - debug other => _4; - let mut _5: char; - let mut _6: char; - let mut _7: std::cmp::Ordering; + let mut _3: char; + let mut _4: char; + let mut _5: std::cmp::Ordering; } scope 3 (inlined std::cmp::impls::::partial_cmp) { - debug self => _10; - debug other => _11; - let mut _12: i16; - let mut _13: i16; - let mut _14: std::cmp::Ordering; + let mut _8: i16; + let mut _9: i16; + let mut _10: std::cmp::Ordering; } bb0: { StorageLive(_3); - _3 = &((*_1).0: char); + _3 = ((*_1).0: char); StorageLive(_4); - _4 = &((*_2).0: char); - StorageLive(_5); - _5 = ((*_1).0: char); - StorageLive(_6); - _6 = ((*_2).0: char); - _7 = Cmp(move _5, move _6); - StorageDead(_6); - StorageDead(_5); - _8 = Option::::Some(_7); + _4 = ((*_2).0: char); + _5 = Cmp(move _3, move _4); StorageDead(_4); StorageDead(_3); - _9 = discriminant(_7); - switchInt(move _9) -> [0: bb1, otherwise: bb2]; + _6 = Option::::Some(_5); + _7 = discriminant(_5); + switchInt(move _7) -> [0: bb1, otherwise: bb2]; } bb1: { StorageLive(_10); - _10 = &((*_1).1: i16); - StorageLive(_11); - _11 = &((*_2).1: i16); - StorageLive(_14); - StorageLive(_12); - _12 = ((*_1).1: i16); - StorageLive(_13); - _13 = ((*_2).1: i16); - _14 = Cmp(move _12, move _13); - StorageDead(_13); - StorageDead(_12); - _0 = Option::::Some(move _14); - StorageDead(_14); - StorageDead(_11); + StorageLive(_8); + _8 = ((*_1).1: i16); + StorageLive(_9); + _9 = ((*_2).1: i16); + _10 = Cmp(move _8, move _9); + StorageDead(_9); + StorageDead(_8); + _0 = Option::::Some(move _10); StorageDead(_10); goto -> bb3; } bb2: { - _0 = _8; + _0 = _6; goto -> bb3; } diff --git a/tests/mir-opt/pre-codegen/intrinsics.f_u64.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/intrinsics.f_u64.PreCodegen.after.mir index 174fb2c0c3c..1109da31d95 100644 --- a/tests/mir-opt/pre-codegen/intrinsics.f_u64.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/intrinsics.f_u64.PreCodegen.after.mir @@ -3,7 +3,6 @@ fn f_u64() -> () { let mut _0: (); scope 1 (inlined f_dispatch::) { - debug t => const 0_u64; let _1: (); scope 2 (inlined std::mem::size_of::) { } diff --git a/tests/mir-opt/pre-codegen/intrinsics.f_unit.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/intrinsics.f_unit.PreCodegen.after.mir index 578cb2d7069..2768c2bb2d7 100644 --- a/tests/mir-opt/pre-codegen/intrinsics.f_unit.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/intrinsics.f_unit.PreCodegen.after.mir @@ -3,7 +3,6 @@ fn f_unit() -> () { let mut _0: (); scope 1 (inlined f_dispatch::<()>) { - debug t => const (); let _1: (); scope 2 (inlined std::mem::size_of::<()>) { } diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff index 2865b829e3e..17d83752fc1 100644 --- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff @@ -18,11 +18,8 @@ debug ptr => _3; } scope 5 (inlined ::allocate) { - debug self => _9; - debug layout => _8; } scope 6 (inlined #[track_caller] Result::, std::alloc::AllocError>::unwrap) { - debug self => _6; let mut _12: isize; let _13: std::alloc::AllocError; let mut _14: !; @@ -30,23 +27,18 @@ let mut _16: &dyn std::fmt::Debug; let mut _17: &std::alloc::AllocError; scope 7 { - debug t => _5; } scope 8 { - debug e => const std::alloc::AllocError; } } scope 9 (inlined NonNull::<[u8]>::as_ptr) { - debug self => _5; let mut _18: *const [u8]; } } scope 3 (inlined #[track_caller] Option::::unwrap) { - debug self => _2; let mut _10: isize; let mut _11: !; scope 4 { - debug val => _1; } } diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff index 603b1405562..4a37c860320 100644 --- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff @@ -18,20 +18,15 @@ debug ptr => _3; } scope 5 (inlined ::allocate) { - debug self => _9; - debug layout => _8; } scope 6 (inlined NonNull::<[u8]>::as_ptr) { - debug self => _5; let mut _12: *const [u8]; } } scope 3 (inlined #[track_caller] Option::::unwrap) { - debug self => _2; let mut _10: isize; let mut _11: !; scope 4 { - debug val => _1; } } diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff index 44964392dd6..1cf950402c3 100644 --- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff @@ -18,11 +18,8 @@ debug ptr => _3; } scope 5 (inlined ::allocate) { - debug self => _9; - debug layout => _8; } scope 6 (inlined #[track_caller] Result::, std::alloc::AllocError>::unwrap) { - debug self => _6; let mut _12: isize; let _13: std::alloc::AllocError; let mut _14: !; @@ -30,23 +27,18 @@ let mut _16: &dyn std::fmt::Debug; let mut _17: &std::alloc::AllocError; scope 7 { - debug t => _5; } scope 8 { - debug e => const std::alloc::AllocError; } } scope 9 (inlined NonNull::<[u8]>::as_ptr) { - debug self => _5; let mut _18: *const [u8]; } } scope 3 (inlined #[track_caller] Option::::unwrap) { - debug self => _2; let mut _10: isize; let mut _11: !; scope 4 { - debug val => _1; } } diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff index 5fd4af21a11..ec2e95fecb6 100644 --- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff @@ -18,20 +18,15 @@ debug ptr => _3; } scope 5 (inlined ::allocate) { - debug self => _9; - debug layout => _8; } scope 6 (inlined NonNull::<[u8]>::as_ptr) { - debug self => _5; let mut _12: *const [u8]; } } scope 3 (inlined #[track_caller] Option::::unwrap) { - debug self => _2; let mut _10: isize; let mut _11: !; scope 4 { - debug val => _1; } } diff --git a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-abort.mir index c744787fce2..a3dc54f73c8 100644 --- a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-abort.mir @@ -5,17 +5,11 @@ fn mem_replace(_1: &mut u32, _2: u32) -> u32 { debug v => _2; let mut _0: u32; scope 1 (inlined std::mem::replace::) { - debug dest => _1; - debug src => _2; scope 2 { - debug result => _0; scope 4 (inlined std::ptr::write::) { - debug dst => _1; - debug src => _2; } } scope 3 (inlined std::ptr::read::) { - debug src => _1; } } diff --git a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-unwind.mir index c744787fce2..a3dc54f73c8 100644 --- a/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/mem_replace.mem_replace.PreCodegen.after.panic-unwind.mir @@ -5,17 +5,11 @@ fn mem_replace(_1: &mut u32, _2: u32) -> u32 { debug v => _2; let mut _0: u32; scope 1 (inlined std::mem::replace::) { - debug dest => _1; - debug src => _2; scope 2 { - debug result => _0; scope 4 (inlined std::ptr::write::) { - debug dst => _1; - debug src => _2; } } scope 3 (inlined std::ptr::read::) { - debug src => _1; } } diff --git a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir index 002d55ad9d9..96b4962854d 100644 --- a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir @@ -5,77 +5,56 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { debug end => _2; debug f => _3; let mut _0: (); - let mut _4: std::ops::Range; - let mut _5: std::ops::Range; - let mut _6: &mut std::ops::Range; - let mut _14: std::option::Option; - let mut _16: &impl Fn(u32); - let mut _17: (u32,); - let _18: (); + let mut _4: u32; + let mut _9: std::option::Option; + let mut _11: &impl Fn(u32); + let mut _12: (u32,); + let _13: (); scope 1 { - debug iter => _5; - let _15: u32; + debug ((iter: std::ops::Range).0: u32) => _4; + debug ((iter: std::ops::Range).1: u32) => _2; + let _10: u32; scope 2 { - debug x => _15; + debug x => _10; } scope 4 (inlined iter::range::>::next) { - debug self => _6; scope 5 (inlined as iter::range::RangeIteratorImpl>::spec_next) { - debug self => _6; - let mut _7: &u32; - let mut _8: &u32; - let mut _11: bool; - let _12: u32; - let mut _13: u32; + let mut _6: bool; + let _7: u32; + let mut _8: u32; scope 6 { - debug old => _12; } scope 7 (inlined std::cmp::impls::::lt) { - debug self => _7; - debug other => _8; - let mut _9: u32; - let mut _10: u32; + let mut _5: u32; } } } } scope 3 (inlined as IntoIterator>::into_iter) { - debug self => _4; } bb0: { - _4 = std::ops::Range:: { start: _1, end: _2 }; - StorageLive(_5); - _5 = _4; + StorageLive(_4); + _4 = _1; goto -> bb1; } bb1: { - StorageLive(_14); - _6 = &mut _5; - StorageLive(_12); - StorageLive(_11); - StorageLive(_7); - _7 = &(_5.0: u32); - StorageLive(_8); - _8 = &(_5.1: u32); StorageLive(_9); - _9 = (_5.0: u32); - StorageLive(_10); - _10 = (_5.1: u32); - _11 = Lt(move _9, move _10); - StorageDead(_10); - StorageDead(_9); - switchInt(move _11) -> [0: bb2, otherwise: bb4]; + StorageLive(_7); + StorageLive(_6); + StorageLive(_5); + _5 = _4; + _6 = Lt(move _5, _2); + StorageDead(_5); + switchInt(move _6) -> [0: bb2, otherwise: bb4]; } bb2: { - StorageDead(_8); + StorageDead(_6); StorageDead(_7); - StorageDead(_11); - StorageDead(_12); - StorageDead(_14); - StorageDead(_5); + StorageDead(_9); + StorageDead(_4); drop(_3) -> [return: bb3, unwind unreachable]; } @@ -84,31 +63,29 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { } bb4: { - StorageDead(_8); - StorageDead(_7); - _12 = (_5.0: u32); - StorageLive(_13); - _13 = ::forward_unchecked(_12, const 1_usize) -> [return: bb5, unwind unreachable]; + _7 = _4; + StorageLive(_8); + _8 = ::forward_unchecked(_7, const 1_usize) -> [return: bb5, unwind unreachable]; } bb5: { - (_5.0: u32) = move _13; - StorageDead(_13); - _14 = Option::::Some(_12); - StorageDead(_11); - StorageDead(_12); - _15 = ((_14 as Some).0: u32); - StorageLive(_16); - _16 = &_3; - StorageLive(_17); - _17 = (_15,); - _18 = >::call(move _16, move _17) -> [return: bb6, unwind unreachable]; + _4 = move _8; + StorageDead(_8); + _9 = Option::::Some(_7); + StorageDead(_6); + StorageDead(_7); + _10 = ((_9 as Some).0: u32); + StorageLive(_11); + _11 = &_3; + StorageLive(_12); + _12 = (_10,); + _13 = >::call(move _11, move _12) -> [return: bb6, unwind unreachable]; } bb6: { - StorageDead(_17); - StorageDead(_16); - StorageDead(_14); + StorageDead(_12); + StorageDead(_11); + StorageDead(_9); goto -> bb1; } } diff --git a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir index d5021ac84d2..ce8e2bd083e 100644 --- a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir @@ -5,77 +5,56 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { debug end => _2; debug f => _3; let mut _0: (); - let mut _4: std::ops::Range; - let mut _5: std::ops::Range; - let mut _6: &mut std::ops::Range; - let mut _14: std::option::Option; - let mut _16: &impl Fn(u32); - let mut _17: (u32,); - let _18: (); + let mut _4: u32; + let mut _9: std::option::Option; + let mut _11: &impl Fn(u32); + let mut _12: (u32,); + let _13: (); scope 1 { - debug iter => _5; - let _15: u32; + debug ((iter: std::ops::Range).0: u32) => _4; + debug ((iter: std::ops::Range).1: u32) => _2; + let _10: u32; scope 2 { - debug x => _15; + debug x => _10; } scope 4 (inlined iter::range::>::next) { - debug self => _6; scope 5 (inlined as iter::range::RangeIteratorImpl>::spec_next) { - debug self => _6; - let mut _7: &u32; - let mut _8: &u32; - let mut _11: bool; - let _12: u32; - let mut _13: u32; + let mut _6: bool; + let _7: u32; + let mut _8: u32; scope 6 { - debug old => _12; } scope 7 (inlined std::cmp::impls::::lt) { - debug self => _7; - debug other => _8; - let mut _9: u32; - let mut _10: u32; + let mut _5: u32; } } } } scope 3 (inlined as IntoIterator>::into_iter) { - debug self => _4; } bb0: { - _4 = std::ops::Range:: { start: _1, end: _2 }; - StorageLive(_5); - _5 = _4; + StorageLive(_4); + _4 = _1; goto -> bb1; } bb1: { - StorageLive(_14); - _6 = &mut _5; - StorageLive(_12); - StorageLive(_11); - StorageLive(_7); - _7 = &(_5.0: u32); - StorageLive(_8); - _8 = &(_5.1: u32); StorageLive(_9); - _9 = (_5.0: u32); - StorageLive(_10); - _10 = (_5.1: u32); - _11 = Lt(move _9, move _10); - StorageDead(_10); - StorageDead(_9); - switchInt(move _11) -> [0: bb2, otherwise: bb4]; + StorageLive(_7); + StorageLive(_6); + StorageLive(_5); + _5 = _4; + _6 = Lt(move _5, _2); + StorageDead(_5); + switchInt(move _6) -> [0: bb2, otherwise: bb4]; } bb2: { - StorageDead(_8); + StorageDead(_6); StorageDead(_7); - StorageDead(_11); - StorageDead(_12); - StorageDead(_14); - StorageDead(_5); + StorageDead(_9); + StorageDead(_4); drop(_3) -> [return: bb3, unwind continue]; } @@ -84,31 +63,29 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { } bb4: { - StorageDead(_8); - StorageDead(_7); - _12 = (_5.0: u32); - StorageLive(_13); - _13 = ::forward_unchecked(_12, const 1_usize) -> [return: bb5, unwind: bb7]; + _7 = _4; + StorageLive(_8); + _8 = ::forward_unchecked(_7, const 1_usize) -> [return: bb5, unwind: bb7]; } bb5: { - (_5.0: u32) = move _13; - StorageDead(_13); - _14 = Option::::Some(_12); - StorageDead(_11); - StorageDead(_12); - _15 = ((_14 as Some).0: u32); - StorageLive(_16); - _16 = &_3; - StorageLive(_17); - _17 = (_15,); - _18 = >::call(move _16, move _17) -> [return: bb6, unwind: bb7]; + _4 = move _8; + StorageDead(_8); + _9 = Option::::Some(_7); + StorageDead(_6); + StorageDead(_7); + _10 = ((_9 as Some).0: u32); + StorageLive(_11); + _11 = &_3; + StorageLive(_12); + _12 = (_10,); + _13 = >::call(move _11, move _12) -> [return: bb6, unwind: bb7]; } bb6: { - StorageDead(_17); - StorageDead(_16); - StorageDead(_14); + StorageDead(_12); + StorageDead(_11); + StorageDead(_9); goto -> bb1; } diff --git a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir index 0836600cb6e..ce79a33013d 100644 --- a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir @@ -20,15 +20,11 @@ fn inclusive_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { debug x => _9; } scope 5 (inlined iter::range::>::next) { - debug self => _6; } } scope 3 (inlined RangeInclusive::::new) { - debug start => _1; - debug end => _2; } scope 4 (inlined as IntoIterator>::into_iter) { - debug self => _4; } bb0: { diff --git a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir index 8c1794de524..602ecb7c9b8 100644 --- a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir @@ -20,15 +20,11 @@ fn inclusive_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () { debug x => _9; } scope 5 (inlined iter::range::>::next) { - debug self => _6; } } scope 3 (inlined RangeInclusive::::new) { - debug start => _1; - debug end => _2; } scope 4 (inlined as IntoIterator>::into_iter) { - debug self => _4; } bb0: { diff --git a/tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.panic-abort.mir index b0f475b4db7..8e038246fa2 100644 --- a/tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.panic-abort.mir @@ -4,7 +4,6 @@ fn range_inclusive_iter_next(_1: &mut RangeInclusive) -> Option { debug it => _1; let mut _0: std::option::Option; scope 1 (inlined iter::range::>::next) { - debug self => _1; } bb0: { diff --git a/tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.panic-unwind.mir index 663ec229f72..f54d003c662 100644 --- a/tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/range_iter.range_inclusive_iter_next.PreCodegen.after.panic-unwind.mir @@ -4,7 +4,6 @@ fn range_inclusive_iter_next(_1: &mut RangeInclusive) -> Option { debug it => _1; let mut _0: std::option::Option; scope 1 (inlined iter::range::>::next) { - debug self => _1; } bb0: { diff --git a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir index 7faae1d863c..2ac7e880ccb 100644 --- a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-abort.mir @@ -4,68 +4,53 @@ fn range_iter_next(_1: &mut std::ops::Range) -> Option { debug it => _1; let mut _0: std::option::Option; scope 1 (inlined iter::range::>::next) { - debug self => _1; scope 2 (inlined as iter::range::RangeIteratorImpl>::spec_next) { - debug self => _1; - let mut _2: &u32; - let mut _3: &u32; - let mut _6: bool; - let _7: u32; - let mut _8: u32; + let mut _4: bool; + let _5: u32; + let mut _6: u32; scope 3 { - debug old => _7; } scope 4 (inlined std::cmp::impls::::lt) { - debug self => _2; - debug other => _3; - let mut _4: u32; - let mut _5: u32; + let mut _2: u32; + let mut _3: u32; } } } bb0: { - StorageLive(_7); - StorageLive(_6); - StorageLive(_2); - _2 = &((*_1).0: u32); - StorageLive(_3); - _3 = &((*_1).1: u32); - StorageLive(_4); - _4 = ((*_1).0: u32); StorageLive(_5); - _5 = ((*_1).1: u32); - _6 = Lt(move _4, move _5); - StorageDead(_5); - StorageDead(_4); - switchInt(move _6) -> [0: bb1, otherwise: bb2]; + StorageLive(_4); + StorageLive(_2); + _2 = ((*_1).0: u32); + StorageLive(_3); + _3 = ((*_1).1: u32); + _4 = Lt(move _2, move _3); + StorageDead(_3); + StorageDead(_2); + switchInt(move _4) -> [0: bb1, otherwise: bb2]; } bb1: { - StorageDead(_3); - StorageDead(_2); _0 = const Option::::None; goto -> bb4; } bb2: { - StorageDead(_3); - StorageDead(_2); - _7 = ((*_1).0: u32); - StorageLive(_8); - _8 = ::forward_unchecked(_7, const 1_usize) -> [return: bb3, unwind unreachable]; + _5 = ((*_1).0: u32); + StorageLive(_6); + _6 = ::forward_unchecked(_5, const 1_usize) -> [return: bb3, unwind unreachable]; } bb3: { - ((*_1).0: u32) = move _8; - StorageDead(_8); - _0 = Option::::Some(_7); + ((*_1).0: u32) = move _6; + StorageDead(_6); + _0 = Option::::Some(_5); goto -> bb4; } bb4: { - StorageDead(_6); - StorageDead(_7); + StorageDead(_4); + StorageDead(_5); return; } } diff --git a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir index 37f00533b60..60bf644fce6 100644 --- a/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/range_iter.range_iter_next.PreCodegen.after.panic-unwind.mir @@ -4,68 +4,53 @@ fn range_iter_next(_1: &mut std::ops::Range) -> Option { debug it => _1; let mut _0: std::option::Option; scope 1 (inlined iter::range::>::next) { - debug self => _1; scope 2 (inlined as iter::range::RangeIteratorImpl>::spec_next) { - debug self => _1; - let mut _2: &u32; - let mut _3: &u32; - let mut _6: bool; - let _7: u32; - let mut _8: u32; + let mut _4: bool; + let _5: u32; + let mut _6: u32; scope 3 { - debug old => _7; } scope 4 (inlined std::cmp::impls::::lt) { - debug self => _2; - debug other => _3; - let mut _4: u32; - let mut _5: u32; + let mut _2: u32; + let mut _3: u32; } } } bb0: { - StorageLive(_7); - StorageLive(_6); - StorageLive(_2); - _2 = &((*_1).0: u32); - StorageLive(_3); - _3 = &((*_1).1: u32); - StorageLive(_4); - _4 = ((*_1).0: u32); StorageLive(_5); - _5 = ((*_1).1: u32); - _6 = Lt(move _4, move _5); - StorageDead(_5); - StorageDead(_4); - switchInt(move _6) -> [0: bb1, otherwise: bb2]; + StorageLive(_4); + StorageLive(_2); + _2 = ((*_1).0: u32); + StorageLive(_3); + _3 = ((*_1).1: u32); + _4 = Lt(move _2, move _3); + StorageDead(_3); + StorageDead(_2); + switchInt(move _4) -> [0: bb1, otherwise: bb2]; } bb1: { - StorageDead(_3); - StorageDead(_2); _0 = const Option::::None; goto -> bb4; } bb2: { - StorageDead(_3); - StorageDead(_2); - _7 = ((*_1).0: u32); - StorageLive(_8); - _8 = ::forward_unchecked(_7, const 1_usize) -> [return: bb3, unwind continue]; + _5 = ((*_1).0: u32); + StorageLive(_6); + _6 = ::forward_unchecked(_5, const 1_usize) -> [return: bb3, unwind continue]; } bb3: { - ((*_1).0: u32) = move _8; - StorageDead(_8); - _0 = Option::::Some(_7); + ((*_1).0: u32) = move _6; + StorageDead(_6); + _0 = Option::::Some(_5); goto -> bb4; } bb4: { - StorageDead(_6); - StorageDead(_7); + StorageDead(_4); + StorageDead(_5); return; } } diff --git a/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir index 7265a4fc942..030f9c3b93e 100644 --- a/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir @@ -4,15 +4,11 @@ fn ezmap(_1: Option) -> Option { debug x => _1; let mut _0: std::option::Option; scope 1 (inlined map::) { - debug slf => _1; - debug f => const ZeroSized: {closure@$DIR/simple_option_map.rs:17:12: 17:15}; let mut _2: isize; let _3: i32; let mut _4: i32; scope 2 { - debug x => _3; scope 3 (inlined ezmap::{closure#0}) { - debug n => _3; } } } diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir index 153505b1bbb..7e20817cf23 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir @@ -5,8 +5,6 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> { debug index => _2; let mut _0: std::option::Option<&mut u32>; scope 1 (inlined core::slice::::get_mut::) { - debug self => _1; - debug index => _2; } bb0: { diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir index d37ee783117..2f65b8c6401 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir @@ -5,8 +5,6 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> { debug index => _2; let mut _0: std::option::Option<&mut u32>; scope 1 (inlined core::slice::::get_mut::) { - debug self => _1; - debug index => _2; } bb0: { diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir index e5490955a36..ef3f4a21720 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir @@ -5,8 +5,6 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range) -> debug index => _2; let mut _0: &mut [u32]; scope 1 (inlined core::slice::::get_unchecked_mut::>) { - debug self => _1; - debug index => _2; let mut _3: *mut [u32]; let mut _4: *mut [u32]; } diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir index 810fee9a149..9e93a43ac72 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir @@ -5,8 +5,6 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range) -> debug index => _2; let mut _0: &mut [u32]; scope 1 (inlined core::slice::::get_unchecked_mut::>) { - debug self => _1; - debug index => _2; let mut _3: *mut [u32]; let mut _4: *mut [u32]; } diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.panic-abort.mir index d97c96ac8a0..731f6438a6e 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.panic-abort.mir @@ -5,8 +5,6 @@ fn slice_index_range(_1: &[u32], _2: std::ops::Range) -> &[u32] { debug index => _2; let mut _0: &[u32]; scope 1 (inlined #[track_caller] core::slice::index::> for [u32]>::index) { - debug self => _1; - debug index => _2; } bb0: { diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.panic-unwind.mir index 4a976002fa5..d879d06bb4e 100644 --- a/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.panic-unwind.mir @@ -5,8 +5,6 @@ fn slice_index_range(_1: &[u32], _2: std::ops::Range) -> &[u32] { debug index => _2; let mut _0: &[u32]; scope 1 (inlined #[track_caller] core::slice::index::> for [u32]>::index) { - debug self => _1; - debug index => _2; } bb0: { diff --git a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir index 1ec85906385..d979c5ec1d5 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir @@ -4,147 +4,128 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { debug slice => _1; debug f => _2; let mut _0: (); - let mut _13: std::slice::Iter<'_, T>; + let mut _12: std::slice::Iter<'_, T>; + let mut _13: std::iter::Enumerate>; let mut _14: std::iter::Enumerate>; - let mut _15: std::iter::Enumerate>; - let mut _16: &mut std::iter::Enumerate>; - let mut _17: std::option::Option<(usize, &T)>; - let mut _18: isize; - let mut _21: &impl Fn(usize, &T); - let mut _22: (usize, &T); - let _23: (); + let mut _15: &mut std::iter::Enumerate>; + let mut _16: std::option::Option<(usize, &T)>; + let mut _17: isize; + let mut _20: &impl Fn(usize, &T); + let mut _21: (usize, &T); + let _22: (); scope 1 { - debug iter => _15; - let _19: usize; - let _20: &T; + debug iter => _14; + let _18: usize; + let _19: &T; scope 2 { - debug i => _19; - debug x => _20; + debug i => _18; + debug x => _19; } } scope 3 (inlined core::slice::::iter) { - debug self => _1; scope 4 (inlined std::slice::Iter::<'_, T>::new) { - debug slice => _1; let _3: usize; - let mut _5: std::ptr::NonNull<[T]>; - let mut _8: bool; + let mut _7: bool; + let mut _8: *mut T; let mut _9: *mut T; - let mut _10: *mut T; - let mut _12: *const T; + let mut _11: *const T; scope 5 { - debug len => _3; - let _7: std::ptr::NonNull; + let _6: std::ptr::NonNull; scope 6 { - debug ptr => _7; - let _11: *const T; + let _10: *const T; scope 7 { - debug end_or_len => _11; } scope 11 (inlined without_provenance::) { - debug addr => _3; } scope 12 (inlined NonNull::::as_ptr) { - debug self => _7; } scope 13 (inlined std::ptr::mut_ptr::::add) { - debug self => _9; - debug count => _3; } } scope 8 (inlined as From<&[T]>>::from) { - debug reference => _1; let mut _4: *const [T]; } scope 9 (inlined NonNull::<[T]>::cast::) { - debug self => _5; - let mut _6: *const T; + let mut _5: *const T; scope 10 (inlined NonNull::<[T]>::as_ptr) { - debug self => _5; } } } } } scope 14 (inlined as Iterator>::enumerate) { - debug self => _13; scope 15 (inlined Enumerate::>::new) { - debug iter => _13; } } scope 16 (inlined > as IntoIterator>::into_iter) { - debug self => _14; } bb0: { - StorageLive(_13); + StorageLive(_12); StorageLive(_3); - StorageLive(_7); - StorageLive(_4); StorageLive(_6); - _3 = Len((*_1)); + StorageLive(_4); StorageLive(_5); + _3 = Len((*_1)); _4 = &raw const (*_1); - _5 = NonNull::<[T]> { pointer: _4 }; - _6 = _4 as *const T (PtrToPtr); - _7 = NonNull:: { pointer: _6 }; - StorageDead(_5); - StorageLive(_11); - StorageLive(_8); - _8 = const ::IS_ZST; - switchInt(move _8) -> [0: bb1, otherwise: bb2]; + _5 = _4 as *const T (PtrToPtr); + _6 = NonNull:: { pointer: _5 }; + StorageLive(_10); + StorageLive(_7); + _7 = const ::IS_ZST; + switchInt(move _7) -> [0: bb1, otherwise: bb2]; } bb1: { - StorageLive(_10); StorageLive(_9); - _9 = _4 as *mut T (PtrToPtr); - _10 = Offset(_9, _3); + StorageLive(_8); + _8 = _4 as *mut T (PtrToPtr); + _9 = Offset(_8, _3); + StorageDead(_8); + _10 = move _9 as *const T (PointerCoercion(MutToConstPointer)); StorageDead(_9); - _11 = move _10 as *const T (PointerCoercion(MutToConstPointer)); - StorageDead(_10); goto -> bb3; } bb2: { - _11 = _3 as *const T (Transmute); + _10 = _3 as *const T (Transmute); goto -> bb3; } bb3: { - StorageDead(_8); - StorageLive(_12); - _12 = _11; - _13 = std::slice::Iter::<'_, T> { ptr: _7, end_or_len: move _12, _marker: const ZeroSized: PhantomData<&T> }; - StorageDead(_12); - StorageDead(_11); - StorageDead(_6); - StorageDead(_4); StorageDead(_7); + StorageLive(_11); + _11 = _10; + _12 = std::slice::Iter::<'_, T> { ptr: _6, end_or_len: move _11, _marker: const ZeroSized: PhantomData<&T> }; + StorageDead(_11); + StorageDead(_10); + StorageDead(_5); + StorageDead(_4); + StorageDead(_6); StorageDead(_3); - _14 = Enumerate::> { iter: _13, count: const 0_usize }; - StorageDead(_13); - StorageLive(_15); - _15 = _14; + _13 = Enumerate::> { iter: _12, count: const 0_usize }; + StorageDead(_12); + StorageLive(_14); + _14 = _13; goto -> bb4; } bb4: { - StorageLive(_17); StorageLive(_16); - _16 = &mut _15; - _17 = > as Iterator>::next(move _16) -> [return: bb5, unwind unreachable]; + StorageLive(_15); + _15 = &mut _14; + _16 = > as Iterator>::next(move _15) -> [return: bb5, unwind unreachable]; } bb5: { - StorageDead(_16); - _18 = discriminant(_17); - switchInt(move _18) -> [0: bb6, 1: bb8, otherwise: bb10]; + StorageDead(_15); + _17 = discriminant(_16); + switchInt(move _17) -> [0: bb6, 1: bb8, otherwise: bb10]; } bb6: { - StorageDead(_17); - StorageDead(_15); + StorageDead(_16); + StorageDead(_14); drop(_2) -> [return: bb7, unwind unreachable]; } @@ -153,19 +134,19 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb8: { - _19 = (((_17 as Some).0: (usize, &T)).0: usize); - _20 = (((_17 as Some).0: (usize, &T)).1: &T); + _18 = (((_16 as Some).0: (usize, &T)).0: usize); + _19 = (((_16 as Some).0: (usize, &T)).1: &T); + StorageLive(_20); + _20 = &_2; StorageLive(_21); - _21 = &_2; - StorageLive(_22); - _22 = (_19, _20); - _23 = >::call(move _21, move _22) -> [return: bb9, unwind unreachable]; + _21 = (_18, _19); + _22 = >::call(move _20, move _21) -> [return: bb9, unwind unreachable]; } bb9: { - StorageDead(_22); StorageDead(_21); - StorageDead(_17); + StorageDead(_20); + StorageDead(_16); goto -> bb4; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir index 70cdf3f41c2..8491c49f767 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir @@ -4,147 +4,128 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { debug slice => _1; debug f => _2; let mut _0: (); - let mut _13: std::slice::Iter<'_, T>; + let mut _12: std::slice::Iter<'_, T>; + let mut _13: std::iter::Enumerate>; let mut _14: std::iter::Enumerate>; - let mut _15: std::iter::Enumerate>; - let mut _16: &mut std::iter::Enumerate>; - let mut _17: std::option::Option<(usize, &T)>; - let mut _18: isize; - let mut _21: &impl Fn(usize, &T); - let mut _22: (usize, &T); - let _23: (); + let mut _15: &mut std::iter::Enumerate>; + let mut _16: std::option::Option<(usize, &T)>; + let mut _17: isize; + let mut _20: &impl Fn(usize, &T); + let mut _21: (usize, &T); + let _22: (); scope 1 { - debug iter => _15; - let _19: usize; - let _20: &T; + debug iter => _14; + let _18: usize; + let _19: &T; scope 2 { - debug i => _19; - debug x => _20; + debug i => _18; + debug x => _19; } } scope 3 (inlined core::slice::::iter) { - debug self => _1; scope 4 (inlined std::slice::Iter::<'_, T>::new) { - debug slice => _1; let _3: usize; - let mut _5: std::ptr::NonNull<[T]>; - let mut _8: bool; + let mut _7: bool; + let mut _8: *mut T; let mut _9: *mut T; - let mut _10: *mut T; - let mut _12: *const T; + let mut _11: *const T; scope 5 { - debug len => _3; - let _7: std::ptr::NonNull; + let _6: std::ptr::NonNull; scope 6 { - debug ptr => _7; - let _11: *const T; + let _10: *const T; scope 7 { - debug end_or_len => _11; } scope 11 (inlined without_provenance::) { - debug addr => _3; } scope 12 (inlined NonNull::::as_ptr) { - debug self => _7; } scope 13 (inlined std::ptr::mut_ptr::::add) { - debug self => _9; - debug count => _3; } } scope 8 (inlined as From<&[T]>>::from) { - debug reference => _1; let mut _4: *const [T]; } scope 9 (inlined NonNull::<[T]>::cast::) { - debug self => _5; - let mut _6: *const T; + let mut _5: *const T; scope 10 (inlined NonNull::<[T]>::as_ptr) { - debug self => _5; } } } } } scope 14 (inlined as Iterator>::enumerate) { - debug self => _13; scope 15 (inlined Enumerate::>::new) { - debug iter => _13; } } scope 16 (inlined > as IntoIterator>::into_iter) { - debug self => _14; } bb0: { - StorageLive(_13); + StorageLive(_12); StorageLive(_3); - StorageLive(_7); - StorageLive(_4); StorageLive(_6); - _3 = Len((*_1)); + StorageLive(_4); StorageLive(_5); + _3 = Len((*_1)); _4 = &raw const (*_1); - _5 = NonNull::<[T]> { pointer: _4 }; - _6 = _4 as *const T (PtrToPtr); - _7 = NonNull:: { pointer: _6 }; - StorageDead(_5); - StorageLive(_11); - StorageLive(_8); - _8 = const ::IS_ZST; - switchInt(move _8) -> [0: bb1, otherwise: bb2]; + _5 = _4 as *const T (PtrToPtr); + _6 = NonNull:: { pointer: _5 }; + StorageLive(_10); + StorageLive(_7); + _7 = const ::IS_ZST; + switchInt(move _7) -> [0: bb1, otherwise: bb2]; } bb1: { - StorageLive(_10); StorageLive(_9); - _9 = _4 as *mut T (PtrToPtr); - _10 = Offset(_9, _3); + StorageLive(_8); + _8 = _4 as *mut T (PtrToPtr); + _9 = Offset(_8, _3); + StorageDead(_8); + _10 = move _9 as *const T (PointerCoercion(MutToConstPointer)); StorageDead(_9); - _11 = move _10 as *const T (PointerCoercion(MutToConstPointer)); - StorageDead(_10); goto -> bb3; } bb2: { - _11 = _3 as *const T (Transmute); + _10 = _3 as *const T (Transmute); goto -> bb3; } bb3: { - StorageDead(_8); - StorageLive(_12); - _12 = _11; - _13 = std::slice::Iter::<'_, T> { ptr: _7, end_or_len: move _12, _marker: const ZeroSized: PhantomData<&T> }; - StorageDead(_12); - StorageDead(_11); - StorageDead(_6); - StorageDead(_4); StorageDead(_7); + StorageLive(_11); + _11 = _10; + _12 = std::slice::Iter::<'_, T> { ptr: _6, end_or_len: move _11, _marker: const ZeroSized: PhantomData<&T> }; + StorageDead(_11); + StorageDead(_10); + StorageDead(_5); + StorageDead(_4); + StorageDead(_6); StorageDead(_3); - _14 = Enumerate::> { iter: _13, count: const 0_usize }; - StorageDead(_13); - StorageLive(_15); - _15 = _14; + _13 = Enumerate::> { iter: _12, count: const 0_usize }; + StorageDead(_12); + StorageLive(_14); + _14 = _13; goto -> bb4; } bb4: { - StorageLive(_17); StorageLive(_16); - _16 = &mut _15; - _17 = > as Iterator>::next(move _16) -> [return: bb5, unwind: bb11]; + StorageLive(_15); + _15 = &mut _14; + _16 = > as Iterator>::next(move _15) -> [return: bb5, unwind: bb11]; } bb5: { - StorageDead(_16); - _18 = discriminant(_17); - switchInt(move _18) -> [0: bb6, 1: bb8, otherwise: bb10]; + StorageDead(_15); + _17 = discriminant(_16); + switchInt(move _17) -> [0: bb6, 1: bb8, otherwise: bb10]; } bb6: { - StorageDead(_17); - StorageDead(_15); + StorageDead(_16); + StorageDead(_14); drop(_2) -> [return: bb7, unwind continue]; } @@ -153,19 +134,19 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb8: { - _19 = (((_17 as Some).0: (usize, &T)).0: usize); - _20 = (((_17 as Some).0: (usize, &T)).1: &T); + _18 = (((_16 as Some).0: (usize, &T)).0: usize); + _19 = (((_16 as Some).0: (usize, &T)).1: &T); + StorageLive(_20); + _20 = &_2; StorageLive(_21); - _21 = &_2; - StorageLive(_22); - _22 = (_19, _20); - _23 = >::call(move _21, move _22) -> [return: bb9, unwind: bb11]; + _21 = (_18, _19); + _22 = >::call(move _20, move _21) -> [return: bb9, unwind: bb11]; } bb9: { - StorageDead(_22); StorageDead(_21); - StorageDead(_17); + StorageDead(_20); + StorageDead(_16); goto -> bb4; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir index d8252e7267a..67dd0c85ea1 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir @@ -4,135 +4,118 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { debug slice => _1; debug f => _2; let mut _0: (); + let mut _12: std::slice::Iter<'_, T>; let mut _13: std::slice::Iter<'_, T>; - let mut _14: std::slice::Iter<'_, T>; - let mut _15: &mut std::slice::Iter<'_, T>; - let mut _16: std::option::Option<&T>; - let mut _17: isize; - let mut _19: &impl Fn(&T); - let mut _20: (&T,); - let _21: (); + let mut _14: &mut std::slice::Iter<'_, T>; + let mut _15: std::option::Option<&T>; + let mut _16: isize; + let mut _18: &impl Fn(&T); + let mut _19: (&T,); + let _20: (); scope 1 { - debug iter => _14; - let _18: &T; + debug iter => _13; + let _17: &T; scope 2 { - debug x => _18; + debug x => _17; } } scope 3 (inlined core::slice::::iter) { - debug self => _1; scope 4 (inlined std::slice::Iter::<'_, T>::new) { - debug slice => _1; let _3: usize; - let mut _5: std::ptr::NonNull<[T]>; - let mut _8: bool; + let mut _7: bool; + let mut _8: *mut T; let mut _9: *mut T; - let mut _10: *mut T; - let mut _12: *const T; + let mut _11: *const T; scope 5 { - debug len => _3; - let _7: std::ptr::NonNull; + let _6: std::ptr::NonNull; scope 6 { - debug ptr => _7; - let _11: *const T; + let _10: *const T; scope 7 { - debug end_or_len => _11; } scope 11 (inlined without_provenance::) { - debug addr => _3; } scope 12 (inlined NonNull::::as_ptr) { - debug self => _7; } scope 13 (inlined std::ptr::mut_ptr::::add) { - debug self => _9; - debug count => _3; } } scope 8 (inlined as From<&[T]>>::from) { - debug reference => _1; let mut _4: *const [T]; } scope 9 (inlined NonNull::<[T]>::cast::) { - debug self => _5; - let mut _6: *const T; + let mut _5: *const T; scope 10 (inlined NonNull::<[T]>::as_ptr) { - debug self => _5; } } } } } scope 14 (inlined as IntoIterator>::into_iter) { - debug self => _13; } bb0: { StorageLive(_3); - StorageLive(_7); - StorageLive(_4); StorageLive(_6); - _3 = Len((*_1)); + StorageLive(_4); StorageLive(_5); + _3 = Len((*_1)); _4 = &raw const (*_1); - _5 = NonNull::<[T]> { pointer: _4 }; - _6 = _4 as *const T (PtrToPtr); - _7 = NonNull:: { pointer: _6 }; - StorageDead(_5); - StorageLive(_11); - StorageLive(_8); - _8 = const ::IS_ZST; - switchInt(move _8) -> [0: bb1, otherwise: bb2]; + _5 = _4 as *const T (PtrToPtr); + _6 = NonNull:: { pointer: _5 }; + StorageLive(_10); + StorageLive(_7); + _7 = const ::IS_ZST; + switchInt(move _7) -> [0: bb1, otherwise: bb2]; } bb1: { - StorageLive(_10); StorageLive(_9); - _9 = _4 as *mut T (PtrToPtr); - _10 = Offset(_9, _3); + StorageLive(_8); + _8 = _4 as *mut T (PtrToPtr); + _9 = Offset(_8, _3); + StorageDead(_8); + _10 = move _9 as *const T (PointerCoercion(MutToConstPointer)); StorageDead(_9); - _11 = move _10 as *const T (PointerCoercion(MutToConstPointer)); - StorageDead(_10); goto -> bb3; } bb2: { - _11 = _3 as *const T (Transmute); + _10 = _3 as *const T (Transmute); goto -> bb3; } bb3: { - StorageDead(_8); - StorageLive(_12); - _12 = _11; - _13 = std::slice::Iter::<'_, T> { ptr: _7, end_or_len: move _12, _marker: const ZeroSized: PhantomData<&T> }; - StorageDead(_12); - StorageDead(_11); - StorageDead(_6); - StorageDead(_4); StorageDead(_7); + StorageLive(_11); + _11 = _10; + _12 = std::slice::Iter::<'_, T> { ptr: _6, end_or_len: move _11, _marker: const ZeroSized: PhantomData<&T> }; + StorageDead(_11); + StorageDead(_10); + StorageDead(_5); + StorageDead(_4); + StorageDead(_6); StorageDead(_3); - StorageLive(_14); - _14 = _13; + StorageLive(_13); + _13 = _12; goto -> bb4; } bb4: { - StorageLive(_16); StorageLive(_15); - _15 = &mut _14; - _16 = as Iterator>::next(move _15) -> [return: bb5, unwind unreachable]; + StorageLive(_14); + _14 = &mut _13; + _15 = as Iterator>::next(move _14) -> [return: bb5, unwind unreachable]; } bb5: { - StorageDead(_15); - _17 = discriminant(_16); - switchInt(move _17) -> [0: bb6, 1: bb8, otherwise: bb10]; + StorageDead(_14); + _16 = discriminant(_15); + switchInt(move _16) -> [0: bb6, 1: bb8, otherwise: bb10]; } bb6: { - StorageDead(_16); - StorageDead(_14); + StorageDead(_15); + StorageDead(_13); drop(_2) -> [return: bb7, unwind unreachable]; } @@ -141,18 +124,18 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb8: { - _18 = ((_16 as Some).0: &T); + _17 = ((_15 as Some).0: &T); + StorageLive(_18); + _18 = &_2; StorageLive(_19); - _19 = &_2; - StorageLive(_20); - _20 = (_18,); - _21 = >::call(move _19, move _20) -> [return: bb9, unwind unreachable]; + _19 = (_17,); + _20 = >::call(move _18, move _19) -> [return: bb9, unwind unreachable]; } bb9: { - StorageDead(_20); StorageDead(_19); - StorageDead(_16); + StorageDead(_18); + StorageDead(_15); goto -> bb4; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir index b3904dc70a6..7c41e9e1f1b 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir @@ -4,135 +4,118 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { debug slice => _1; debug f => _2; let mut _0: (); + let mut _12: std::slice::Iter<'_, T>; let mut _13: std::slice::Iter<'_, T>; - let mut _14: std::slice::Iter<'_, T>; - let mut _15: &mut std::slice::Iter<'_, T>; - let mut _16: std::option::Option<&T>; - let mut _17: isize; - let mut _19: &impl Fn(&T); - let mut _20: (&T,); - let _21: (); + let mut _14: &mut std::slice::Iter<'_, T>; + let mut _15: std::option::Option<&T>; + let mut _16: isize; + let mut _18: &impl Fn(&T); + let mut _19: (&T,); + let _20: (); scope 1 { - debug iter => _14; - let _18: &T; + debug iter => _13; + let _17: &T; scope 2 { - debug x => _18; + debug x => _17; } } scope 3 (inlined core::slice::::iter) { - debug self => _1; scope 4 (inlined std::slice::Iter::<'_, T>::new) { - debug slice => _1; let _3: usize; - let mut _5: std::ptr::NonNull<[T]>; - let mut _8: bool; + let mut _7: bool; + let mut _8: *mut T; let mut _9: *mut T; - let mut _10: *mut T; - let mut _12: *const T; + let mut _11: *const T; scope 5 { - debug len => _3; - let _7: std::ptr::NonNull; + let _6: std::ptr::NonNull; scope 6 { - debug ptr => _7; - let _11: *const T; + let _10: *const T; scope 7 { - debug end_or_len => _11; } scope 11 (inlined without_provenance::) { - debug addr => _3; } scope 12 (inlined NonNull::::as_ptr) { - debug self => _7; } scope 13 (inlined std::ptr::mut_ptr::::add) { - debug self => _9; - debug count => _3; } } scope 8 (inlined as From<&[T]>>::from) { - debug reference => _1; let mut _4: *const [T]; } scope 9 (inlined NonNull::<[T]>::cast::) { - debug self => _5; - let mut _6: *const T; + let mut _5: *const T; scope 10 (inlined NonNull::<[T]>::as_ptr) { - debug self => _5; } } } } } scope 14 (inlined as IntoIterator>::into_iter) { - debug self => _13; } bb0: { StorageLive(_3); - StorageLive(_7); - StorageLive(_4); StorageLive(_6); - _3 = Len((*_1)); + StorageLive(_4); StorageLive(_5); + _3 = Len((*_1)); _4 = &raw const (*_1); - _5 = NonNull::<[T]> { pointer: _4 }; - _6 = _4 as *const T (PtrToPtr); - _7 = NonNull:: { pointer: _6 }; - StorageDead(_5); - StorageLive(_11); - StorageLive(_8); - _8 = const ::IS_ZST; - switchInt(move _8) -> [0: bb1, otherwise: bb2]; + _5 = _4 as *const T (PtrToPtr); + _6 = NonNull:: { pointer: _5 }; + StorageLive(_10); + StorageLive(_7); + _7 = const ::IS_ZST; + switchInt(move _7) -> [0: bb1, otherwise: bb2]; } bb1: { - StorageLive(_10); StorageLive(_9); - _9 = _4 as *mut T (PtrToPtr); - _10 = Offset(_9, _3); + StorageLive(_8); + _8 = _4 as *mut T (PtrToPtr); + _9 = Offset(_8, _3); + StorageDead(_8); + _10 = move _9 as *const T (PointerCoercion(MutToConstPointer)); StorageDead(_9); - _11 = move _10 as *const T (PointerCoercion(MutToConstPointer)); - StorageDead(_10); goto -> bb3; } bb2: { - _11 = _3 as *const T (Transmute); + _10 = _3 as *const T (Transmute); goto -> bb3; } bb3: { - StorageDead(_8); - StorageLive(_12); - _12 = _11; - _13 = std::slice::Iter::<'_, T> { ptr: _7, end_or_len: move _12, _marker: const ZeroSized: PhantomData<&T> }; - StorageDead(_12); - StorageDead(_11); - StorageDead(_6); - StorageDead(_4); StorageDead(_7); + StorageLive(_11); + _11 = _10; + _12 = std::slice::Iter::<'_, T> { ptr: _6, end_or_len: move _11, _marker: const ZeroSized: PhantomData<&T> }; + StorageDead(_11); + StorageDead(_10); + StorageDead(_5); + StorageDead(_4); + StorageDead(_6); StorageDead(_3); - StorageLive(_14); - _14 = _13; + StorageLive(_13); + _13 = _12; goto -> bb4; } bb4: { - StorageLive(_16); StorageLive(_15); - _15 = &mut _14; - _16 = as Iterator>::next(move _15) -> [return: bb5, unwind: bb11]; + StorageLive(_14); + _14 = &mut _13; + _15 = as Iterator>::next(move _14) -> [return: bb5, unwind: bb11]; } bb5: { - StorageDead(_15); - _17 = discriminant(_16); - switchInt(move _17) -> [0: bb6, 1: bb8, otherwise: bb10]; + StorageDead(_14); + _16 = discriminant(_15); + switchInt(move _16) -> [0: bb6, 1: bb8, otherwise: bb10]; } bb6: { - StorageDead(_16); - StorageDead(_14); + StorageDead(_15); + StorageDead(_13); drop(_2) -> [return: bb7, unwind continue]; } @@ -141,18 +124,18 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb8: { - _18 = ((_16 as Some).0: &T); + _17 = ((_15 as Some).0: &T); + StorageLive(_18); + _18 = &_2; StorageLive(_19); - _19 = &_2; - StorageLive(_20); - _20 = (_18,); - _21 = >::call(move _19, move _20) -> [return: bb9, unwind: bb11]; + _19 = (_17,); + _20 = >::call(move _18, move _19) -> [return: bb9, unwind: bb11]; } bb9: { - StorageDead(_20); StorageDead(_19); - StorageDead(_16); + StorageDead(_18); + StorageDead(_15); goto -> bb4; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir index 5ab88c9b855..dbe6f39548c 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir @@ -5,86 +5,63 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { debug f => _2; let mut _0: (); let mut _3: usize; - let mut _4: std::ops::Range; - let mut _5: std::ops::Range; - let mut _6: &mut std::ops::Range; - let mut _14: std::option::Option; - let mut _16: usize; - let mut _17: bool; - let mut _19: &impl Fn(usize, &T); - let mut _20: (usize, &T); - let _21: (); + let mut _4: usize; + let mut _9: std::option::Option; + let mut _11: usize; + let mut _12: bool; + let mut _14: &impl Fn(usize, &T); + let mut _15: (usize, &T); + let _16: (); scope 1 { - debug iter => _5; - let _15: usize; + debug ((iter: std::ops::Range).0: usize) => _4; + debug ((iter: std::ops::Range).1: usize) => _3; + let _10: usize; scope 2 { - debug i => _15; - let _18: &T; + debug i => _10; + let _13: &T; scope 3 { - debug x => _18; + debug x => _13; } } scope 5 (inlined iter::range::>::next) { - debug self => _6; scope 6 (inlined as iter::range::RangeIteratorImpl>::spec_next) { - debug self => _6; - let mut _7: &usize; - let mut _8: &usize; - let mut _11: bool; - let _12: usize; - let mut _13: usize; + let mut _6: bool; + let _7: usize; + let mut _8: usize; scope 7 { - debug old => _12; } scope 8 (inlined std::cmp::impls::::lt) { - debug self => _7; - debug other => _8; - let mut _9: usize; - let mut _10: usize; + let mut _5: usize; } } } } scope 4 (inlined as IntoIterator>::into_iter) { - debug self => _4; } bb0: { - StorageLive(_3); _3 = Len((*_1)); - _4 = std::ops::Range:: { start: const 0_usize, end: move _3 }; - StorageDead(_3); - StorageLive(_5); - _5 = _4; + StorageLive(_4); + _4 = const 0_usize; goto -> bb1; } bb1: { - StorageLive(_14); - _6 = &mut _5; - StorageLive(_12); - StorageLive(_11); - StorageLive(_7); - _7 = &(_5.0: usize); - StorageLive(_8); - _8 = &(_5.1: usize); StorageLive(_9); - _9 = (_5.0: usize); - StorageLive(_10); - _10 = (_5.1: usize); - _11 = Lt(move _9, move _10); - StorageDead(_10); - StorageDead(_9); - switchInt(move _11) -> [0: bb2, otherwise: bb4]; + StorageLive(_7); + StorageLive(_6); + StorageLive(_5); + _5 = _4; + _6 = Lt(move _5, _3); + StorageDead(_5); + switchInt(move _6) -> [0: bb2, otherwise: bb4]; } bb2: { - StorageDead(_8); + StorageDead(_6); StorageDead(_7); - StorageDead(_11); - StorageDead(_12); - StorageDead(_14); - StorageDead(_5); + StorageDead(_9); + StorageDead(_4); drop(_2) -> [return: bb3, unwind unreachable]; } @@ -93,38 +70,36 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb4: { - StorageDead(_8); - StorageDead(_7); - _12 = (_5.0: usize); - StorageLive(_13); - _13 = ::forward_unchecked(_12, const 1_usize) -> [return: bb5, unwind unreachable]; + _7 = _4; + StorageLive(_8); + _8 = ::forward_unchecked(_7, const 1_usize) -> [return: bb5, unwind unreachable]; } bb5: { - (_5.0: usize) = move _13; - StorageDead(_13); - _14 = Option::::Some(_12); - StorageDead(_11); - StorageDead(_12); - _15 = ((_14 as Some).0: usize); - _16 = Len((*_1)); - _17 = Lt(_15, _16); - assert(move _17, "index out of bounds: the length is {} but the index is {}", move _16, _15) -> [success: bb6, unwind unreachable]; + _4 = move _8; + StorageDead(_8); + _9 = Option::::Some(_7); + StorageDead(_6); + StorageDead(_7); + _10 = ((_9 as Some).0: usize); + _11 = Len((*_1)); + _12 = Lt(_10, _11); + assert(move _12, "index out of bounds: the length is {} but the index is {}", move _11, _10) -> [success: bb6, unwind unreachable]; } bb6: { - _18 = &(*_1)[_15]; - StorageLive(_19); - _19 = &_2; - StorageLive(_20); - _20 = (_15, _18); - _21 = >::call(move _19, move _20) -> [return: bb7, unwind unreachable]; + _13 = &(*_1)[_10]; + StorageLive(_14); + _14 = &_2; + StorageLive(_15); + _15 = (_10, _13); + _16 = >::call(move _14, move _15) -> [return: bb7, unwind unreachable]; } bb7: { - StorageDead(_20); - StorageDead(_19); + StorageDead(_15); StorageDead(_14); + StorageDead(_9); goto -> bb1; } } diff --git a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir index 513651090a8..5b6441cfb3b 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir @@ -5,86 +5,63 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { debug f => _2; let mut _0: (); let mut _3: usize; - let mut _4: std::ops::Range; - let mut _5: std::ops::Range; - let mut _6: &mut std::ops::Range; - let mut _14: std::option::Option; - let mut _16: usize; - let mut _17: bool; - let mut _19: &impl Fn(usize, &T); - let mut _20: (usize, &T); - let _21: (); + let mut _4: usize; + let mut _9: std::option::Option; + let mut _11: usize; + let mut _12: bool; + let mut _14: &impl Fn(usize, &T); + let mut _15: (usize, &T); + let _16: (); scope 1 { - debug iter => _5; - let _15: usize; + debug ((iter: std::ops::Range).0: usize) => _4; + debug ((iter: std::ops::Range).1: usize) => _3; + let _10: usize; scope 2 { - debug i => _15; - let _18: &T; + debug i => _10; + let _13: &T; scope 3 { - debug x => _18; + debug x => _13; } } scope 5 (inlined iter::range::>::next) { - debug self => _6; scope 6 (inlined as iter::range::RangeIteratorImpl>::spec_next) { - debug self => _6; - let mut _7: &usize; - let mut _8: &usize; - let mut _11: bool; - let _12: usize; - let mut _13: usize; + let mut _6: bool; + let _7: usize; + let mut _8: usize; scope 7 { - debug old => _12; } scope 8 (inlined std::cmp::impls::::lt) { - debug self => _7; - debug other => _8; - let mut _9: usize; - let mut _10: usize; + let mut _5: usize; } } } } scope 4 (inlined as IntoIterator>::into_iter) { - debug self => _4; } bb0: { - StorageLive(_3); _3 = Len((*_1)); - _4 = std::ops::Range:: { start: const 0_usize, end: move _3 }; - StorageDead(_3); - StorageLive(_5); - _5 = _4; + StorageLive(_4); + _4 = const 0_usize; goto -> bb1; } bb1: { - StorageLive(_14); - _6 = &mut _5; - StorageLive(_12); - StorageLive(_11); - StorageLive(_7); - _7 = &(_5.0: usize); - StorageLive(_8); - _8 = &(_5.1: usize); StorageLive(_9); - _9 = (_5.0: usize); - StorageLive(_10); - _10 = (_5.1: usize); - _11 = Lt(move _9, move _10); - StorageDead(_10); - StorageDead(_9); - switchInt(move _11) -> [0: bb2, otherwise: bb4]; + StorageLive(_7); + StorageLive(_6); + StorageLive(_5); + _5 = _4; + _6 = Lt(move _5, _3); + StorageDead(_5); + switchInt(move _6) -> [0: bb2, otherwise: bb4]; } bb2: { - StorageDead(_8); + StorageDead(_6); StorageDead(_7); - StorageDead(_11); - StorageDead(_12); - StorageDead(_14); - StorageDead(_5); + StorageDead(_9); + StorageDead(_4); drop(_2) -> [return: bb3, unwind continue]; } @@ -93,38 +70,36 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () { } bb4: { - StorageDead(_8); - StorageDead(_7); - _12 = (_5.0: usize); - StorageLive(_13); - _13 = ::forward_unchecked(_12, const 1_usize) -> [return: bb5, unwind: bb8]; + _7 = _4; + StorageLive(_8); + _8 = ::forward_unchecked(_7, const 1_usize) -> [return: bb5, unwind: bb8]; } bb5: { - (_5.0: usize) = move _13; - StorageDead(_13); - _14 = Option::::Some(_12); - StorageDead(_11); - StorageDead(_12); - _15 = ((_14 as Some).0: usize); - _16 = Len((*_1)); - _17 = Lt(_15, _16); - assert(move _17, "index out of bounds: the length is {} but the index is {}", move _16, _15) -> [success: bb6, unwind: bb8]; + _4 = move _8; + StorageDead(_8); + _9 = Option::::Some(_7); + StorageDead(_6); + StorageDead(_7); + _10 = ((_9 as Some).0: usize); + _11 = Len((*_1)); + _12 = Lt(_10, _11); + assert(move _12, "index out of bounds: the length is {} but the index is {}", move _11, _10) -> [success: bb6, unwind: bb8]; } bb6: { - _18 = &(*_1)[_15]; - StorageLive(_19); - _19 = &_2; - StorageLive(_20); - _20 = (_15, _18); - _21 = >::call(move _19, move _20) -> [return: bb7, unwind: bb8]; + _13 = &(*_1)[_10]; + StorageLive(_14); + _14 = &_2; + StorageLive(_15); + _15 = (_10, _13); + _16 = >::call(move _14, move _15) -> [return: bb7, unwind: bb8]; } bb7: { - StorageDead(_20); - StorageDead(_19); + StorageDead(_15); StorageDead(_14); + StorageDead(_9); goto -> bb1; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir index 091c8a0e968..ffeef1e04a1 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir @@ -4,150 +4,128 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { debug slice => _1; debug f => _2; let mut _0: (); - let mut _13: std::slice::Iter<'_, T>; + let mut _12: std::slice::Iter<'_, T>; + let mut _13: std::iter::Rev>; let mut _14: std::iter::Rev>; - let mut _15: std::iter::Rev>; - let mut _16: &mut std::iter::Rev>; - let mut _18: std::option::Option<&T>; - let mut _19: isize; - let mut _21: &impl Fn(&T); - let mut _22: (&T,); - let _23: (); + let mut _16: std::option::Option<&T>; + let mut _17: isize; + let mut _19: &impl Fn(&T); + let mut _20: (&T,); + let _21: (); scope 1 { - debug iter => _15; - let _20: &T; + debug iter => _14; + let _18: &T; scope 2 { - debug x => _20; + debug x => _18; } scope 17 (inlined > as Iterator>::next) { - debug self => _16; - let mut _17: &mut std::slice::Iter<'_, T>; + let mut _15: &mut std::slice::Iter<'_, T>; } } scope 3 (inlined core::slice::::iter) { - debug self => _1; scope 4 (inlined std::slice::Iter::<'_, T>::new) { - debug slice => _1; let _3: usize; - let mut _5: std::ptr::NonNull<[T]>; - let mut _8: bool; + let mut _7: bool; + let mut _8: *mut T; let mut _9: *mut T; - let mut _10: *mut T; - let mut _12: *const T; + let mut _11: *const T; scope 5 { - debug len => _3; - let _7: std::ptr::NonNull; + let _6: std::ptr::NonNull; scope 6 { - debug ptr => _7; - let _11: *const T; + let _10: *const T; scope 7 { - debug end_or_len => _11; } scope 11 (inlined without_provenance::) { - debug addr => _3; } scope 12 (inlined NonNull::::as_ptr) { - debug self => _7; } scope 13 (inlined std::ptr::mut_ptr::::add) { - debug self => _9; - debug count => _3; } } scope 8 (inlined as From<&[T]>>::from) { - debug reference => _1; let mut _4: *const [T]; } scope 9 (inlined NonNull::<[T]>::cast::) { - debug self => _5; - let mut _6: *const T; + let mut _5: *const T; scope 10 (inlined NonNull::<[T]>::as_ptr) { - debug self => _5; } } } } } scope 14 (inlined as Iterator>::rev) { - debug self => _13; scope 15 (inlined Rev::>::new) { - debug iter => _13; } } scope 16 (inlined > as IntoIterator>::into_iter) { - debug self => _14; } bb0: { - StorageLive(_13); + StorageLive(_12); StorageLive(_3); - StorageLive(_7); - StorageLive(_4); StorageLive(_6); - _3 = Len((*_1)); + StorageLive(_4); StorageLive(_5); + _3 = Len((*_1)); _4 = &raw const (*_1); - _5 = NonNull::<[T]> { pointer: _4 }; - _6 = _4 as *const T (PtrToPtr); - _7 = NonNull:: { pointer: _6 }; - StorageDead(_5); - StorageLive(_11); - StorageLive(_8); - _8 = const ::IS_ZST; - switchInt(move _8) -> [0: bb1, otherwise: bb2]; + _5 = _4 as *const T (PtrToPtr); + _6 = NonNull:: { pointer: _5 }; + StorageLive(_10); + StorageLive(_7); + _7 = const ::IS_ZST; + switchInt(move _7) -> [0: bb1, otherwise: bb2]; } bb1: { - StorageLive(_10); StorageLive(_9); - _9 = _4 as *mut T (PtrToPtr); - _10 = Offset(_9, _3); + StorageLive(_8); + _8 = _4 as *mut T (PtrToPtr); + _9 = Offset(_8, _3); + StorageDead(_8); + _10 = move _9 as *const T (PointerCoercion(MutToConstPointer)); StorageDead(_9); - _11 = move _10 as *const T (PointerCoercion(MutToConstPointer)); - StorageDead(_10); goto -> bb3; } bb2: { - _11 = _3 as *const T (Transmute); + _10 = _3 as *const T (Transmute); goto -> bb3; } bb3: { - StorageDead(_8); - StorageLive(_12); - _12 = _11; - _13 = std::slice::Iter::<'_, T> { ptr: _7, end_or_len: move _12, _marker: const ZeroSized: PhantomData<&T> }; - StorageDead(_12); - StorageDead(_11); - StorageDead(_6); - StorageDead(_4); StorageDead(_7); + StorageLive(_11); + _11 = _10; + _12 = std::slice::Iter::<'_, T> { ptr: _6, end_or_len: move _11, _marker: const ZeroSized: PhantomData<&T> }; + StorageDead(_11); + StorageDead(_10); + StorageDead(_5); + StorageDead(_4); + StorageDead(_6); StorageDead(_3); - _14 = Rev::> { iter: _13 }; - StorageDead(_13); - StorageLive(_15); - _15 = _14; + _13 = Rev::> { iter: _12 }; + StorageDead(_12); + StorageLive(_14); + _14 = _13; goto -> bb4; } bb4: { - StorageLive(_18); - _16 = &mut _15; - StorageLive(_17); - _17 = &mut (_15.0: std::slice::Iter<'_, T>); - _18 = as DoubleEndedIterator>::next_back(move _17) -> [return: bb5, unwind unreachable]; + StorageLive(_16); + StorageLive(_15); + _15 = &mut (_14.0: std::slice::Iter<'_, T>); + _16 = as DoubleEndedIterator>::next_back(move _15) -> [return: bb5, unwind unreachable]; } bb5: { - StorageDead(_17); - _19 = discriminant(_18); - switchInt(move _19) -> [0: bb6, 1: bb8, otherwise: bb10]; + StorageDead(_15); + _17 = discriminant(_16); + switchInt(move _17) -> [0: bb6, 1: bb8, otherwise: bb10]; } bb6: { - StorageDead(_18); - StorageDead(_15); + StorageDead(_16); + StorageDead(_14); drop(_2) -> [return: bb7, unwind unreachable]; } @@ -156,18 +134,18 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb8: { - _20 = ((_18 as Some).0: &T); - StorageLive(_21); - _21 = &_2; - StorageLive(_22); - _22 = (_20,); - _23 = >::call(move _21, move _22) -> [return: bb9, unwind unreachable]; + _18 = ((_16 as Some).0: &T); + StorageLive(_19); + _19 = &_2; + StorageLive(_20); + _20 = (_18,); + _21 = >::call(move _19, move _20) -> [return: bb9, unwind unreachable]; } bb9: { - StorageDead(_22); - StorageDead(_21); - StorageDead(_18); + StorageDead(_20); + StorageDead(_19); + StorageDead(_16); goto -> bb4; } diff --git a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir index 1873d452f34..c7cd37afd86 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir @@ -4,150 +4,128 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { debug slice => _1; debug f => _2; let mut _0: (); - let mut _13: std::slice::Iter<'_, T>; + let mut _12: std::slice::Iter<'_, T>; + let mut _13: std::iter::Rev>; let mut _14: std::iter::Rev>; - let mut _15: std::iter::Rev>; - let mut _16: &mut std::iter::Rev>; - let mut _18: std::option::Option<&T>; - let mut _19: isize; - let mut _21: &impl Fn(&T); - let mut _22: (&T,); - let _23: (); + let mut _16: std::option::Option<&T>; + let mut _17: isize; + let mut _19: &impl Fn(&T); + let mut _20: (&T,); + let _21: (); scope 1 { - debug iter => _15; - let _20: &T; + debug iter => _14; + let _18: &T; scope 2 { - debug x => _20; + debug x => _18; } scope 17 (inlined > as Iterator>::next) { - debug self => _16; - let mut _17: &mut std::slice::Iter<'_, T>; + let mut _15: &mut std::slice::Iter<'_, T>; } } scope 3 (inlined core::slice::::iter) { - debug self => _1; scope 4 (inlined std::slice::Iter::<'_, T>::new) { - debug slice => _1; let _3: usize; - let mut _5: std::ptr::NonNull<[T]>; - let mut _8: bool; + let mut _7: bool; + let mut _8: *mut T; let mut _9: *mut T; - let mut _10: *mut T; - let mut _12: *const T; + let mut _11: *const T; scope 5 { - debug len => _3; - let _7: std::ptr::NonNull; + let _6: std::ptr::NonNull; scope 6 { - debug ptr => _7; - let _11: *const T; + let _10: *const T; scope 7 { - debug end_or_len => _11; } scope 11 (inlined without_provenance::) { - debug addr => _3; } scope 12 (inlined NonNull::::as_ptr) { - debug self => _7; } scope 13 (inlined std::ptr::mut_ptr::::add) { - debug self => _9; - debug count => _3; } } scope 8 (inlined as From<&[T]>>::from) { - debug reference => _1; let mut _4: *const [T]; } scope 9 (inlined NonNull::<[T]>::cast::) { - debug self => _5; - let mut _6: *const T; + let mut _5: *const T; scope 10 (inlined NonNull::<[T]>::as_ptr) { - debug self => _5; } } } } } scope 14 (inlined as Iterator>::rev) { - debug self => _13; scope 15 (inlined Rev::>::new) { - debug iter => _13; } } scope 16 (inlined > as IntoIterator>::into_iter) { - debug self => _14; } bb0: { - StorageLive(_13); + StorageLive(_12); StorageLive(_3); - StorageLive(_7); - StorageLive(_4); StorageLive(_6); - _3 = Len((*_1)); + StorageLive(_4); StorageLive(_5); + _3 = Len((*_1)); _4 = &raw const (*_1); - _5 = NonNull::<[T]> { pointer: _4 }; - _6 = _4 as *const T (PtrToPtr); - _7 = NonNull:: { pointer: _6 }; - StorageDead(_5); - StorageLive(_11); - StorageLive(_8); - _8 = const ::IS_ZST; - switchInt(move _8) -> [0: bb1, otherwise: bb2]; + _5 = _4 as *const T (PtrToPtr); + _6 = NonNull:: { pointer: _5 }; + StorageLive(_10); + StorageLive(_7); + _7 = const ::IS_ZST; + switchInt(move _7) -> [0: bb1, otherwise: bb2]; } bb1: { - StorageLive(_10); StorageLive(_9); - _9 = _4 as *mut T (PtrToPtr); - _10 = Offset(_9, _3); + StorageLive(_8); + _8 = _4 as *mut T (PtrToPtr); + _9 = Offset(_8, _3); + StorageDead(_8); + _10 = move _9 as *const T (PointerCoercion(MutToConstPointer)); StorageDead(_9); - _11 = move _10 as *const T (PointerCoercion(MutToConstPointer)); - StorageDead(_10); goto -> bb3; } bb2: { - _11 = _3 as *const T (Transmute); + _10 = _3 as *const T (Transmute); goto -> bb3; } bb3: { - StorageDead(_8); - StorageLive(_12); - _12 = _11; - _13 = std::slice::Iter::<'_, T> { ptr: _7, end_or_len: move _12, _marker: const ZeroSized: PhantomData<&T> }; - StorageDead(_12); - StorageDead(_11); - StorageDead(_6); - StorageDead(_4); StorageDead(_7); + StorageLive(_11); + _11 = _10; + _12 = std::slice::Iter::<'_, T> { ptr: _6, end_or_len: move _11, _marker: const ZeroSized: PhantomData<&T> }; + StorageDead(_11); + StorageDead(_10); + StorageDead(_5); + StorageDead(_4); + StorageDead(_6); StorageDead(_3); - _14 = Rev::> { iter: _13 }; - StorageDead(_13); - StorageLive(_15); - _15 = _14; + _13 = Rev::> { iter: _12 }; + StorageDead(_12); + StorageLive(_14); + _14 = _13; goto -> bb4; } bb4: { - StorageLive(_18); - _16 = &mut _15; - StorageLive(_17); - _17 = &mut (_15.0: std::slice::Iter<'_, T>); - _18 = as DoubleEndedIterator>::next_back(move _17) -> [return: bb5, unwind: bb11]; + StorageLive(_16); + StorageLive(_15); + _15 = &mut (_14.0: std::slice::Iter<'_, T>); + _16 = as DoubleEndedIterator>::next_back(move _15) -> [return: bb5, unwind: bb11]; } bb5: { - StorageDead(_17); - _19 = discriminant(_18); - switchInt(move _19) -> [0: bb6, 1: bb8, otherwise: bb10]; + StorageDead(_15); + _17 = discriminant(_16); + switchInt(move _17) -> [0: bb6, 1: bb8, otherwise: bb10]; } bb6: { - StorageDead(_18); - StorageDead(_15); + StorageDead(_16); + StorageDead(_14); drop(_2) -> [return: bb7, unwind continue]; } @@ -156,18 +134,18 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () { } bb8: { - _20 = ((_18 as Some).0: &T); - StorageLive(_21); - _21 = &_2; - StorageLive(_22); - _22 = (_20,); - _23 = >::call(move _21, move _22) -> [return: bb9, unwind: bb11]; + _18 = ((_16 as Some).0: &T); + StorageLive(_19); + _19 = &_2; + StorageLive(_20); + _20 = (_18,); + _21 = >::call(move _19, move _20) -> [return: bb9, unwind: bb11]; } bb9: { - StorageDead(_22); - StorageDead(_21); - StorageDead(_18); + StorageDead(_20); + StorageDead(_19); + StorageDead(_16); goto -> bb4; } diff --git a/tests/mir-opt/pre-codegen/spans.rs b/tests/mir-opt/pre-codegen/spans.rs index 4d3dc7ec3e5..940089d2d49 100644 --- a/tests/mir-opt/pre-codegen/spans.rs +++ b/tests/mir-opt/pre-codegen/spans.rs @@ -2,7 +2,7 @@ // Test that the comments we emit in MIR opts are accurate. // // EMIT_MIR_FOR_EACH_PANIC_STRATEGY -//@ compile-flags: -Zmir-include-spans +//@ compile-flags: -Zmir-include-spans -C debuginfo=full #![crate_type = "lib"] diff --git a/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.panic-abort.diff b/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.panic-abort.diff index 22a1a882b41..0c73602bec8 100644 --- a/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.panic-abort.diff +++ b/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.panic-abort.diff @@ -7,7 +7,6 @@ let _2: (); let mut _3: T; scope 1 (inlined std::mem::drop::) { - debug _x => _3; } bb0: { diff --git a/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.panic-unwind.diff b/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.panic-unwind.diff index 56070e6102f..59cce9fbcdd 100644 --- a/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.panic-unwind.diff +++ b/tests/mir-opt/remove_unneeded_drops.cannot_opt_generic.RemoveUnneededDrops.panic-unwind.diff @@ -7,7 +7,6 @@ let _2: (); let mut _3: T; scope 1 (inlined std::mem::drop::) { - debug _x => _3; } bb0: { diff --git a/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.panic-abort.diff b/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.panic-abort.diff index 105bedd0ac8..428b366b5a6 100644 --- a/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.panic-abort.diff +++ b/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.panic-abort.diff @@ -7,7 +7,6 @@ let _2: (); let mut _3: std::vec::Vec; scope 1 (inlined std::mem::drop::>) { - debug _x => _3; } bb0: { diff --git a/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.panic-unwind.diff b/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.panic-unwind.diff index c9790dc071d..445c1f82a96 100644 --- a/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.panic-unwind.diff +++ b/tests/mir-opt/remove_unneeded_drops.dont_opt.RemoveUnneededDrops.panic-unwind.diff @@ -7,7 +7,6 @@ let _2: (); let mut _3: std::vec::Vec; scope 1 (inlined std::mem::drop::>) { - debug _x => _3; } bb0: { diff --git a/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-abort.diff b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-abort.diff index a48ac82ea7d..5afeb8620a1 100644 --- a/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-abort.diff +++ b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-abort.diff @@ -7,7 +7,6 @@ let _2: (); let mut _3: bool; scope 1 (inlined std::mem::drop::) { - debug _x => _3; } bb0: { diff --git a/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-unwind.diff b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-unwind.diff index a335e8853f3..b9919ddea56 100644 --- a/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-unwind.diff +++ b/tests/mir-opt/remove_unneeded_drops.opt.RemoveUnneededDrops.panic-unwind.diff @@ -7,7 +7,6 @@ let _2: (); let mut _3: bool; scope 1 (inlined std::mem::drop::) { - debug _x => _3; } bb0: { diff --git a/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-abort.diff b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-abort.diff index 049b32f284d..b89432dd6d6 100644 --- a/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-abort.diff +++ b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-abort.diff @@ -7,7 +7,6 @@ let _2: (); let mut _3: T; scope 1 (inlined std::mem::drop::) { - debug _x => _3; } bb0: { diff --git a/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-unwind.diff b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-unwind.diff index 1f7a6f9ad59..48d02605332 100644 --- a/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-unwind.diff +++ b/tests/mir-opt/remove_unneeded_drops.opt_generic_copy.RemoveUnneededDrops.panic-unwind.diff @@ -7,7 +7,6 @@ let _2: (); let mut _3: T; scope 1 (inlined std::mem::drop::) { - debug _x => _3; } bb0: { diff --git a/tests/mir-opt/separate_const_switch.identity.JumpThreading.diff b/tests/mir-opt/separate_const_switch.identity.JumpThreading.diff index d0abebff214..8dd904c7d7b 100644 --- a/tests/mir-opt/separate_const_switch.identity.JumpThreading.diff +++ b/tests/mir-opt/separate_const_switch.identity.JumpThreading.diff @@ -5,54 +5,44 @@ debug x => _1; let mut _0: std::result::Result; let mut _2: std::ops::ControlFlow, i32>; - let mut _3: std::result::Result; - let mut _4: isize; - let _5: std::result::Result; - let mut _6: std::result::Result; - let _7: i32; + let mut _3: isize; + let _4: std::result::Result; + let _5: i32; scope 1 { - debug residual => _5; + debug residual => _4; scope 2 { scope 8 (inlined #[track_caller] as FromResidual>>::from_residual) { - debug residual => _6; - let _12: i32; + let _10: i32; scope 9 { - debug e => _12; scope 10 (inlined >::from) { - debug t => _12; } } } } } scope 3 { - debug val => _7; + debug val => _5; scope 4 { } } scope 5 (inlined as Try>::branch) { - debug self => _3; - let mut _8: isize; - let _9: i32; - let _10: i32; - let mut _11: std::result::Result; + let mut _6: isize; + let _7: i32; + let _8: i32; + let mut _9: std::result::Result; scope 6 { - debug v => _9; } scope 7 { - debug e => _10; } } bb0: { StorageLive(_2); - StorageLive(_3); - _3 = _1; + StorageLive(_6); + StorageLive(_7); StorageLive(_8); - StorageLive(_9); - StorageLive(_10); - _8 = discriminant(_1); - switchInt(move _8) -> [0: bb6, 1: bb5, otherwise: bb1]; + _6 = discriminant(_1); + switchInt(move _6) -> [0: bb6, 1: bb5, otherwise: bb1]; } bb1: { @@ -60,55 +50,50 @@ } bb2: { - _7 = ((_2 as Continue).0: i32); - _0 = Result::::Ok(_7); + _5 = ((_2 as Continue).0: i32); + _0 = Result::::Ok(_5); StorageDead(_2); return; } bb3: { - _5 = ((_2 as Break).0: std::result::Result); - StorageLive(_6); - _6 = _5; - _12 = ((_5 as Err).0: i32); - _0 = Result::::Err(_12); - StorageDead(_6); + _4 = ((_2 as Break).0: std::result::Result); + _10 = ((_4 as Err).0: i32); + _0 = Result::::Err(_10); StorageDead(_2); return; } bb4: { - StorageDead(_10); - StorageDead(_9); StorageDead(_8); - StorageDead(_3); - _4 = discriminant(_2); -- switchInt(move _4) -> [0: bb2, 1: bb3, otherwise: bb1]; + StorageDead(_7); + StorageDead(_6); + _3 = discriminant(_2); +- switchInt(move _3) -> [0: bb2, 1: bb3, otherwise: bb1]; + goto -> bb2; } bb5: { - _10 = ((_1 as Err).0: i32); - StorageLive(_11); - _11 = Result::::Err(_10); - _2 = ControlFlow::, i32>::Break(move _11); - StorageDead(_11); + _8 = ((_1 as Err).0: i32); + StorageLive(_9); + _9 = Result::::Err(_8); + _2 = ControlFlow::, i32>::Break(move _9); + StorageDead(_9); - goto -> bb4; + goto -> bb7; } bb6: { - _9 = ((_1 as Ok).0: i32); - _2 = ControlFlow::, i32>::Continue(_9); + _7 = ((_1 as Ok).0: i32); + _2 = ControlFlow::, i32>::Continue(_7); goto -> bb4; + } + + bb7: { -+ StorageDead(_10); -+ StorageDead(_9); + StorageDead(_8); -+ StorageDead(_3); -+ _4 = discriminant(_2); ++ StorageDead(_7); ++ StorageDead(_6); ++ _3 = discriminant(_2); + goto -> bb3; } }