rust/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.mir

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

140 lines
8.3 KiB
Rust
Raw Normal View History

// MIR for `forward_loop` after PreCodegen
fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
debug start => _1; // in scope 0 at $DIR/range_iter.rs:+0:21: +0:26
debug end => _2; // in scope 0 at $DIR/range_iter.rs:+0:33: +0:36
debug f => _3; // in scope 0 at $DIR/range_iter.rs:+0:43: +0:44
let mut _0: (); // return place in scope 0 at $DIR/range_iter.rs:+0:60: +0:60
let mut _4: std::ops::Range<u32>; // in scope 0 at $DIR/range_iter.rs:+1:14: +1:24
let mut _5: std::ops::Range<u32>; // in scope 0 at $DIR/range_iter.rs:+1:14: +1:24
let mut _6: &mut std::ops::Range<u32>; // in scope 0 at $DIR/range_iter.rs:+1:14: +1:24
let mut _10: std::option::Option<u32>; // in scope 0 at $DIR/range_iter.rs:+1:14: +1:24
let mut _13: isize; // in scope 0 at $DIR/range_iter.rs:+1:5: +3:6
let mut _15: &impl Fn(u32); // in scope 0 at $DIR/range_iter.rs:+2:9: +2:10
let mut _16: (u32,); // in scope 0 at $DIR/range_iter.rs:+2:9: +2:13
let _17: (); // in scope 0 at $DIR/range_iter.rs:+1:14: +1:24
scope 1 {
debug iter => _5; // in scope 1 at $DIR/range_iter.rs:+1:14: +1:24
let _14: u32; // in scope 1 at $DIR/range_iter.rs:+1:9: +1:10
scope 2 {
debug x => _14; // in scope 2 at $DIR/range_iter.rs:+1:9: +1:10
}
scope 4 (inlined iter::range::<impl Iterator for std::ops::Range<u32>>::next) { // at $DIR/range_iter.rs:21:14: 21:24
debug self => _6; // in scope 4 at $SRC_DIR/core/src/iter/range.rs:LL:COL
scope 5 (inlined <std::ops::Range<u32> as iter::range::RangeIteratorImpl>::spec_next) { // at $SRC_DIR/core/src/iter/range.rs:LL:COL
debug self => _6; // in scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
let mut _7: &u32; // in scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
let mut _8: &u32; // in scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
let mut _9: bool; // in scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
let _11: u32; // in scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
let mut _12: u32; // in scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
scope 6 {
debug old => _11; // in scope 6 at $SRC_DIR/core/src/iter/range.rs:LL:COL
scope 7 {
}
}
}
}
}
scope 3 (inlined <std::ops::Range<u32> as IntoIterator>::into_iter) { // at $DIR/range_iter.rs:21:14: 21:24
debug self => _4; // in scope 3 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
}
bb0: {
_4 = std::ops::Range::<u32> { start: _1, end: _2 }; // scope 0 at $DIR/range_iter.rs:+1:14: +1:24
StorageLive(_5); // scope 0 at $DIR/range_iter.rs:+1:14: +1:24
_5 = move _4; // scope 0 at $DIR/range_iter.rs:+1:14: +1:24
goto -> bb1; // scope 1 at $DIR/range_iter.rs:+1:5: +3:6
}
bb1: {
StorageLive(_10); // scope 1 at $DIR/range_iter.rs:+1:14: +1:24
_6 = &mut _5; // scope 1 at $DIR/range_iter.rs:+1:14: +1:24
StorageLive(_11); // scope 4 at $SRC_DIR/core/src/iter/range.rs:LL:COL
StorageLive(_9); // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
StorageLive(_7); // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
_7 = &((*_6).0: u32); // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
StorageLive(_8); // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
_8 = &((*_6).1: u32); // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
_9 = <u32 as PartialOrd>::lt(move _7, move _8) -> [return: bb2, unwind: bb12]; // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/iter/range.rs:LL:COL
// + literal: Const { ty: for<'a, 'b> fn(&'a u32, &'b u32) -> bool {<u32 as PartialOrd>::lt}, val: Value(<ZST>) }
}
bb2: {
StorageDead(_8); // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
StorageDead(_7); // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
switchInt(move _9) -> [0: bb3, otherwise: bb4]; // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
}
bb3: {
_10 = Option::<u32>::None; // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
goto -> bb6; // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
}
bb4: {
_11 = ((*_6).0: u32); // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
StorageLive(_12); // scope 6 at $SRC_DIR/core/src/iter/range.rs:LL:COL
_12 = <u32 as Step>::forward_unchecked(_11, const 1_usize) -> [return: bb5, unwind: bb12]; // scope 7 at $SRC_DIR/core/src/iter/range.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/iter/range.rs:LL:COL
// + literal: Const { ty: unsafe fn(u32, usize) -> u32 {<u32 as Step>::forward_unchecked}, val: Value(<ZST>) }
}
bb5: {
((*_6).0: u32) = move _12; // scope 6 at $SRC_DIR/core/src/iter/range.rs:LL:COL
StorageDead(_12); // scope 6 at $SRC_DIR/core/src/iter/range.rs:LL:COL
_10 = Option::<u32>::Some(_11); // scope 6 at $SRC_DIR/core/src/iter/range.rs:LL:COL
goto -> bb6; // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
}
bb6: {
StorageDead(_9); // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
StorageDead(_11); // scope 4 at $SRC_DIR/core/src/iter/range.rs:LL:COL
_13 = discriminant(_10); // scope 1 at $DIR/range_iter.rs:+1:14: +1:24
switchInt(move _13) -> [0: bb7, 1: bb9, otherwise: bb11]; // scope 1 at $DIR/range_iter.rs:+1:14: +1:24
}
bb7: {
StorageDead(_10); // scope 1 at $DIR/range_iter.rs:+3:5: +3:6
StorageDead(_5); // scope 0 at $DIR/range_iter.rs:+3:5: +3:6
drop(_3) -> bb8; // scope 0 at $DIR/range_iter.rs:+4:1: +4:2
}
bb8: {
return; // scope 0 at $DIR/range_iter.rs:+4:2: +4:2
}
bb9: {
_14 = ((_10 as Some).0: u32); // scope 1 at $DIR/range_iter.rs:+1:9: +1:10
StorageLive(_15); // scope 2 at $DIR/range_iter.rs:+2:9: +2:10
_15 = &_3; // scope 2 at $DIR/range_iter.rs:+2:9: +2:10
StorageLive(_16); // scope 2 at $DIR/range_iter.rs:+2:9: +2:13
_16 = (_14,); // scope 2 at $DIR/range_iter.rs:+2:9: +2:13
_17 = <impl Fn(u32) as Fn<(u32,)>>::call(move _15, move _16) -> [return: bb10, unwind: bb12]; // scope 2 at $DIR/range_iter.rs:+2:9: +2:13
// mir::Constant
// + span: $DIR/range_iter.rs:22:9: 22:10
// + literal: Const { ty: for<'a> extern "rust-call" fn(&'a impl Fn(u32), (u32,)) -> <impl Fn(u32) as FnOnce<(u32,)>>::Output {<impl Fn(u32) as Fn<(u32,)>>::call}, val: Value(<ZST>) }
}
bb10: {
StorageDead(_16); // scope 2 at $DIR/range_iter.rs:+2:12: +2:13
StorageDead(_15); // scope 2 at $DIR/range_iter.rs:+2:12: +2:13
StorageDead(_10); // scope 1 at $DIR/range_iter.rs:+3:5: +3:6
goto -> bb1; // scope 1 at $DIR/range_iter.rs:+1:5: +3:6
}
bb11: {
unreachable; // scope 1 at $DIR/range_iter.rs:+1:14: +1:24
}
bb12 (cleanup): {
drop(_3) -> [return: bb13, unwind terminate]; // scope 0 at $DIR/range_iter.rs:+4:1: +4:2
}
bb13 (cleanup): {
resume; // scope 0 at $DIR/range_iter.rs:+0:1: +4:2
}
}