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

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

98 lines
3.0 KiB
Rust
Raw Normal View History

2023-02-05 19:10:33 +00:00
// MIR for `int_range` after PreCodegen
fn int_range(_1: usize, _2: usize) -> () {
2023-06-06 09:47:00 -04:00
debug start => _1;
debug end => _2;
let mut _0: ();
2023-08-17 17:06:55 +00:00
let mut _3: std::ops::Range<usize>;
2025-06-08 15:30:09 +08:00
let mut _9: std::option::Option<usize>;
let _11: ();
let mut _12: &mut std::ops::Range<usize>;
2023-02-05 19:10:33 +00:00
scope 1 {
2025-06-08 15:30:09 +08:00
debug iter => _3;
let _10: usize;
2023-02-05 19:10:33 +00:00
scope 2 {
2025-06-08 15:30:09 +08:00
debug i => _10;
2023-02-05 19:10:33 +00:00
}
2023-06-06 09:47:00 -04:00
scope 4 (inlined iter::range::<impl Iterator for std::ops::Range<usize>>::next) {
2025-06-08 15:30:09 +08:00
debug self => _12;
2023-06-06 09:47:00 -04:00
scope 5 (inlined <std::ops::Range<usize> as iter::range::RangeIteratorImpl>::spec_next) {
2025-06-08 15:30:09 +08:00
debug self => _12;
let mut _6: bool;
let _7: usize;
let mut _8: usize;
let mut _13: &usize;
let mut _14: &usize;
2023-06-01 06:08:25 +00:00
scope 6 {
2025-06-08 15:30:09 +08:00
debug old => _7;
scope 8 (inlined <usize as Step>::forward_unchecked) {
2025-06-08 15:30:09 +08:00
debug start => _7;
debug n => const 1_usize;
scope 9 (inlined #[track_caller] core::num::<impl usize>::unchecked_add) {
2025-06-08 15:30:09 +08:00
debug self => _7;
debug rhs => const 1_usize;
scope 10 (inlined core::ub_checks::check_language_ub) {
scope 11 (inlined core::ub_checks::check_language_ub::runtime) {
}
}
}
}
2023-06-01 06:08:25 +00:00
}
scope 7 (inlined std::cmp::impls::<impl PartialOrd for usize>::lt) {
2025-06-08 15:30:09 +08:00
debug self => _13;
debug other => _14;
let mut _4: usize;
let mut _5: usize;
}
2023-06-01 06:08:25 +00:00
}
2023-02-05 19:10:33 +00:00
}
}
2023-06-06 09:47:00 -04:00
scope 3 (inlined <std::ops::Range<usize> as IntoIterator>::into_iter) {
2023-08-17 17:06:55 +00:00
debug self => _3;
2023-02-05 19:10:33 +00:00
}
bb0: {
2023-08-17 17:06:55 +00:00
_3 = std::ops::Range::<usize> { start: copy _1, end: copy _2 };
2023-06-06 09:47:00 -04:00
goto -> bb1;
2023-02-05 19:10:33 +00:00
}
bb1: {
2023-08-17 17:06:55 +00:00
StorageLive(_9);
2025-06-08 15:30:09 +08:00
// DBG: _12 = &_3;
StorageLive(_6);
// DBG: _13 = &(_3.0: usize);
// DBG: _14 = &(_3.1: usize);
StorageLive(_4);
_4 = copy (_3.0: usize);
StorageLive(_5);
_5 = copy (_3.1: usize);
_6 = Lt(move _4, move _5);
StorageDead(_5);
StorageDead(_4);
switchInt(move _6) -> [0: bb2, otherwise: bb3];
2023-02-05 19:10:33 +00:00
}
bb2: {
2025-06-08 15:30:09 +08:00
StorageDead(_6);
StorageDead(_9);
2023-01-18 17:57:50 +00:00
return;
2023-06-01 06:08:25 +00:00
}
bb3: {
2025-06-08 15:30:09 +08:00
_7 = copy (_3.0: usize);
StorageLive(_8);
_8 = AddUnchecked(copy _7, const 1_usize);
(_3.0: usize) = move _8;
StorageDead(_8);
_9 = Option::<usize>::Some(copy _7);
StorageDead(_6);
2025-06-08 15:30:09 +08:00
_10 = copy ((_9 as Some).0: usize);
_11 = opaque::<usize>(move _10) -> [return: bb4, unwind continue];
2023-02-05 19:10:33 +00:00
}
bb4: {
2025-06-08 15:30:09 +08:00
StorageDead(_9);
2023-06-06 09:47:00 -04:00
goto -> bb1;
2023-02-05 19:10:33 +00:00
}
2023-05-21 10:33:03 +00:00
}