Auto merge of #119672 - cjgillot:dse-sandwich, r=oli-obk

Sandwich MIR optimizations between DSE.

This PR reorders MIR optimization passes in an attempt to increase their efficiency.

- Stop running CopyProp before GVN, it's useless as GVN will do the same thing anyway. Instead, we perform CopyProp at the end of the pipeline, to ensure we do not emit copy/move chains.
- Run DSE before GVN, as it increases the probability to have single-assignment locals.
- Run DSE after the final CopyProp to turn copies into moves.

r? `@ghost`
This commit is contained in:
bors 2024-01-16 11:34:16 +00:00
commit fa0dc208d0
71 changed files with 549 additions and 290 deletions

View File

@ -123,13 +123,21 @@ pub fn eliminate<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
let Operand::Copy(place) = *arg else { bug!() };
*arg = Operand::Move(place);
}
crate::simplify::simplify_locals(body, tcx)
}
pub struct DeadStoreElimination;
pub enum DeadStoreElimination {
Initial,
Final,
}
impl<'tcx> MirPass<'tcx> for DeadStoreElimination {
fn name(&self) -> &'static str {
match self {
DeadStoreElimination::Initial => "DeadStoreElimination-initial",
DeadStoreElimination::Final => "DeadStoreElimination-final",
}
}
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
sess.mir_opt_level() >= 2
}

View File

@ -596,24 +596,25 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
&multiple_return_terminators::MultipleReturnTerminators,
&instsimplify::InstSimplify,
&simplify::SimplifyLocals::BeforeConstProp,
&copy_prop::CopyProp,
&dead_store_elimination::DeadStoreElimination::Initial,
&gvn::GVN,
&simplify::SimplifyLocals::AfterGVN,
// Perform `SeparateConstSwitch` after SSA-based analyses, as cloning blocks may
// destroy the SSA property. It should still happen before const-propagation, so the
// latter pass will leverage the created opportunities.
&separate_const_switch::SeparateConstSwitch,
&gvn::GVN,
&simplify::SimplifyLocals::AfterGVN,
&dataflow_const_prop::DataflowConstProp,
&const_debuginfo::ConstDebugInfo,
&o1(simplify_branches::SimplifyConstCondition::AfterConstProp),
&jump_threading::JumpThreading,
&early_otherwise_branch::EarlyOtherwiseBranch,
&simplify_comparison_integral::SimplifyComparisonIntegral,
&dead_store_elimination::DeadStoreElimination,
&dest_prop::DestinationPropagation,
&o1(simplify_branches::SimplifyConstCondition::Final),
&o1(remove_noop_landing_pads::RemoveNoopLandingPads),
&o1(simplify::SimplifyCfg::Final),
&copy_prop::CopyProp,
&dead_store_elimination::DeadStoreElimination::Final,
&nrvo::RenameReturnPlace,
&simplify::SimplifyLocals::Final,
&multiple_return_terminators::MultipleReturnTerminators,

View File

