rust/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir

118 lines
2.9 KiB
Rust
Raw Normal View History

2023-02-05 13:10:33 -06:00
// MIR for `int_range` after PreCodegen
fn int_range(_1: usize, _2: usize) -> () {
2023-06-06 08:47:00 -05:00
debug start => _1;
debug end => _2;
let mut _0: ();
2023-08-17 12:06:55 -05:00
let mut _3: std::ops::Range<usize>;
let mut _4: std::ops::Range<usize>;
let mut _8: std::option::Option<usize>;
let mut _11: isize;
let _13: ();
let mut _14: &mut std::ops::Range<usize>;
2023-02-05 13:10:33 -06:00
scope 1 {
2023-08-17 12:06:55 -05:00
debug iter => _4;
let _12: usize;
2023-02-05 13:10:33 -06:00
scope 2 {
2023-08-17 12:06:55 -05:00
debug i => _12;
2023-02-05 13:10:33 -06:00
}
2023-06-06 08:47:00 -05:00
scope 4 (inlined iter::range::<impl Iterator for std::ops::Range<usize>>::next) {
2023-08-17 12:06:55 -05:00
debug self => _14;
2023-06-06 08:47:00 -05:00
scope 5 (inlined <std::ops::Range<usize> as iter::range::RangeIteratorImpl>::spec_next) {
2023-08-17 12:06:55 -05:00
debug self => _14;
let mut _7: bool;
let _9: usize;
let mut _10: usize;
let mut _15: &usize;
let mut _16: &usize;
2023-06-01 01:08:25 -05:00
scope 6 {
2023-08-17 12:06:55 -05:00
debug old => _9;
2023-06-01 01:08:25 -05:00
scope 7 {
}
}
2023-06-06 08:47:00 -05:00
scope 8 (inlined cmp::impls::<impl PartialOrd for usize>::lt) {
2023-08-17 12:06:55 -05:00
debug self => _15;
debug other => _16;
let mut _5: usize;
let mut _6: usize;
}
2023-06-01 01:08:25 -05:00
}
2023-02-05 13:10:33 -06:00
}
}
2023-06-06 08:47:00 -05:00
scope 3 (inlined <std::ops::Range<usize> as IntoIterator>::into_iter) {
2023-08-17 12:06:55 -05:00
debug self => _3;
2023-02-05 13:10:33 -06:00
}
bb0: {
2023-08-17 12:06:55 -05:00
_3 = std::ops::Range::<usize> { start: _1, end: _2 };
StorageLive(_4);
_4 = move _3;
2023-06-06 08:47:00 -05:00
goto -> bb1;
2023-02-05 13:10:33 -06:00
}
bb1: {
2023-08-17 12:06:55 -05:00
StorageLive(_8);
StorageLive(_9);
2023-03-11 09:27:44 -06:00
StorageLive(_7);
2023-08-17 12:06:55 -05:00
StorageLive(_15);
StorageLive(_16);
2023-03-11 09:27:44 -06:00
StorageLive(_5);
2023-08-17 12:06:55 -05:00
_5 = (_4.0: usize);
StorageLive(_6);
_6 = (_4.1: usize);
_7 = Lt(move _5, move _6);
StorageDead(_6);
StorageDead(_5);
switchInt(move _7) -> [0: bb2, otherwise: bb3];
2023-02-05 13:10:33 -06:00
}
bb2: {
2023-08-20 14:00:21 -05:00
StorageDead(_16);
StorageDead(_15);
2023-08-17 12:06:55 -05:00
_8 = Option::<usize>::None;
2023-06-06 08:47:00 -05:00
goto -> bb5;
2023-06-01 01:08:25 -05:00
}
bb3: {
2023-08-20 14:00:21 -05:00
StorageDead(_16);
StorageDead(_15);
2023-08-17 12:06:55 -05:00
_9 = (_4.0: usize);
StorageLive(_10);
_10 = <usize as Step>::forward_unchecked(_9, const 1_usize) -> [return: bb4, unwind continue];
2023-06-01 01:08:25 -05:00
}
bb4: {
2023-08-17 12:06:55 -05:00
(_4.0: usize) = move _10;
StorageDead(_10);
_8 = Option::<usize>::Some(_9);
2023-06-06 08:47:00 -05:00
goto -> bb5;
2023-06-01 01:08:25 -05:00
}
bb5: {
2023-03-11 09:27:44 -06:00
StorageDead(_7);
2023-08-17 12:06:55 -05:00
StorageDead(_9);
_11 = discriminant(_8);
switchInt(move _11) -> [0: bb6, 1: bb7, otherwise: bb9];
2023-06-01 01:08:25 -05:00
}
bb6: {
2023-08-17 12:06:55 -05:00
StorageDead(_8);
StorageDead(_4);
2023-06-06 08:47:00 -05:00
return;
2023-02-05 13:10:33 -06:00
}
bb7: {
2023-08-17 12:06:55 -05:00
_12 = ((_8 as Some).0: usize);
_13 = opaque::<usize>(move _12) -> [return: bb8, unwind continue];
2023-02-05 13:10:33 -06:00
}
bb8: {
2023-08-17 12:06:55 -05:00
StorageDead(_8);
2023-06-06 08:47:00 -05:00
goto -> bb1;
2023-02-05 13:10:33 -06:00
}
bb9: {
2023-06-06 08:47:00 -05:00
unreachable;
2023-02-05 13:10:33 -06:00
}
}