about summary refs log tree commit diff
path: root/tests/mir-opt/pre-codegen/derived_ord.demo_le.PreCodegen.after.mir
blob: e235fa35c02389a93d612f618337f77f25cdcefc (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
103
104
105
// MIR for `demo_le` after PreCodegen

fn demo_le(_1: &MultiField, _2: &MultiField) -> bool {
    debug a => _1;
    debug b => _2;
    let mut _0: bool;
    scope 1 (inlined <MultiField as PartialOrd>::le) {
        let mut _6: std::option::Option<std::cmp::Ordering>;
        scope 2 (inlined Option::<std::cmp::Ordering>::is_some_and::<fn(std::cmp::Ordering) -> bool {std::cmp::Ordering::is_le}>) {
            let mut _11: isize;
            let _12: std::cmp::Ordering;
            scope 3 {
                scope 4 (inlined <fn(std::cmp::Ordering) -> bool {std::cmp::Ordering::is_le} as FnOnce<(std::cmp::Ordering,)>>::call_once - shim(fn(std::cmp::Ordering) -> bool {std::cmp::Ordering::is_le})) {
                    scope 5 (inlined std::cmp::Ordering::is_le) {
                        let mut _13: i8;
                        scope 6 (inlined std::cmp::Ordering::as_raw) {
                        }
                    }
                }
            }
        }
        scope 7 (inlined <MultiField as PartialOrd>::partial_cmp) {
            let mut _7: i8;
            scope 8 {
            }
            scope 9 (inlined std::cmp::impls::<impl PartialOrd for char>::partial_cmp) {
                let mut _3: char;
                let mut _4: char;
                let mut _5: std::cmp::Ordering;
            }
            scope 10 (inlined std::cmp::impls::<impl PartialOrd for i16>::partial_cmp) {
                let mut _8: i16;
                let mut _9: i16;
                let mut _10: std::cmp::Ordering;
            }
        }
    }

    bb0: {
        StorageLive(_12);
        StorageLive(_6);
        StorageLive(_5);
        StorageLive(_7);
        StorageLive(_3);
        _3 = copy ((*_1).0: char);
        StorageLive(_4);
        _4 = copy ((*_2).0: char);
        _5 = Cmp(move _3, move _4);
        StorageDead(_4);
        StorageDead(_3);
        _6 = Option::<std::cmp::Ordering>::Some(copy _5);
        _7 = discriminant(_5);
        switchInt(move _7) -> [0: bb1, otherwise: bb2];
    }

    bb1: {
        StorageLive(_10);
        StorageLive(_8);
        _8 = copy ((*_1).1: i16);
        StorageLive(_9);
        _9 = copy ((*_2).1: i16);
        _10 = Cmp(move _8, move _9);
        StorageDead(_9);
        StorageDead(_8);
        _6 = Option::<std::cmp::Ordering>::Some(move _10);
        StorageDead(_10);
        StorageDead(_7);
        StorageDead(_5);
        StorageLive(_11);
        goto -> bb4;
    }

    bb2: {
        StorageDead(_7);
        StorageDead(_5);
        StorageLive(_11);
        _11 = discriminant(_6);
        switchInt(move _11) -> [0: bb3, 1: bb4, otherwise: bb6];
    }

    bb3: {
        _0 = const false;
        goto -> bb5;
    }

    bb4: {
        _12 = move ((_6 as Some).0: std::cmp::Ordering);
        StorageLive(_13);
        _13 = discriminant(_12);
        _0 = Le(move _13, const 0_i8);
        StorageDead(_13);
        goto -> bb5;
    }

    bb5: {
        StorageDead(_11);
        StorageDead(_6);
        StorageDead(_12);
        return;
    }

    bb6: {
        unreachable;
    }
}