summary refs log tree commit diff
path: root/src/test/mir-opt/match_test/rustc.main.SimplifyCfg-initial.after.mir
blob: 9408248b25dd39253c79f0d3116536f49a0da390 (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
// MIR for `main` after SimplifyCfg-initial

fn main() -> () {
    let mut _0: ();                      // return place in scope 0 at $DIR/match_test.rs:6:11: 6:11
    let _1: i32;                         // in scope 0 at $DIR/match_test.rs:7:9: 7:10
    let _3: i32;                         // in scope 0 at $DIR/match_test.rs:12:5: 17:6
    let mut _4: bool;                    // in scope 0 at $DIR/match_test.rs:14:9: 14:16
    let mut _5: bool;                    // in scope 0 at $DIR/match_test.rs:14:9: 14:16
    let mut _6: bool;                    // in scope 0 at $DIR/match_test.rs:13:9: 13:14
    let mut _7: bool;                    // in scope 0 at $DIR/match_test.rs:13:9: 13:14
    let mut _8: &i32;                    // in scope 0 at $DIR/match_test.rs:12:11: 12:12
    let mut _9: bool;                    // in scope 0 at $DIR/match_test.rs:13:18: 13:19
    scope 1 {
        debug x => _1;                   // in scope 1 at $DIR/match_test.rs:7:9: 7:10
        let _2: bool;                    // in scope 1 at $DIR/match_test.rs:8:9: 8:10
        scope 2 {
            debug b => _2;               // in scope 2 at $DIR/match_test.rs:8:9: 8:10
        }
    }

    bb0: {
        StorageLive(_1);                 // scope 0 at $DIR/match_test.rs:7:9: 7:10
        _1 = const 3i32;                 // scope 0 at $DIR/match_test.rs:7:13: 7:14
                                         // ty::Const
                                         // + ty: i32
                                         // + val: Value(Scalar(0x00000003))
                                         // mir::Constant
                                         // + span: $DIR/match_test.rs:7:13: 7:14
                                         // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
        FakeRead(ForLet, _1);            // scope 0 at $DIR/match_test.rs:7:9: 7:10
        StorageLive(_2);                 // scope 1 at $DIR/match_test.rs:8:9: 8:10
        _2 = const true;                 // scope 1 at $DIR/match_test.rs:8:13: 8:17
                                         // ty::Const
                                         // + ty: bool
                                         // + val: Value(Scalar(0x01))
                                         // mir::Constant
                                         // + span: $DIR/match_test.rs:8:13: 8:17
                                         // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
        FakeRead(ForLet, _2);            // scope 1 at $DIR/match_test.rs:8:9: 8:10
        StorageLive(_3);                 // scope 2 at $DIR/match_test.rs:12:5: 17:6
        FakeRead(ForMatchedPlace, _1);   // scope 2 at $DIR/match_test.rs:12:11: 12:12
        _6 = Le(const 0i32, _1);         // scope 2 at $DIR/match_test.rs:13:9: 13:14
                                         // ty::Const
                                         // + ty: i32
                                         // + val: Value(Scalar(0x00000000))
                                         // mir::Constant
                                         // + span: $DIR/match_test.rs:13:9: 13:14
                                         // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
        switchInt(move _6) -> [false: bb4, otherwise: bb1]; // scope 2 at $DIR/match_test.rs:13:9: 13:14
    }

    bb1: {
        _7 = Lt(_1, const 10i32);        // scope 2 at $DIR/match_test.rs:13:9: 13:14
                                         // ty::Const
                                         // + ty: i32
                                         // + val: Value(Scalar(0x0000000a))
                                         // mir::Constant
                                         // + span: $DIR/match_test.rs:13:9: 13:14
                                         // + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
        switchInt(move _7) -> [false: bb4, otherwise: bb2]; // scope 2 at $DIR/match_test.rs:13:9: 13:14
    }

    bb2: {
        falseEdges -> [real: bb9, imaginary: bb6]; // scope 2 at $DIR/match_test.rs:13:9: 13:14
    }

    bb3: {
        _3 = const 3i32;                 // scope 2 at $DIR/match_test.rs:16:14: 16:15
                                         // ty::Const
                                         // + ty: i32
                                         // + val: Value(Scalar(0x00000003))
                                         // mir::Constant
                                         // + span: $DIR/match_test.rs:16:14: 16:15
                                         // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
        goto -> bb14;                    // scope 2 at $DIR/match_test.rs:12:5: 17:6
    }

    bb4: {
        _4 = Le(const 10i32, _1);        // scope 2 at $DIR/match_test.rs:14:9: 14:16
                                         // ty::Const
                                         // + ty: i32
                                         // + val: Value(Scalar(0x0000000a))
                                         // mir::Constant
                                         // + span: $DIR/match_test.rs:14:9: 14:16
                                         // + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
        switchInt(move _4) -> [false: bb7, otherwise: bb5]; // scope 2 at $DIR/match_test.rs:14:9: 14:16
    }

    bb5: {
        _5 = Le(_1, const 20i32);        // scope 2 at $DIR/match_test.rs:14:9: 14:16
                                         // ty::Const
                                         // + ty: i32
                                         // + val: Value(Scalar(0x00000014))
                                         // mir::Constant
                                         // + span: $DIR/match_test.rs:14:9: 14:16
                                         // + literal: Const { ty: i32, val: Value(Scalar(0x00000014)) }
        switchInt(move _5) -> [false: bb7, otherwise: bb6]; // scope 2 at $DIR/match_test.rs:14:9: 14:16
    }

    bb6: {
        falseEdges -> [real: bb12, imaginary: bb8]; // scope 2 at $DIR/match_test.rs:14:9: 14:16
    }

    bb7: {
        switchInt(_1) -> [-1i32: bb8, otherwise: bb3]; // scope 2 at $DIR/match_test.rs:15:9: 15:11
    }

    bb8: {
        falseEdges -> [real: bb13, imaginary: bb3]; // scope 2 at $DIR/match_test.rs:15:9: 15:11
    }

    bb9: {
        _8 = &shallow _1;                // scope 2 at $DIR/match_test.rs:12:11: 12:12
        StorageLive(_9);                 // scope 2 at $DIR/match_test.rs:13:18: 13:19
        _9 = _2;                         // scope 2 at $DIR/match_test.rs:13:18: 13:19
        switchInt(move _9) -> [false: bb11, otherwise: bb10]; // scope 2 at $DIR/match_test.rs:13:18: 13:19
    }

    bb10: {
        StorageDead(_9);                 // scope 2 at $DIR/match_test.rs:13:24: 13:25
        FakeRead(ForMatchGuard, _8);     // scope 2 at $DIR/match_test.rs:13:18: 13:19
        _3 = const 0i32;                 // scope 2 at $DIR/match_test.rs:13:23: 13:24
                                         // ty::Const
                                         // + ty: i32
                                         // + val: Value(Scalar(0x00000000))
                                         // mir::Constant
                                         // + span: $DIR/match_test.rs:13:23: 13:24
                                         // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
        goto -> bb14;                    // scope 2 at $DIR/match_test.rs:12:5: 17:6
    }

    bb11: {
        StorageDead(_9);                 // scope 2 at $DIR/match_test.rs:13:24: 13:25
        falseEdges -> [real: bb3, imaginary: bb6]; // scope 2 at $DIR/match_test.rs:13:18: 13:19
    }

    bb12: {
        _3 = const 1i32;                 // scope 2 at $DIR/match_test.rs:14:20: 14:21
                                         // ty::Const
                                         // + ty: i32
                                         // + val: Value(Scalar(0x00000001))
                                         // mir::Constant
                                         // + span: $DIR/match_test.rs:14:20: 14:21
                                         // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
        goto -> bb14;                    // scope 2 at $DIR/match_test.rs:12:5: 17:6
    }

    bb13: {
        _3 = const 2i32;                 // scope 2 at $DIR/match_test.rs:15:15: 15:16
                                         // ty::Const
                                         // + ty: i32
                                         // + val: Value(Scalar(0x00000002))
                                         // mir::Constant
                                         // + span: $DIR/match_test.rs:15:15: 15:16
                                         // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
        goto -> bb14;                    // scope 2 at $DIR/match_test.rs:12:5: 17:6
    }

    bb14: {
        StorageDead(_3);                 // scope 2 at $DIR/match_test.rs:17:6: 17:7
        _0 = const ();                   // scope 0 at $DIR/match_test.rs:6:11: 18:2
                                         // ty::Const
                                         // + ty: ()
                                         // + val: Value(Scalar(<ZST>))
                                         // mir::Constant
                                         // + span: $DIR/match_test.rs:6:11: 18:2
                                         // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
        StorageDead(_2);                 // scope 1 at $DIR/match_test.rs:18:1: 18:2
        StorageDead(_1);                 // scope 0 at $DIR/match_test.rs:18:1: 18:2
        return;                          // scope 0 at $DIR/match_test.rs:18:2: 18:2
    }
}