about summary refs log tree commit diff
path: root/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir
blob: 99dc9600e41e5d096a4e88b542f8daa424bdf69c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// MIR for `int_range` after PreCodegen

fn int_range(_1: usize, _2: usize) -> () {
    debug start => _1;
    debug end => _2;
    let mut _0: ();
    let mut _3: usize;
    let mut _6: std::option::Option<usize>;
    let mut _9: isize;
    let _11: ();
    scope 1 {
        debug iter => std::ops::Range<usize>{ .0 => _3, .1 => _2, };
        let _10: usize;
        scope 2 {
            debug i => _10;
        }
        scope 4 (inlined iter::range::<impl Iterator for std::ops::Range<usize>>::next) {
            debug self => &std::ops::Range<usize>{ .0 => _3, .1 => _2, };
            scope 5 (inlined <std::ops::Range<usize> as iter::range::RangeIteratorImpl>::spec_next) {
                debug self => &std::ops::Range<usize>{ .0 => _3, .1 => _2, };
                let mut _5: bool;
                let _7: usize;
                let mut _8: usize;
                scope 6 {
                    debug old => _7;
                    scope 7 {
                    }
                }
                scope 8 (inlined cmp::impls::<impl PartialOrd for usize>::lt) {
                    debug self => &_3;
                    debug other => &_2;
                    let mut _4: usize;
                }
            }
        }
    }
    scope 3 (inlined <std::ops::Range<usize> as IntoIterator>::into_iter) {
        debug self => std::ops::Range<usize>{ .0 => _1, .1 => _2, };
    }

    bb0: {
        StorageLive(_3);
        _3 = _1;
        goto -> bb1;
    }

    bb1: {
        StorageLive(_6);
        StorageLive(_7);
        StorageLive(_5);
        StorageLive(_4);
        _4 = _3;
        _5 = Lt(move _4, _2);
        StorageDead(_4);
        switchInt(move _5) -> [0: bb2, otherwise: bb3];
    }

    bb2: {
        _6 = Option::<usize>::None;
        goto -> bb5;
    }

    bb3: {
        _7 = _3;
        StorageLive(_8);
        _8 = <usize as Step>::forward_unchecked(_7, const 1_usize) -> [return: bb4, unwind continue];
    }

    bb4: {
        _3 = move _8;
        StorageDead(_8);
        _6 = Option::<usize>::Some(_7);
        goto -> bb5;
    }

    bb5: {
        StorageDead(_5);
        StorageDead(_7);
        _9 = discriminant(_6);
        switchInt(move _9) -> [0: bb6, 1: bb7, otherwise: bb9];
    }

    bb6: {
        StorageDead(_6);
        StorageDead(_3);
        return;
    }

    bb7: {
        _10 = ((_6 as Some).0: usize);
        _11 = opaque::<usize>(_10) -> [return: bb8, unwind continue];
    }

    bb8: {
        StorageDead(_6);
        goto -> bb1;
    }

    bb9: {
        unreachable;
    }
}