@ -25,20 +25,21 @@
scope 11 (inlined NonNull::<[bool; 0]>::new_unchecked) {
debug ptr => _6;
let mut _8: *const [bool; 0];
let mut _9: *mut [bool; 0];
scope 12 {
scope 13 (inlined NonNull::<T>::new_unchecked::runtime::<[bool; 0]>) {
debug ptr => _6;
debug ptr => _9;
scope 14 (inlined std::ptr::mut_ptr::<impl *mut [bool; 0]>::is_null) {
debug self => _6;
let mut _9: *mut u8;
debug self => _9;
let mut _10: *mut u8;
scope 15 {
scope 16 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
debug ptr => _9;
debug ptr => _10;
scope 17 (inlined std::ptr::mut_ptr::<impl *mut u8>::addr) {
debug self => _9;
debug self => _10;
scope 18 {
scope 19 (inlined std::ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
debug self => _9;
debug self => _10;
}
}
}
@ -74,8 +75,10 @@
StorageDead(_7);
StorageLive(_8);
StorageLive(_9);
StorageLive(_10);
_8 = const {0x1 as *mut [bool; 0]} as *const [bool; 0] (PointerCoercion(MutToConstPointer));
_5 = NonNull::<[bool; 0]> { pointer: _8 };
StorageDead(_10);
StorageDead(_9);
StorageDead(_8);
StorageDead(_6);

View File

@ -25,20 +25,21 @@
scope 11 (inlined NonNull::<[bool; 0]>::new_unchecked) {
debug ptr => _6;
let mut _8: *const [bool; 0];
let mut _9: *mut [bool; 0];
scope 12 {
scope 13 (inlined NonNull::<T>::new_unchecked::runtime::<[bool; 0]>) {
debug ptr => _6;
debug ptr => _9;
scope 14 (inlined std::ptr::mut_ptr::<impl *mut [bool; 0]>::is_null) {
debug self => _6;
let mut _9: *mut u8;
debug self => _9;
let mut _10: *mut u8;
scope 15 {
scope 16 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
debug ptr => _9;
debug ptr => _10;
scope 17 (inlined std::ptr::mut_ptr::<impl *mut u8>::addr) {
debug self => _9;
debug self => _10;
scope 18 {
scope 19 (inlined std::ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
debug self => _9;
debug self => _10;
}
}
}
@ -74,8 +75,10 @@
StorageDead(_7);
StorageLive(_8);
StorageLive(_9);
StorageLive(_10);
_8 = const {0x1 as *mut [bool; 0]} as *const [bool; 0] (PointerCoercion(MutToConstPointer));
_5 = NonNull::<[bool; 0]> { pointer: _8 };
StorageDead(_10);
StorageDead(_9);
StorageDead(_8);
StorageDead(_6);

View File

@ -25,20 +25,21 @@
scope 11 (inlined NonNull::<[bool; 0]>::new_unchecked) {
debug ptr => _6;
let mut _8: *const [bool; 0];
let mut _9: *mut [bool; 0];
scope 12 {
scope 13 (inlined NonNull::<T>::new_unchecked::runtime::<[bool; 0]>) {
debug ptr => _6;
debug ptr => _9;
scope 14 (inlined std::ptr::mut_ptr::<impl *mut [bool; 0]>::is_null) {
debug self => _6;
let mut _9: *mut u8;
debug self => _9;
let mut _10: *mut u8;
scope 15 {
scope 16 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
debug ptr => _9;
debug ptr => _10;
scope 17 (inlined std::ptr::mut_ptr::<impl *mut u8>::addr) {
debug self => _9;
debug self => _10;
scope 18 {
scope 19 (inlined std::ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
debug self => _9;
debug self => _10;
}
}
}
@ -74,8 +75,10 @@
StorageDead(_7);
StorageLive(_8);
StorageLive(_9);
StorageLive(_10);
_8 = const {0x1 as *mut [bool; 0]} as *const [bool; 0] (PointerCoercion(MutToConstPointer));
_5 = NonNull::<[bool; 0]> { pointer: _8 };
StorageDead(_10);
StorageDead(_9);
StorageDead(_8);
StorageDead(_6);

View File

@ -25,20 +25,21 @@
scope 11 (inlined NonNull::<[bool; 0]>::new_unchecked) {
debug ptr => _6;
let mut _8: *const [bool; 0];
let mut _9: *mut [bool; 0];
scope 12 {
scope 13 (inlined NonNull::<T>::new_unchecked::runtime::<[bool; 0]>) {
debug ptr => _6;
debug ptr => _9;
scope 14 (inlined std::ptr::mut_ptr::<impl *mut [bool; 0]>::is_null) {
debug self => _6;
let mut _9: *mut u8;
debug self => _9;
let mut _10: *mut u8;
scope 15 {
scope 16 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
debug ptr => _9;
debug ptr => _10;
scope 17 (inlined std::ptr::mut_ptr::<impl *mut u8>::addr) {
debug self => _9;
debug self => _10;
scope 18 {
scope 19 (inlined std::ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
debug self => _9;
debug self => _10;
}
}
}
@ -74,8 +75,10 @@
StorageDead(_7);
StorageLive(_8);
StorageLive(_9);
StorageLive(_10);
_8 = const {0x1 as *mut [bool; 0]} as *const [bool; 0] (PointerCoercion(MutToConstPointer));
_5 = NonNull::<[bool; 0]> { pointer: _8 };
StorageDead(_10);
StorageDead(_9);
StorageDead(_8);
StorageDead(_6);

View File

@ -25,20 +25,21 @@
scope 11 (inlined NonNull::<[bool; 0]>::new_unchecked) {
debug ptr => _6;
let mut _8: *const [bool; 0];
let mut _9: *mut [bool; 0];
scope 12 {
scope 13 (inlined NonNull::<T>::new_unchecked::runtime::<[bool; 0]>) {
debug ptr => _6;
debug ptr => _9;
scope 14 (inlined std::ptr::mut_ptr::<impl *mut [bool; 0]>::is_null) {
debug self => _6;
let mut _9: *mut u8;
debug self => _9;
let mut _10: *mut u8;
scope 15 {
scope 16 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
debug ptr => _9;
debug ptr => _10;
scope 17 (inlined std::ptr::mut_ptr::<impl *mut u8>::addr) {
debug self => _9;
debug self => _10;
scope 18 {
scope 19 (inlined std::ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
debug self => _9;
debug self => _10;
}
}
}
@ -76,9 +77,11 @@
StorageDead(_7);
StorageLive(_8);
StorageLive(_9);
StorageLive(_10);
- _8 = _6 as *const [bool; 0] (PointerCoercion(MutToConstPointer));
+ _8 = const {0x1 as *mut [bool; 0]} as *const [bool; 0] (PointerCoercion(MutToConstPointer));
_5 = NonNull::<[bool; 0]> { pointer: _8 };
StorageDead(_10);
StorageDead(_9);
StorageDead(_8);
StorageDead(_6);

View File

@ -25,20 +25,21 @@
scope 11 (inlined NonNull::<[bool; 0]>::new_unchecked) {
debug ptr => _6;
let mut _8: *const [bool; 0];
let mut _9: *mut [bool; 0];
scope 12 {
scope 13 (inlined NonNull::<T>::new_unchecked::runtime::<[bool; 0]>) {
debug ptr => _6;
debug ptr => _9;
scope 14 (inlined std::ptr::mut_ptr::<impl *mut [bool; 0]>::is_null) {
debug self => _6;
let mut _9: *mut u8;
debug self => _9;
let mut _10: *mut u8;
scope 15 {
scope 16 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
debug ptr => _9;
debug ptr => _10;
scope 17 (inlined std::ptr::mut_ptr::<impl *mut u8>::addr) {
debug self => _9;
debug self => _10;
scope 18 {
scope 19 (inlined std::ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
debug self => _9;
debug self => _10;
}
}
}
@ -76,9 +77,11 @@
StorageDead(_7);
StorageLive(_8);
StorageLive(_9);
StorageLive(_10);
- _8 = _6 as *const [bool; 0] (PointerCoercion(MutToConstPointer));
+ _8 = const {0x1 as *mut [bool; 0]} as *const [bool; 0] (PointerCoercion(MutToConstPointer));
_5 = NonNull::<[bool; 0]> { pointer: _8 };
StorageDead(_10);
StorageDead(_9);
StorageDead(_8);
StorageDead(_6);

View File

@ -25,20 +25,21 @@
scope 11 (inlined NonNull::<[bool; 0]>::new_unchecked) {
debug ptr => _6;
let mut _8: *const [bool; 0];
let mut _9: *mut [bool; 0];
scope 12 {
scope 13 (inlined NonNull::<T>::new_unchecked::runtime::<[bool; 0]>) {
debug ptr => _6;
debug ptr => _9;
scope 14 (inlined std::ptr::mut_ptr::<impl *mut [bool; 0]>::is_null) {
debug self => _6;
let mut _9: *mut u8;
debug self => _9;
let mut _10: *mut u8;
scope 15 {
scope 16 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
debug ptr => _9;
debug ptr => _10;
scope 17 (inlined std::ptr::mut_ptr::<impl *mut u8>::addr) {
debug self => _9;
debug self => _10;
scope 18 {
scope 19 (inlined std::ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
debug self => _9;
debug self => _10;
}
}
}
@ -76,9 +77,11 @@
StorageDead(_7);
StorageLive(_8);
StorageLive(_9);
StorageLive(_10);
- _8 = _6 as *const [bool; 0] (PointerCoercion(MutToConstPointer));
+ _8 = const {0x1 as *mut [bool; 0]} as *const [bool; 0] (PointerCoercion(MutToConstPointer));
_5 = NonNull::<[bool; 0]> { pointer: _8 };
StorageDead(_10);
StorageDead(_9);
StorageDead(_8);
StorageDead(_6);

View File

@ -25,20 +25,21 @@
scope 11 (inlined NonNull::<[bool; 0]>::new_unchecked) {
debug ptr => _6;
let mut _8: *const [bool; 0];
let mut _9: *mut [bool; 0];
scope 12 {
scope 13 (inlined NonNull::<T>::new_unchecked::runtime::<[bool; 0]>) {
debug ptr => _6;
debug ptr => _9;
scope 14 (inlined std::ptr::mut_ptr::<impl *mut [bool; 0]>::is_null) {
debug self => _6;
let mut _9: *mut u8;
debug self => _9;
let mut _10: *mut u8;
scope 15 {
scope 16 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
debug ptr => _9;
debug ptr => _10;
scope 17 (inlined std::ptr::mut_ptr::<impl *mut u8>::addr) {
debug self => _9;
debug self => _10;
scope 18 {
scope 19 (inlined std::ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
debug self => _9;
debug self => _10;
}
}
}
@ -76,9 +77,11 @@
StorageDead(_7);
StorageLive(_8);
StorageLive(_9);
StorageLive(_10);
- _8 = _6 as *const [bool; 0] (PointerCoercion(MutToConstPointer));
+ _8 = const {0x1 as *mut [bool; 0]} as *const [bool; 0] (PointerCoercion(MutToConstPointer));
_5 = NonNull::<[bool; 0]> { pointer: _8 };
StorageDead(_10);
StorageDead(_9);
StorageDead(_8);
StorageDead(_6);

View File

@ -1,5 +1,5 @@
- // MIR for `move_packed` before DeadStoreElimination
+ // MIR for `move_packed` after DeadStoreElimination
- // MIR for `move_packed` before DeadStoreElimination-final
+ // MIR for `move_packed` after DeadStoreElimination-final
fn move_packed(_1: Packed) -> () {
let mut _0: ();

View File

@ -1,5 +1,5 @@
- // MIR for `move_packed` before DeadStoreElimination
+ // MIR for `move_packed` after DeadStoreElimination
- // MIR for `move_packed` before DeadStoreElimination-final
+ // MIR for `move_packed` after DeadStoreElimination-final
fn move_packed(_1: Packed) -> () {
let mut _0: ();

View File

@ -1,12 +1,12 @@
- // MIR for `move_simple` before DeadStoreElimination
+ // MIR for `move_simple` after DeadStoreElimination
- // MIR for `move_simple` before DeadStoreElimination-final
+ // MIR for `move_simple` after DeadStoreElimination-final
fn move_simple(_1: i32) -> () {
debug x => _1;
let mut _0: ();
let _2: ();
- let mut _3: i32;
- let mut _4: i32;
let mut _3: i32;
let mut _4: i32;
bb0: {
StorageLive(_2);

View File

@ -1,12 +1,12 @@
- // MIR for `move_simple` before DeadStoreElimination
+ // MIR for `move_simple` after DeadStoreElimination
- // MIR for `move_simple` before DeadStoreElimination-final
+ // MIR for `move_simple` after DeadStoreElimination-final
fn move_simple(_1: i32) -> () {
debug x => _1;
let mut _0: ();
let _2: ();
- let mut _3: i32;
- let mut _4: i32;
let mut _3: i32;
let mut _4: i32;
bb0: {
StorageLive(_2);

View File

@ -1,6 +1,5 @@
// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: DeadStoreElimination
// unit-test: DeadStoreElimination-final
// compile-flags: -Zmir-enable-passes=+CopyProp
#![feature(core_intrinsics)]
@ -12,8 +11,10 @@ use std::intrinsics::mir::*;
#[inline(never)]
fn use_both(_: i32, _: i32) {}
// EMIT_MIR call_arg_copy.move_simple.DeadStoreElimination.diff
// EMIT_MIR call_arg_copy.move_simple.DeadStoreElimination-final.diff
fn move_simple(x: i32) {
// CHECK-LABEL: fn move_simple(
// CHECK: = use_both(_1, move _1)
use_both(x, x);
}
@ -23,11 +24,14 @@ struct Packed {
y: i32,
}
// EMIT_MIR call_arg_copy.move_packed.DeadStoreElimination.diff
// EMIT_MIR call_arg_copy.move_packed.DeadStoreElimination-final.diff
#[custom_mir(dialect = "analysis")]
fn move_packed(packed: Packed) {
// CHECK-LABEL: fn move_packed(
// CHECK: = use_both(const 0_i32, (_1.1: i32))
mir!(
{
// We have a packed struct, verify that the copy is not turned into a move.
Call(RET = use_both(0, packed.y), ReturnTo(ret), UnwindContinue())
}
ret = {

View File

@ -1,10 +1,10 @@
- // MIR for `cycle` before DeadStoreElimination
+ // MIR for `cycle` after DeadStoreElimination
- // MIR for `cycle` before DeadStoreElimination-initial
+ // MIR for `cycle` after DeadStoreElimination-initial
fn cycle(_1: i32, _2: i32, _3: i32) -> () {
let mut _0: ();
let mut _4: bool;
- let mut _5: i32;
let mut _5: i32;
bb0: {
_4 = cond() -> [return: bb1, unwind continue];
@ -19,6 +19,10 @@
- _3 = _2;
- _2 = _1;
- _1 = _5;
+ nop;
+ nop;
+ nop;
+ nop;
_4 = cond() -> [return: bb1, unwind continue];
}

View File

@ -1,9 +1,8 @@
// skip-filecheck
// This example is interesting because the non-transitive version of `MaybeLiveLocals` would
// report that *all* of these stores are live.
//
// needs-unwind
// unit-test: DeadStoreElimination
// unit-test: DeadStoreElimination-initial
#![feature(core_intrinsics, custom_mir)]
use std::intrinsics::mir::*;
@ -13,9 +12,13 @@ fn cond() -> bool {
false
}
// EMIT_MIR cycle.cycle.DeadStoreElimination.diff
// EMIT_MIR cycle.cycle.DeadStoreElimination-initial.diff
#[custom_mir(dialect = "runtime", phase = "post-cleanup")]
fn cycle(mut x: i32, mut y: i32, mut z: i32) {
// CHECK-LABEL: fn cycle(
// CHECK-NOT: {{_.*}} = {{_.*}};
// CHECK-NOT: {{_.*}} = move {{_.*}};
// We use custom MIR to avoid generating debuginfo, that would force to preserve writes.
mir!(
let condition: bool;

View File

@ -1,5 +1,5 @@
- // MIR for `main` before DeadStoreElimination
+ // MIR for `main` after DeadStoreElimination
- // MIR for `main` before DeadStoreElimination-initial
+ // MIR for `main` after DeadStoreElimination-initial
fn main() -> () {
let mut _0: ();

View File

@ -1,10 +1,15 @@
// skip-filecheck
// unit-test: DeadStoreElimination
// Verify that we account for the `PlaceMention` statement as a use of the tuple,
// and don't remove it as a dead store.
//
// unit-test: DeadStoreElimination-initial
// compile-flags: -Zmir-keep-place-mention
// EMIT_MIR place_mention.main.DeadStoreElimination.diff
// EMIT_MIR place_mention.main.DeadStoreElimination-initial.diff
fn main() {
// Verify that we account for the `PlaceMention` statement as a use of the tuple,
// and don't remove it as a dead store.
// CHECK-LABEL: fn main(
// CHECK-NOT: PlaceMention(
// CHECK: [[tmp:_.*]] =
// CHECK-NEXT: PlaceMention([[tmp:_.*]]);
let (_, _) = ("Hello", "World");
}

View File

@ -1,5 +1,5 @@
- // MIR for `pointer_to_int` before DeadStoreElimination
+ // MIR for `pointer_to_int` after DeadStoreElimination
- // MIR for `pointer_to_int` before DeadStoreElimination-initial
+ // MIR for `pointer_to_int` after DeadStoreElimination-initial
fn pointer_to_int(_1: *mut i32) -> () {
debug p => _1;

View File

@ -1,5 +1,5 @@
- // MIR for `retags` before DeadStoreElimination
+ // MIR for `retags` after DeadStoreElimination
- // MIR for `retags` before DeadStoreElimination-initial
+ // MIR for `retags` after DeadStoreElimination-initial
fn retags(_1: &mut i32) -> () {
debug _r => _1;

View File

@ -1,17 +1,21 @@
// skip-filecheck
// unit-test: DeadStoreElimination
// Test that we don't remove pointer to int casts or retags
// unit-test: DeadStoreElimination-initial
// compile-flags: -Zmir-emit-retag
// Test that we don't remove pointer to int casts or retags
// EMIT_MIR provenance_soundness.pointer_to_int.DeadStoreElimination.diff
// EMIT_MIR provenance_soundness.pointer_to_int.DeadStoreElimination-initial.diff
fn pointer_to_int(p: *mut i32) {
// CHECK-LABEL: fn pointer_to_int(
// CHECK: {{_.*}} = {{.*}} as usize (PointerExposeAddress);
// CHECK: {{_.*}} = {{.*}} as isize (PointerExposeAddress);
let _x = p as usize;
let _y = p as isize;
}
// EMIT_MIR provenance_soundness.retags.DeadStoreElimination.diff
fn retags(_r: &mut i32) {}
// EMIT_MIR provenance_soundness.retags.DeadStoreElimination-initial.diff
fn retags(_r: &mut i32) {
// CHECK-LABEL: fn retags(
// CHECK: Retag([fn entry] _1);
}
fn main() {
pointer_to_int(&mut 5 as *mut _);

View File

@ -5,12 +5,13 @@
let mut _0: ();
let _1: main::Un;
let mut _2: u32;
let mut _3: u32;
scope 1 {
debug un => _1;
scope 2 {
}
scope 4 (inlined std::mem::drop::<u32>) {
debug _x => _2;
debug _x => _3;
}
}
scope 3 (inlined val) {
@ -18,10 +19,13 @@
bb0: {
StorageLive(_1);
_1 = Un { us: const 1_u32 };
StorageLive(_2);
_2 = (_1.0: u32);
_2 = const 1_u32;
_1 = Un { us: const 1_u32 };
StorageDead(_2);
StorageLive(_3);
_3 = (_1.0: u32);
StorageDead(_3);
StorageDead(_1);
return;
}

View File

@ -5,12 +5,13 @@
let mut _0: ();
let _1: main::Un;
let mut _2: u32;
let mut _3: u32;
scope 1 {
debug un => _1;
scope 2 {
}
scope 4 (inlined std::mem::drop::<u32>) {
debug _x => _2;
debug _x => _3;
}
}
scope 3 (inlined val) {
@ -18,10 +19,13 @@
bb0: {
StorageLive(_1);
_1 = Un { us: const 1_u32 };
StorageLive(_2);
_2 = (_1.0: u32);
_2 = const 1_u32;
_1 = Un { us: const 1_u32 };
StorageDead(_2);
StorageLive(_3);
_3 = (_1.0: u32);
StorageDead(_3);
StorageDead(_1);
return;
}

View File

@ -73,31 +73,59 @@
}
bb4: {
- StorageLive(_8);
+ nop;
_8 = ((_6 as Some).0: usize);
StorageLive(_9);
_9 = _1;
StorageLive(_10);
_10 = _2;
StorageLive(_11);
_11 = _5;
StorageLive(_12);
StorageLive(_13);
_13 = _8 as u32 (IntToInt);
StorageLive(_14);
_14 = _8;
- _13 = move _14 as u32 (IntToInt);
+ _13 = _8 as u32 (IntToInt);
StorageDead(_14);
_12 = Add(move _13, const 1_u32);
StorageDead(_13);
_0 = float_to_exponential_common_exact::<T>(_1, _2, move _11, move _12, _3) -> [return: bb5, unwind unreachable];
StorageLive(_15);
_15 = _3;
- _0 = float_to_exponential_common_exact::<T>(move _9, move _10, move _11, move _12, move _15) -> [return: bb5, unwind unreachable];
+ _0 = float_to_exponential_common_exact::<T>(_1, _2, move _11, move _12, _3) -> [return: bb5, unwind unreachable];
}
bb5: {
StorageDead(_15);
StorageDead(_12);
StorageDead(_11);
StorageDead(_10);
StorageDead(_9);
- StorageDead(_8);
+ nop;
goto -> bb8;
}
bb6: {
StorageLive(_16);
_16 = _1;
StorageLive(_17);
_17 = _2;
StorageLive(_18);
_18 = _5;
_0 = float_to_exponential_common_shortest::<T>(_1, _2, move _18, _3) -> [return: bb7, unwind unreachable];
StorageLive(_19);
_19 = _3;
- _0 = float_to_exponential_common_shortest::<T>(move _16, move _17, move _18, move _19) -> [return: bb7, unwind unreachable];
+ _0 = float_to_exponential_common_shortest::<T>(_1, _2, move _18, _3) -> [return: bb7, unwind unreachable];
}
bb7: {
StorageDead(_19);
StorageDead(_18);
StorageDead(_17);
StorageDead(_16);
goto -> bb8;
}

View File

@ -73,31 +73,59 @@
}
bb4: {
- StorageLive(_8);
+ nop;
_8 = ((_6 as Some).0: usize);
StorageLive(_9);
_9 = _1;
StorageLive(_10);
_10 = _2;
StorageLive(_11);
_11 = _5;
StorageLive(_12);
StorageLive(_13);
_13 = _8 as u32 (IntToInt);
StorageLive(_14);
_14 = _8;
- _13 = move _14 as u32 (IntToInt);
+ _13 = _8 as u32 (IntToInt);
StorageDead(_14);
_12 = Add(move _13, const 1_u32);
StorageDead(_13);
_0 = float_to_exponential_common_exact::<T>(_1, _2, move _11, move _12, _3) -> [return: bb5, unwind continue];
StorageLive(_15);
_15 = _3;
- _0 = float_to_exponential_common_exact::<T>(move _9, move _10, move _11, move _12, move _15) -> [return: bb5, unwind continue];
+ _0 = float_to_exponential_common_exact::<T>(_1, _2, move _11, move _12, _3) -> [return: bb5, unwind continue];
}
bb5: {
StorageDead(_15);
StorageDead(_12);
StorageDead(_11);
StorageDead(_10);
StorageDead(_9);
- StorageDead(_8);
+ nop;
goto -> bb8;
}
bb6: {
StorageLive(_16);
_16 = _1;
StorageLive(_17);
_17 = _2;
StorageLive(_18);
_18 = _5;
_0 = float_to_exponential_common_shortest::<T>(_1, _2, move _18, _3) -> [return: bb7, unwind continue];
StorageLive(_19);
_19 = _3;
- _0 = float_to_exponential_common_shortest::<T>(move _16, move _17, move _18, move _19) -> [return: bb7, unwind continue];
+ _0 = float_to_exponential_common_shortest::<T>(_1, _2, move _18, _3) -> [return: bb7, unwind continue];
}
bb7: {
StorageDead(_19);
StorageDead(_18);
StorageDead(_17);
StorageDead(_16);
goto -> bb8;
}

View File

@ -36,7 +36,7 @@
- _4 = g() -> [return: bb1, unwind unreachable];
+ _4 = {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8 (#0)};
+ _3 = &mut _4;
+ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}> { pointer: move _3 };
+ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}> { pointer: _3 };
+ StorageDead(_3);
+ StorageLive(_5);
+ _5 = const false;

View File

@ -36,7 +36,7 @@
- _4 = g() -> [return: bb1, unwind continue];
+ _4 = {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8 (#0)};
+ _3 = &mut _4;
+ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}> { pointer: move _3 };
+ _2 = Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}> { pointer: _3 };
+ StorageDead(_3);
+ StorageLive(_5);
+ _5 = const false;

View File

@ -40,7 +40,7 @@
+
+ bb2: {
+ StorageDead(_5);
+ _1 = (move _4, move _6);
+ _1 = (_4, _6);
+ drop(_2) -> [return: bb3, unwind unreachable];
+ }
+

View File

@ -43,7 +43,7 @@
+ StorageDead(_5);
+ StorageLive(_7);
+ _7 = move _4;
+ _1 = (move _7, move _6);
+ _1 = (move _7, _6);
+ StorageDead(_7);
+ StorageDead(_4);
+ drop(_2) -> [return: bb3, unwind continue];

View File

@ -31,7 +31,7 @@ fn unwrap_unchecked(_1: Option<T>) -> T {
_2 = discriminant(_1);
_3 = Eq(_2, const 1_isize);
assume(move _3);
_0 = move ((_1 as Some).0: T);
_0 = ((_1 as Some).0: T);
StorageDead(_3);
StorageDead(_2);
StorageDead(_4);

View File

@ -31,7 +31,7 @@ fn unwrap_unchecked(_1: Option<T>) -> T {
_2 = discriminant(_1);
_3 = Eq(_2, const 1_isize);
assume(move _3);
_0 = move ((_1 as Some).0: T);
_0 = ((_1 as Some).0: T);
StorageDead(_3);
StorageDead(_2);
StorageDead(_4);

View File

@ -17,7 +17,7 @@
let mut _12: u32;
let mut _13: bool;
scope 1 (inlined imm8) {
debug x => _1;
debug x => _5;
let mut _14: u32;
let mut _15: u32;
scope 2 {
@ -33,17 +33,23 @@
StorageLive(_2);
StorageLive(_3);
StorageLive(_4);
StorageLive(_5);
_5 = _1;
_4 = const 0_u32;
StorageLive(_15);
StorageLive(_14);
_14 = Shr(_1, const 0_i32);
- _14 = Shr(_5, const 0_i32);
+ _14 = Shr(_1, const 0_i32);
_15 = BitAnd(move _14, const 255_u32);
StorageDead(_14);
_4 = BitOr(const 0_u32, move _15);
StorageDead(_15);
StorageDead(_5);
StorageLive(_6);
StorageLive(_7);
StorageLive(_8);
StorageLive(_9);
_9 = _1;
- _10 = const 8_i32 as u32 (IntToInt);
- _11 = Lt(move _10, const 32_u32);
- assert(move _11, "attempt to shift right by `{}`, which would overflow", const 8_i32) -> [success: bb1, unwind unreachable];
@ -53,7 +59,9 @@
}
bb1: {
_8 = Shr(_1, const 8_i32);
- _8 = Shr(move _9, const 8_i32);
+ _8 = Shr(_1, const 8_i32);
StorageDead(_9);
_7 = BitAnd(move _8, const 15_u32);
StorageDead(_8);
- _12 = const 1_i32 as u32 (IntToInt);

View File

@ -17,7 +17,7 @@
let mut _12: u32;
let mut _13: bool;
scope 1 (inlined imm8) {
debug x => _1;
debug x => _5;
let mut _14: u32;
let mut _15: u32;
scope 2 {
@ -33,17 +33,23 @@
StorageLive(_2);
StorageLive(_3);
StorageLive(_4);
StorageLive(_5);
_5 = _1;
_4 = const 0_u32;
StorageLive(_15);
StorageLive(_14);
_14 = Shr(_1, const 0_i32);
- _14 = Shr(_5, const 0_i32);
+ _14 = Shr(_1, const 0_i32);
_15 = BitAnd(move _14, const 255_u32);
StorageDead(_14);
_4 = BitOr(const 0_u32, move _15);
StorageDead(_15);
StorageDead(_5);
StorageLive(_6);
StorageLive(_7);
StorageLive(_8);
StorageLive(_9);
_9 = _1;
- _10 = const 8_i32 as u32 (IntToInt);
- _11 = Lt(move _10, const 32_u32);
- assert(move _11, "attempt to shift right by `{}`, which would overflow", const 8_i32) -> [success: bb1, unwind continue];
@ -53,7 +59,9 @@
}
bb1: {
_8 = Shr(_1, const 8_i32);
- _8 = Shr(move _9, const 8_i32);
+ _8 = Shr(_1, const 8_i32);
StorageDead(_9);
_7 = BitAnd(move _8, const 15_u32);
StorageDead(_8);
- _12 = const 1_i32 as u32 (IntToInt);

View File

@ -110,7 +110,7 @@
bb6: {
_12 = move ((_4 as Err).0: i32);
StorageLive(_13);
_13 = Result::<Infallible, i32>::Err(move _12);
_13 = Result::<Infallible, i32>::Err(_12);
_3 = ControlFlow::<Result<Infallible, i32>, i32>::Break(move _13);
StorageDead(_13);
- goto -> bb5;
@ -119,7 +119,7 @@
bb7: {
_11 = move ((_4 as Ok).0: i32);
_3 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(move _11);
_3 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(_11);
goto -> bb5;
+ }
+

View File

@ -110,7 +110,7 @@
bb6: {
_12 = move ((_4 as Err).0: i32);
StorageLive(_13);
_13 = Result::<Infallible, i32>::Err(move _12);
_13 = Result::<Infallible, i32>::Err(_12);
_3 = ControlFlow::<Result<Infallible, i32>, i32>::Break(move _13);
StorageDead(_13);
- goto -> bb5;
@ -119,7 +119,7 @@
bb7: {
_11 = move ((_4 as Ok).0: i32);
_3 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(move _11);
_3 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(_11);
goto -> bb5;
+ }
+

View File

@ -19,7 +19,7 @@
}
scope 5 (inlined <std::alloc::Global as Allocator>::allocate) {
debug self => _9;
debug layout => _1;
debug layout => _8;
}
scope 6 (inlined #[track_caller] Result::<NonNull<[u8]>, std::alloc::AllocError>::unwrap) {
debug self => _6;
@ -51,6 +51,8 @@
}
bb0: {
- StorageLive(_1);
+ nop;
StorageLive(_2);
- _2 = Option::<Layout>::None;
+ _2 = const Option::<Layout>::None;
@ -74,12 +76,20 @@
StorageLive(_4);
StorageLive(_5);
StorageLive(_6);
StorageLive(_7);
_9 = const _;
- _6 = std::alloc::Global::alloc_impl(_9, _1, const false) -> [return: bb3, unwind unreachable];
- _7 = _9;
+ _7 = const {ALLOC1<imm>: &std::alloc::Global};
StorageLive(_8);
- _8 = _1;
- _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb3, unwind unreachable];
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }};
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }}, const false) -> [return: bb3, unwind unreachable];
}
bb3: {
StorageDead(_8);
StorageDead(_7);
StorageLive(_12);
StorageLive(_15);
_12 = discriminant(_6);
@ -109,6 +119,8 @@
_3 = move _4 as *mut u8 (PtrToPtr);
StorageDead(_4);
StorageDead(_3);
- StorageDead(_1);
+ nop;
return;
}

View File

@ -19,7 +19,7 @@
}
scope 5 (inlined <std::alloc::Global as Allocator>::allocate) {
debug self => _9;
debug layout => _1;
debug layout => _8;
}
scope 6 (inlined NonNull::<[u8]>::as_ptr) {
debug self => _5;
@ -36,6 +36,8 @@
}
bb0: {
- StorageLive(_1);
+ nop;
StorageLive(_2);
- _2 = Option::<Layout>::None;
+ _2 = const Option::<Layout>::None;
@ -56,6 +58,8 @@
_3 = move _4 as *mut u8 (PtrToPtr);
StorageDead(_4);
StorageDead(_3);
- StorageDead(_1);
+ nop;
return;
}
@ -72,12 +76,20 @@
StorageLive(_4);
StorageLive(_5);
StorageLive(_6);
StorageLive(_7);
_9 = const _;
- _6 = std::alloc::Global::alloc_impl(_9, _1, const false) -> [return: bb4, unwind continue];
- _7 = _9;
+ _7 = const {ALLOC1<imm>: &std::alloc::Global};
StorageLive(_8);
- _8 = _1;
- _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb4, unwind continue];
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }};
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum32) }}, const false) -> [return: bb4, unwind continue];
}
bb4: {
StorageDead(_8);
StorageDead(_7);
_5 = Result::<NonNull<[u8]>, std::alloc::AllocError>::unwrap(move _6) -> [return: bb1, unwind continue];
}

View File

@ -19,7 +19,7 @@
}
scope 5 (inlined <std::alloc::Global as Allocator>::allocate) {
debug self => _9;
debug layout => _1;
debug layout => _8;
}
scope 6 (inlined #[track_caller] Result::<NonNull<[u8]>, std::alloc::AllocError>::unwrap) {
debug self => _6;
@ -51,6 +51,8 @@
}
bb0: {
- StorageLive(_1);
+ nop;
StorageLive(_2);
- _2 = Option::<Layout>::None;
+ _2 = const Option::<Layout>::None;
@ -74,12 +76,20 @@
StorageLive(_4);
StorageLive(_5);
StorageLive(_6);
StorageLive(_7);
_9 = const _;
- _6 = std::alloc::Global::alloc_impl(_9, _1, const false) -> [return: bb3, unwind unreachable];
- _7 = _9;
+ _7 = const {ALLOC1<imm>: &std::alloc::Global};
StorageLive(_8);
- _8 = _1;
- _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb3, unwind unreachable];
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum64) }};
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum64) }}, const false) -> [return: bb3, unwind unreachable];
}
bb3: {
StorageDead(_8);
StorageDead(_7);
StorageLive(_12);
StorageLive(_15);
_12 = discriminant(_6);
@ -109,6 +119,8 @@
_3 = move _4 as *mut u8 (PtrToPtr);
StorageDead(_4);
StorageDead(_3);
- StorageDead(_1);
+ nop;
return;
}

View File

@ -19,7 +19,7 @@
}
scope 5 (inlined <std::alloc::Global as Allocator>::allocate) {
debug self => _9;
debug layout => _1;
debug layout => _8;
}
scope 6 (inlined NonNull::<[u8]>::as_ptr) {
debug self => _5;
@ -36,6 +36,8 @@
}
bb0: {
- StorageLive(_1);
+ nop;
StorageLive(_2);
- _2 = Option::<Layout>::None;
+ _2 = const Option::<Layout>::None;
@ -56,6 +58,8 @@
_3 = move _4 as *mut u8 (PtrToPtr);
StorageDead(_4);
StorageDead(_3);
- StorageDead(_1);
+ nop;
return;
}
@ -72,12 +76,20 @@
StorageLive(_4);
StorageLive(_5);
StorageLive(_6);
StorageLive(_7);
_9 = const _;
- _6 = std::alloc::Global::alloc_impl(_9, _1, const false) -> [return: bb4, unwind continue];
- _7 = _9;
+ _7 = const {ALLOC1<imm>: &std::alloc::Global};
StorageLive(_8);
- _8 = _1;
- _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb4, unwind continue];
+ _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum64) }};
+ _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum64) }}, const false) -> [return: bb4, unwind continue];
}
bb4: {
StorageDead(_8);
StorageDead(_7);
_5 = Result::<NonNull<[u8]>, std::alloc::AllocError>::unwrap(move _6) -> [return: bb1, unwind continue];
}

View File

@ -32,7 +32,7 @@ fn filter_mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> Option<U>) -> ()
bb1: {
StorageLive(_4);
_4 = move _3;
_4 = _3;
goto -> bb2;
}

View File

@ -46,7 +46,7 @@ fn int_range(_1: usize, _2: usize) -> () {
bb0: {
_3 = std::ops::Range::<usize> { start: _1, end: _2 };
StorageLive(_4);
_4 = move _3;
_4 = _3;
goto -> bb1;
}

View File

@ -27,7 +27,7 @@ fn mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> U) -> () {
bb1: {
StorageLive(_4);
_4 = move _3;
_4 = _3;
goto -> bb2;
}

View File

@ -19,22 +19,23 @@ fn mem_replace(_1: &mut u32, _2: u32) -> u32 {
}
scope 4 (inlined std::ptr::read::<u32>) {
debug src => _1;
let mut _3: *const u32;
scope 5 {
scope 6 (inlined std::ptr::read::runtime::<u32>) {
debug src => _1;
debug src => _3;
scope 7 (inlined intrinsics::is_aligned_and_not_null::<u32>) {
debug ptr => _1;
debug ptr => _3;
scope 8 (inlined std::ptr::const_ptr::<impl *const u32>::is_null) {
debug self => _1;
let mut _3: *const u8;
debug self => _3;
let mut _4: *const u8;
scope 9 {
scope 10 (inlined std::ptr::const_ptr::<impl *const T>::is_null::runtime_impl) {
debug ptr => _3;
debug ptr => _4;
scope 11 (inlined std::ptr::const_ptr::<impl *const u8>::addr) {
debug self => _3;
debug self => _4;
scope 12 {
scope 13 (inlined std::ptr::const_ptr::<impl *const u8>::cast::<()>) {
debug self => _3;
debug self => _4;
}
}
}
@ -42,7 +43,7 @@ fn mem_replace(_1: &mut u32, _2: u32) -> u32 {
}
}
scope 14 (inlined std::ptr::const_ptr::<impl *const u32>::is_aligned) {
debug self => _1;
debug self => _3;
scope 15 (inlined align_of::<u32>) {
}
}
@ -55,7 +56,9 @@ fn mem_replace(_1: &mut u32, _2: u32) -> u32 {
bb0: {
StorageLive(_3);
StorageLive(_4);
_0 = (*_1);
StorageDead(_4);
StorageDead(_3);
(*_1) = _2;
return;

View File

@ -17,7 +17,7 @@
debug y => _3;
let _8: u32;
scope 3 {
debug z => _9;
debug z => _8;
}
}
}
@ -50,7 +50,13 @@
+ _3 = const 3_i32;
StorageDead(_5);
StorageDead(_4);
StorageLive(_8);
StorageLive(_9);
_9 = const 42_u32;
- _8 = _9;
+ _8 = const 42_u32;
StorageDead(_9);
StorageDead(_8);
StorageDead(_3);
StorageDead(_1);
return;

View File

@ -17,7 +17,7 @@
debug y => _3;
let _8: u32;
scope 3 {
debug z => _9;
debug z => _8;
}
}
}
@ -50,7 +50,13 @@
+ _3 = const 3_i32;
StorageDead(_5);
StorageDead(_4);
StorageLive(_8);
StorageLive(_9);
_9 = const 42_u32;
- _8 = _9;
+ _8 = const 42_u32;
StorageDead(_9);
StorageDead(_8);
StorageDead(_3);
StorageDead(_1);
return;

View File

@ -17,7 +17,7 @@
debug y => _3;
let _8: u32;
scope 3 {
debug z => _9;
debug z => _8;
}
}
}
@ -50,7 +50,13 @@
+ _3 = const 3_i32;
StorageDead(_5);
StorageDead(_4);
StorageLive(_8);
StorageLive(_9);
_9 = const 42_u32;
- _8 = _9;
+ _8 = const 42_u32;
StorageDead(_9);
StorageDead(_8);
StorageDead(_3);
StorageDead(_1);
return;

View File

@ -17,7 +17,7 @@
debug y => _3;
let _8: u32;
scope 3 {
debug z => _9;
debug z => _8;
}
}
}
@ -50,7 +50,13 @@
+ _3 = const 3_i32;
StorageDead(_5);
StorageDead(_4);
StorageLive(_8);
StorageLive(_9);
_9 = const 42_u32;
- _8 = _9;
+ _8 = const 42_u32;
StorageDead(_9);
StorageDead(_8);
StorageDead(_3);
StorageDead(_1);
return;

View File

@ -49,7 +49,7 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
bb0: {
_4 = std::ops::Range::<u32> { start: _1, end: _2 };
StorageLive(_5);
_5 = move _4;
_5 = _4;
goto -> bb1;
}

View File

@ -49,7 +49,7 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
bb0: {
_4 = std::ops::Range::<u32> { start: _1, end: _2 };
StorageLive(_5);
_5 = move _4;
_5 = _4;
goto -> bb1;
}

View File

@ -34,7 +34,7 @@ fn inclusive_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
bb0: {
_4 = RangeInclusive::<u32> { start: _1, end: _2, exhausted: const false };
StorageLive(_5);
_5 = move _4;
_5 = _4;
goto -> bb1;
}

View File

@ -34,7 +34,7 @@ fn inclusive_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
bb0: {
_4 = RangeInclusive::<u32> { start: _1, end: _2, exhausted: const false };
StorageLive(_5);
_5 = move _4;
_5 = _4;
goto -> bb1;
}

View File

@ -20,7 +20,8 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
debug self => _2;
debug slice => _5;
let mut _6: *mut u32;
let mut _9: &[&str];
let mut _9: *mut [u32];
let mut _10: &[&str];
scope 5 {
scope 10 (inlined std::ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) {
debug self => _5;
@ -33,16 +34,16 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
}
}
scope 6 (inlined std::ptr::mut_ptr::<impl *mut [u32]>::len) {
debug self => _5;
let mut _10: *const [u32];
debug self => _9;
let mut _11: *const [u32];
scope 7 (inlined std::ptr::metadata::<[u32]>) {
debug ptr => _10;
debug ptr => _11;
scope 8 {
}
}
}
scope 9 (inlined Arguments::<'_>::new_const) {
debug pieces => _9;
debug pieces => _10;
}
}
}
@ -71,10 +72,12 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
_5 = &raw mut (*_1);
StorageLive(_9);
StorageLive(_10);
StorageLive(_11);
StorageLive(_6);
_6 = _5 as *mut u32 (PtrToPtr);
_7 = Offset(_6, _2);
StorageDead(_6);
StorageDead(_11);
StorageDead(_10);
StorageDead(_9);
StorageDead(_5);

View File

@ -20,7 +20,8 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
debug self => _2;
debug slice => _5;
let mut _6: *mut u32;
let mut _9: &[&str];
let mut _9: *mut [u32];
let mut _10: &[&str];
scope 5 {
scope 10 (inlined std::ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) {
debug self => _5;
@ -33,16 +34,16 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
}
}
scope 6 (inlined std::ptr::mut_ptr::<impl *mut [u32]>::len) {
debug self => _5;
let mut _10: *const [u32];
debug self => _9;
let mut _11: *const [u32];
scope 7 (inlined std::ptr::metadata::<[u32]>) {
debug ptr => _10;
debug ptr => _11;
scope 8 {
}
}
}
scope 9 (inlined Arguments::<'_>::new_const) {
debug pieces => _9;
debug pieces => _10;
}
}
}
@ -71,10 +72,12 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
_5 = &raw mut (*_1);
StorageLive(_9);
StorageLive(_10);
StorageLive(_11);
StorageLive(_6);
_6 = _5 as *mut u32 (PtrToPtr);
_7 = Offset(_6, _2);
StorageDead(_6);
StorageDead(_11);
StorageDead(_10);
StorageDead(_9);
StorageDead(_5);

View File

@ -19,7 +19,8 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
debug slice => _5;
let mut _7: *mut u32;
let mut _8: *mut u32;
let mut _14: &[&str];
let mut _14: *mut [u32];
let mut _15: &[&str];
scope 4 {
let _6: usize;
scope 5 {
@ -53,16 +54,16 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
}
}
scope 6 (inlined std::ptr::mut_ptr::<impl *mut [u32]>::len) {
debug self => _5;
let mut _15: *const [u32];
debug self => _14;
let mut _16: *const [u32];
scope 7 (inlined std::ptr::metadata::<[u32]>) {
debug ptr => _15;
debug ptr => _16;
scope 8 {
}
}
}
scope 9 (inlined Arguments::<'_>::new_const) {
debug pieces => _14;
debug pieces => _15;
}
}
}
@ -74,8 +75,9 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
StorageLive(_5);
_5 = &raw mut (*_1);
StorageLive(_14);
StorageLive(_6);
StorageLive(_15);
StorageLive(_6);
StorageLive(_16);
_6 = SubUnchecked(_4, _3);
StorageLive(_8);
StorageLive(_7);
@ -96,8 +98,9 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
StorageDead(_12);
StorageDead(_9);
StorageDead(_8);
StorageDead(_15);
StorageDead(_16);
StorageDead(_6);
StorageDead(_15);
StorageDead(_14);
StorageDead(_5);
_0 = &mut (*_13);

View File

@ -19,7 +19,8 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
debug slice => _5;
let mut _7: *mut u32;
let mut _8: *mut u32;
let mut _14: &[&str];
let mut _14: *mut [u32];
let mut _15: &[&str];
scope 4 {
let _6: usize;
scope 5 {
@ -53,16 +54,16 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
}
}
scope 6 (inlined std::ptr::mut_ptr::<impl *mut [u32]>::len) {
debug self => _5;
let mut _15: *const [u32];
debug self => _14;
let mut _16: *const [u32];
scope 7 (inlined std::ptr::metadata::<[u32]>) {
debug ptr => _15;
debug ptr => _16;
scope 8 {
}
}
}
scope 9 (inlined Arguments::<'_>::new_const) {
debug pieces => _14;
debug pieces => _15;
}
}
}
@ -74,8 +75,9 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
StorageLive(_5);
_5 = &raw mut (*_1);
StorageLive(_14);
StorageLive(_6);
StorageLive(_15);
StorageLive(_6);
StorageLive(_16);
_6 = SubUnchecked(_4, _3);
StorageLive(_8);
StorageLive(_7);
@ -96,8 +98,9 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
StorageDead(_12);
StorageDead(_9);
StorageDead(_8);
StorageDead(_15);
StorageDead(_16);
StorageDead(_6);
StorageDead(_15);
StorageDead(_14);
StorageDead(_5);
_0 = &mut (*_13);

View File

@ -42,20 +42,21 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
scope 13 (inlined NonNull::<T>::new_unchecked) {
debug ptr => _9;
let mut _10: *const T;
let mut _24: *mut T;
scope 14 {
scope 15 (inlined NonNull::<T>::new_unchecked::runtime::<T>) {
debug ptr => _9;
debug ptr => _24;
scope 16 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null) {
debug self => _9;
let mut _24: *mut u8;
debug self => _24;
let mut _25: *mut u8;
scope 17 {
scope 18 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
debug ptr => _24;
debug ptr => _25;
scope 19 (inlined std::ptr::mut_ptr::<impl *mut u8>::addr) {
debug self => _24;
debug self => _25;
scope 20 {
scope 21 (inlined std::ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
debug self => _24;
debug self => _25;
}
}
}
@ -131,8 +132,10 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
_9 = _4 as *mut T (PtrToPtr);
StorageLive(_10);
StorageLive(_24);
StorageLive(_25);
_10 = _9 as *const T (PointerCoercion(MutToConstPointer));
_11 = NonNull::<T> { pointer: _10 };
StorageDead(_25);
StorageDead(_24);
StorageDead(_10);
StorageDead(_9);
@ -143,10 +146,10 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
StorageDead(_11);
StorageDead(_7);
StorageDead(_4);
_14 = Enumerate::<std::slice::Iter<'_, T>> { iter: move _13, count: const 0_usize };
_14 = Enumerate::<std::slice::Iter<'_, T>> { iter: _13, count: const 0_usize };
StorageDead(_13);
StorageLive(_15);
_15 = move _14;
_15 = _14;
goto -> bb4;
}

View File

@ -42,20 +42,21 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
scope 13 (inlined NonNull::<T>::new_unchecked) {
debug ptr => _9;
let mut _10: *const T;
let mut _24: *mut T;
scope 14 {
scope 15 (inlined NonNull::<T>::new_unchecked::runtime::<T>) {
debug ptr => _9;
debug ptr => _24;
scope 16 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null) {
debug self => _9;
let mut _24: *mut u8;
debug self => _24;
let mut _25: *mut u8;
scope 17 {
scope 18 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
debug ptr => _24;
debug ptr => _25;
scope 19 (inlined std::ptr::mut_ptr::<impl *mut u8>::addr) {
debug self => _24;
debug self => _25;
scope 20 {
scope 21 (inlined std::ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
debug self => _24;
debug self => _25;
}
}
}
@ -131,8 +132,10 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
_9 = _4 as *mut T (PtrToPtr);
StorageLive(_10);
StorageLive(_24);
StorageLive(_25);
_10 = _9 as *const T (PointerCoercion(MutToConstPointer));
_11 = NonNull::<T> { pointer: _10 };
StorageDead(_25);
StorageDead(_24);
StorageDead(_10);
StorageDead(_9);
@ -143,10 +146,10 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
StorageDead(_11);
StorageDead(_7);
StorageDead(_4);
_14 = Enumerate::<std::slice::Iter<'_, T>> { iter: move _13, count: const 0_usize };
_14 = Enumerate::<std::slice::Iter<'_, T>> { iter: _13, count: const 0_usize };
StorageDead(_13);
StorageLive(_15);
_15 = move _14;
_15 = _14;
goto -> bb4;
}

View File

@ -39,20 +39,21 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
scope 13 (inlined NonNull::<T>::new_unchecked) {
debug ptr => _9;
let mut _10: *const T;
let mut _22: *mut T;
scope 14 {
scope 15 (inlined NonNull::<T>::new_unchecked::runtime::<T>) {
debug ptr => _9;
debug ptr => _22;
scope 16 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null) {
debug self => _9;
let mut _22: *mut u8;
debug self => _22;
let mut _23: *mut u8;
scope 17 {
scope 18 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
debug ptr => _22;
debug ptr => _23;
scope 19 (inlined std::ptr::mut_ptr::<impl *mut u8>::addr) {
debug self => _22;
debug self => _23;
scope 20 {
scope 21 (inlined std::ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
debug self => _22;
debug self => _23;
}
}
}
@ -121,8 +122,10 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
_9 = _4 as *mut T (PtrToPtr);
StorageLive(_10);
StorageLive(_22);
StorageLive(_23);
_10 = _9 as *const T (PointerCoercion(MutToConstPointer));
_11 = NonNull::<T> { pointer: _10 };
StorageDead(_23);
StorageDead(_22);
StorageDead(_10);
StorageDead(_9);
@ -134,7 +137,7 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
StorageDead(_7);
StorageDead(_4);
StorageLive(_14);
_14 = move _13;
_14 = _13;
goto -> bb4;
}

View File

@ -39,20 +39,21 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
scope 13 (inlined NonNull::<T>::new_unchecked) {
debug ptr => _9;
let mut _10: *const T;
let mut _22: *mut T;
scope 14 {
scope 15 (inlined NonNull::<T>::new_unchecked::runtime::<T>) {
debug ptr => _9;
debug ptr => _22;
scope 16 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null) {
debug self => _9;
let mut _22: *mut u8;
debug self => _22;
let mut _23: *mut u8;
scope 17 {
scope 18 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
debug ptr => _22;
debug ptr => _23;
scope 19 (inlined std::ptr::mut_ptr::<impl *mut u8>::addr) {
debug self => _22;
debug self => _23;
scope 20 {
scope 21 (inlined std::ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
debug self => _22;
debug self => _23;
}
}
}
@ -121,8 +122,10 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
_9 = _4 as *mut T (PtrToPtr);
StorageLive(_10);
StorageLive(_22);
StorageLive(_23);
_10 = _9 as *const T (PointerCoercion(MutToConstPointer));
_11 = NonNull::<T> { pointer: _10 };
StorageDead(_23);
StorageDead(_22);
StorageDead(_10);
StorageDead(_9);
@ -134,7 +137,7 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
StorageDead(_7);
StorageDead(_4);
StorageLive(_14);
_14 = move _13;
_14 = _13;
goto -> bb4;
}

View File

@ -58,7 +58,7 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
_4 = std::ops::Range::<usize> { start: const 0_usize, end: move _3 };
StorageDead(_3);
StorageLive(_5);
_5 = move _4;
_5 = _4;
goto -> bb1;
}

View File

@ -58,7 +58,7 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
_4 = std::ops::Range::<usize> { start: const 0_usize, end: move _3 };
StorageDead(_3);
StorageLive(_5);
_5 = move _4;
_5 = _4;
goto -> bb1;
}

View File

@ -44,20 +44,21 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () {
scope 13 (inlined NonNull::<T>::new_unchecked) {
debug ptr => _9;
let mut _10: *const T;
let mut _24: *mut T;
scope 14 {
scope 15 (inlined NonNull::<T>::new_unchecked::runtime::<T>) {
debug ptr => _9;
debug ptr => _24;
scope 16 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null) {
debug self => _9;
let mut _24: *mut u8;
debug self => _24;
let mut _25: *mut u8;
scope 17 {
scope 18 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
debug ptr => _24;
debug ptr => _25;
scope 19 (inlined std::ptr::mut_ptr::<impl *mut u8>::addr) {
debug self => _24;
debug self => _25;
scope 20 {
scope 21 (inlined std::ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
debug self => _24;
debug self => _25;
}
}
}
@ -133,8 +134,10 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () {
_9 = _4 as *mut T (PtrToPtr);
StorageLive(_10);
StorageLive(_24);
StorageLive(_25);
_10 = _9 as *const T (PointerCoercion(MutToConstPointer));
_11 = NonNull::<T> { pointer: _10 };
StorageDead(_25);
StorageDead(_24);
StorageDead(_10);
StorageDead(_9);
@ -145,10 +148,10 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () {
StorageDead(_11);
StorageDead(_7);
StorageDead(_4);
_14 = Rev::<std::slice::Iter<'_, T>> { iter: move _13 };
_14 = Rev::<std::slice::Iter<'_, T>> { iter: _13 };
StorageDead(_13);
StorageLive(_15);
_15 = move _14;
_15 = _14;
goto -> bb4;
}

View File

@ -44,20 +44,21 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () {
scope 13 (inlined NonNull::<T>::new_unchecked) {
debug ptr => _9;
let mut _10: *const T;
let mut _24: *mut T;
scope 14 {
scope 15 (inlined NonNull::<T>::new_unchecked::runtime::<T>) {
debug ptr => _9;
debug ptr => _24;
scope 16 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null) {
debug self => _9;
let mut _24: *mut u8;
debug self => _24;
let mut _25: *mut u8;
scope 17 {
scope 18 (inlined std::ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
debug ptr => _24;
debug ptr => _25;
scope 19 (inlined std::ptr::mut_ptr::<impl *mut u8>::addr) {
debug self => _24;
debug self => _25;
scope 20 {
scope 21 (inlined std::ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
debug self => _24;
debug self => _25;
}
}
}
@ -133,8 +134,10 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () {
_9 = _4 as *mut T (PtrToPtr);
StorageLive(_10);
StorageLive(_24);
StorageLive(_25);
_10 = _9 as *const T (PointerCoercion(MutToConstPointer));
_11 = NonNull::<T> { pointer: _10 };
StorageDead(_25);
StorageDead(_24);
StorageDead(_10);
StorageDead(_9);
@ -145,10 +148,10 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () {
StorageDead(_11);
StorageDead(_7);
StorageDead(_4);
_14 = Rev::<std::slice::Iter<'_, T>> { iter: move _13 };
_14 = Rev::<std::slice::Iter<'_, T>> { iter: _13 };
StorageDead(_13);
StorageLive(_15);
_15 = move _14;
_15 = _14;
goto -> bb4;
}

View File

@ -31,13 +31,13 @@ fn new(_1: Result<T, E>) -> Result<T, E> {
bb1: {
_3 = move ((_1 as Ok).0: T);
_4 = ControlFlow::<E, T>::Continue(move _3);
_4 = ControlFlow::<E, T>::Continue(_3);
goto -> bb3;
}
bb2: {
_5 = move ((_1 as Err).0: E);
_4 = ControlFlow::<E, T>::Break(move _5);
_4 = ControlFlow::<E, T>::Break(_5);
goto -> bb3;
}
@ -48,14 +48,14 @@ fn new(_1: Result<T, E>) -> Result<T, E> {
bb4: {
_7 = move ((_4 as Continue).0: T);
_0 = Result::<T, E>::Ok(move _7);
_0 = Result::<T, E>::Ok(_7);
StorageDead(_4);
goto -> bb6;
}
bb5: {
_8 = move ((_4 as Break).0: E);
_0 = Result::<T, E>::Err(move _8);
_0 = Result::<T, E>::Err(_8);
StorageDead(_4);
goto -> bb6;
}

View File

@ -20,13 +20,13 @@ fn old(_1: Result<T, E>) -> Result<T, E> {
bb1: {
_3 = move ((_1 as Ok).0: T);
_0 = Result::<T, E>::Ok(move _3);
_0 = Result::<T, E>::Ok(_3);
goto -> bb3;
}
bb2: {
_4 = move ((_1 as Err).0: E);
_0 = Result::<T, E>::Err(move _4);
_0 = Result::<T, E>::Err(_4);
goto -> bb3;
}

View File

@ -4,92 +4,96 @@
fn identity(_1: Result<i32, i32>) -> Result<i32, i32> {
debug x => _1;
let mut _0: std::result::Result<i32, i32>;
let mut _2: i32;
let mut _3: std::ops::ControlFlow<std::result::Result<std::convert::Infallible, i32>, i32>;
let mut _4: std::result::Result<i32, i32>;
let mut _5: isize;
let _6: std::result::Result<std::convert::Infallible, i32>;
let mut _7: std::result::Result<std::convert::Infallible, i32>;
let _8: i32;
let mut _2: std::ops::ControlFlow<std::result::Result<std::convert::Infallible, i32>, i32>;
let mut _3: std::result::Result<i32, i32>;
let mut _4: isize;
let _5: std::result::Result<std::convert::Infallible, i32>;
let mut _6: std::result::Result<std::convert::Infallible, i32>;
let _7: i32;
scope 1 {
debug residual => _6;
debug residual => _5;
scope 2 {
scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) {
debug residual => _6;
let _13: i32;
let mut _14: i32;
let _12: i32;
scope 9 {
debug e => _13;
debug e => _12;
scope 10 (inlined <i32 as From<i32>>::from) {
debug t => _13;
debug t => _12;
}
}
}
}
}
scope 3 {
debug val => _8;
debug val => _7;
scope 4 {
}
}
scope 5 (inlined <Result<i32, i32> as Try>::branch) {
debug self => _1;
let mut _9: isize;
debug self => _3;
let mut _8: isize;
let _9: i32;
let _10: i32;
let _11: i32;
let mut _12: std::result::Result<std::convert::Infallible, i32>;
let mut _11: std::result::Result<std::convert::Infallible, i32>;
scope 6 {
debug v => _10;
debug v => _9;
}
scope 7 {
debug e => _11;
debug e => _10;
}
}
bb0: {
StorageLive(_2);
StorageLive(_3);
_3 = _1;
StorageLive(_8);
StorageLive(_9);
StorageLive(_10);
StorageLive(_11);
_9 = discriminant(_1);
switchInt(move _9) -> [0: bb5, 1: bb4, otherwise: bb6];
_8 = discriminant(_1);
switchInt(move _8) -> [0: bb5, 1: bb4, otherwise: bb6];
}
bb1: {
_8 = ((_3 as Continue).0: i32);
_0 = Result::<i32, i32>::Ok(_8);
StorageDead(_3);
_7 = ((_2 as Continue).0: i32);
_0 = Result::<i32, i32>::Ok(_7);
StorageDead(_2);
return;
}
bb2: {
_6 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>);
_13 = ((_6 as Err).0: i32);
_0 = Result::<i32, i32>::Err(move _13);
StorageDead(_3);
_5 = ((_2 as Break).0: std::result::Result<std::convert::Infallible, i32>);
StorageLive(_6);
_6 = _5;
_12 = move ((_5 as Err).0: i32);
_0 = Result::<i32, i32>::Err(_12);
StorageDead(_6);
StorageDead(_2);
return;
}
bb3: {
StorageDead(_11);
StorageDead(_10);
StorageDead(_9);
_5 = discriminant(_3);
switchInt(move _5) -> [0: bb1, 1: bb2, otherwise: bb6];
StorageDead(_8);
StorageDead(_3);
_4 = discriminant(_2);
switchInt(move _4) -> [0: bb1, 1: bb2, otherwise: bb6];
}
bb4: {
_11 = ((_1 as Err).0: i32);
StorageLive(_12);
_12 = Result::<Infallible, i32>::Err(move _11);
_3 = ControlFlow::<Result<Infallible, i32>, i32>::Break(move _12);
StorageDead(_12);
_10 = move ((_1 as Err).0: i32);
StorageLive(_11);
_11 = Result::<Infallible, i32>::Err(_10);
_2 = ControlFlow::<Result<Infallible, i32>, i32>::Break(move _11);
StorageDead(_11);
goto -> bb3;
}
bb5: {
_10 = ((_1 as Ok).0: i32);
_3 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(move _10);
_9 = move ((_1 as Ok).0: i32);
_2 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(_9);
goto -> bb3;
}

View File

@ -7,24 +7,21 @@
let mut _2: std::ops::ControlFlow<usize, i32>;
let mut _3: isize;
let _4: i32;
let mut _5: i32;
let _6: usize;
let mut _7: usize;
let mut _8: isize;
let _9: i32;
let mut _10: i32;
let _11: usize;
let _5: usize;
let mut _6: isize;
let _7: i32;
let _8: usize;
scope 1 {
debug v => _4;
}
scope 2 {
debug r => _6;
debug r => _5;
}
scope 3 {
debug v => _9;
debug v => _7;
}
scope 4 {
debug r => _11;
debug r => _8;
}
bb0: {
@ -34,8 +31,8 @@
}
bb1: {
_6 = ((_1 as Err).0: usize);
_2 = ControlFlow::<usize, i32>::Break(_6);
_5 = ((_1 as Err).0: usize);
_2 = ControlFlow::<usize, i32>::Break(_5);
goto -> bb3;
}
@ -46,21 +43,21 @@
}
bb3: {
_8 = discriminant(_2);
switchInt(move _8) -> [0: bb5, 1: bb4, otherwise: bb7];
_6 = discriminant(_2);
switchInt(move _6) -> [0: bb5, 1: bb4, otherwise: bb7];
}
bb4: {
StorageLive(_11);
_11 = ((_2 as Break).0: usize);
_0 = Option::<i32>::None;
StorageDead(_11);
StorageLive(_8);
_8 = ((_2 as Break).0: usize);
_0 = const Option::<i32>::None;
StorageDead(_8);
goto -> bb6;
}
bb5: {
_9 = ((_2 as Continue).0: i32);
_0 = Option::<i32>::Some(_9);
_7 = ((_2 as Continue).0: i32);
_0 = Option::<i32>::Some(_7);
goto -> bb6;
}
@ -74,3 +71,7 @@
}
}
ALLOC0 (size: 8, align: 4) {
00 00 00 00 __ __ __ __ │ ....░░░░
}

View File

@ -10,8 +10,15 @@
}
bb0: {
StorageLive(_1);
- StorageLive(_2);
+ nop;
_2 = const false;
- switchInt(_2) -> [0: bb2, otherwise: bb1];
- _1 = _2;
- StorageDead(_2);
- switchInt(_1) -> [0: bb2, otherwise: bb1];
+ _1 = const false;
+ nop;
+ switchInt(const false) -> [0: bb2, otherwise: bb1];
}
@ -20,6 +27,7 @@
}
bb2: {
StorageDead(_1);
return;
}
}

View File

@ -10,8 +10,15 @@
}
bb0: {
StorageLive(_1);
- StorageLive(_2);
+ nop;
_2 = const false;
- switchInt(_2) -> [0: bb2, otherwise: bb1];
- _1 = _2;
- StorageDead(_2);
- switchInt(_1) -> [0: bb2, otherwise: bb1];
+ _1 = const false;
+ nop;
+ switchInt(const false) -> [0: bb2, otherwise: bb1];
}
@ -20,6 +27,7 @@
}
bb2: {
StorageDead(_1);
return;
}
}

View File

@ -111,7 +111,7 @@ fn check_other_consts(item: CrateItem) {
// Instance body will force constant evaluation.
let body = Instance::try_from(item).unwrap().body().unwrap();
let assigns = collect_consts(&body);
assert_eq!(assigns.len(), 9);
assert_eq!(assigns.len(), 8);
for (name, alloc) in assigns {
match name.as_str() {
"_max_u128" => {