fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
10.0 KiB172 linesraw
1// MIR for `main` after SimplifyCfg-initial
2
3fn main() -> () {
4    let mut _0: ();                      // return place in scope 0 at $DIR/match_test.rs:6:11: 6:11
5    let _1: i32;                         // in scope 0 at $DIR/match_test.rs:7:9: 7:10
6    let _3: i32;                         // in scope 0 at $DIR/match_test.rs:12:5: 17:6
7    let mut _4: bool;                    // in scope 0 at $DIR/match_test.rs:14:9: 14:16
8    let mut _5: bool;                    // in scope 0 at $DIR/match_test.rs:14:9: 14:16
9    let mut _6: bool;                    // in scope 0 at $DIR/match_test.rs:13:9: 13:14
10    let mut _7: bool;                    // in scope 0 at $DIR/match_test.rs:13:9: 13:14
11    let mut _8: &i32;                    // in scope 0 at $DIR/match_test.rs:12:11: 12:12
12    let mut _9: bool;                    // in scope 0 at $DIR/match_test.rs:13:18: 13:19
13    scope 1 {
14        debug x => _1;                   // in scope 1 at $DIR/match_test.rs:7:9: 7:10
15        let _2: bool;                    // in scope 1 at $DIR/match_test.rs:8:9: 8:10
16        scope 2 {
17            debug b => _2;               // in scope 2 at $DIR/match_test.rs:8:9: 8:10
18        }
19    }
20
21    bb0: {
22        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/match_test.rs:7:9: 7:10
23        _1 = const 3i32;                 // bb0[1]: scope 0 at $DIR/match_test.rs:7:13: 7:14
24                                         // ty::Const
25                                         // + ty: i32
26                                         // + val: Value(Scalar(0x00000003))
27                                         // mir::Constant
28                                         // + span: $DIR/match_test.rs:7:13: 7:14
29                                         // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
30        FakeRead(ForLet, _1);            // bb0[2]: scope 0 at $DIR/match_test.rs:7:9: 7:10
31        StorageLive(_2);                 // bb0[3]: scope 1 at $DIR/match_test.rs:8:9: 8:10
32        _2 = const true;                 // bb0[4]: scope 1 at $DIR/match_test.rs:8:13: 8:17
33                                         // ty::Const
34                                         // + ty: bool
35                                         // + val: Value(Scalar(0x01))
36                                         // mir::Constant
37                                         // + span: $DIR/match_test.rs:8:13: 8:17
38                                         // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
39        FakeRead(ForLet, _2);            // bb0[5]: scope 1 at $DIR/match_test.rs:8:9: 8:10
40        StorageLive(_3);                 // bb0[6]: scope 2 at $DIR/match_test.rs:12:5: 17:6
41        FakeRead(ForMatchedPlace, _1);   // bb0[7]: scope 2 at $DIR/match_test.rs:12:11: 12:12
42        _6 = Le(const 0i32, _1);         // bb0[8]: scope 2 at $DIR/match_test.rs:13:9: 13:14
43                                         // ty::Const
44                                         // + ty: i32
45                                         // + val: Value(Scalar(0x00000000))
46                                         // mir::Constant
47                                         // + span: $DIR/match_test.rs:13:9: 13:14
48                                         // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
49        switchInt(move _6) -> [false: bb4, otherwise: bb1]; // bb0[9]: scope 2 at $DIR/match_test.rs:13:9: 13:14
50    }
51
52    bb1: {
53        _7 = Lt(_1, const 10i32);        // bb1[0]: scope 2 at $DIR/match_test.rs:13:9: 13:14
54                                         // ty::Const
55                                         // + ty: i32
56                                         // + val: Value(Scalar(0x0000000a))
57                                         // mir::Constant
58                                         // + span: $DIR/match_test.rs:13:9: 13:14
59                                         // + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
60        switchInt(move _7) -> [false: bb4, otherwise: bb2]; // bb1[1]: scope 2 at $DIR/match_test.rs:13:9: 13:14
61    }
62
63    bb2: {
64        falseEdges -> [real: bb9, imaginary: bb6]; // bb2[0]: scope 2 at $DIR/match_test.rs:13:9: 13:14
65    }
66
67    bb3: {
68        _3 = const 3i32;                 // bb3[0]: scope 2 at $DIR/match_test.rs:16:14: 16:15
69                                         // ty::Const
70                                         // + ty: i32
71                                         // + val: Value(Scalar(0x00000003))
72                                         // mir::Constant
73                                         // + span: $DIR/match_test.rs:16:14: 16:15
74                                         // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
75        goto -> bb14;                    // bb3[1]: scope 2 at $DIR/match_test.rs:12:5: 17:6
76    }
77
78    bb4: {
79        _4 = Le(const 10i32, _1);        // bb4[0]: scope 2 at $DIR/match_test.rs:14:9: 14:16
80                                         // ty::Const
81                                         // + ty: i32
82                                         // + val: Value(Scalar(0x0000000a))
83                                         // mir::Constant
84                                         // + span: $DIR/match_test.rs:14:9: 14:16
85                                         // + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
86        switchInt(move _4) -> [false: bb7, otherwise: bb5]; // bb4[1]: scope 2 at $DIR/match_test.rs:14:9: 14:16
87    }
88
89    bb5: {
90        _5 = Le(_1, const 20i32);        // bb5[0]: scope 2 at $DIR/match_test.rs:14:9: 14:16
91                                         // ty::Const
92                                         // + ty: i32
93                                         // + val: Value(Scalar(0x00000014))
94                                         // mir::Constant
95                                         // + span: $DIR/match_test.rs:14:9: 14:16
96                                         // + literal: Const { ty: i32, val: Value(Scalar(0x00000014)) }
97        switchInt(move _5) -> [false: bb7, otherwise: bb6]; // bb5[1]: scope 2 at $DIR/match_test.rs:14:9: 14:16
98    }
99
100    bb6: {
101        falseEdges -> [real: bb12, imaginary: bb8]; // bb6[0]: scope 2 at $DIR/match_test.rs:14:9: 14:16
102    }
103
104    bb7: {
105        switchInt(_1) -> [-1i32: bb8, otherwise: bb3]; // bb7[0]: scope 2 at $DIR/match_test.rs:15:9: 15:11
106    }
107
108    bb8: {
109        falseEdges -> [real: bb13, imaginary: bb3]; // bb8[0]: scope 2 at $DIR/match_test.rs:15:9: 15:11
110    }
111
112    bb9: {
113        _8 = &shallow _1;                // bb9[0]: scope 2 at $DIR/match_test.rs:12:11: 12:12
114        StorageLive(_9);                 // bb9[1]: scope 2 at $DIR/match_test.rs:13:18: 13:19
115        _9 = _2;                         // bb9[2]: scope 2 at $DIR/match_test.rs:13:18: 13:19
116        switchInt(move _9) -> [false: bb11, otherwise: bb10]; // bb9[3]: scope 2 at $DIR/match_test.rs:13:18: 13:19
117    }
118
119    bb10: {
120        StorageDead(_9);                 // bb10[0]: scope 2 at $DIR/match_test.rs:13:24: 13:25
121        FakeRead(ForMatchGuard, _8);     // bb10[1]: scope 2 at $DIR/match_test.rs:13:18: 13:19
122        _3 = const 0i32;                 // bb10[2]: scope 2 at $DIR/match_test.rs:13:23: 13:24
123                                         // ty::Const
124                                         // + ty: i32
125                                         // + val: Value(Scalar(0x00000000))
126                                         // mir::Constant
127                                         // + span: $DIR/match_test.rs:13:23: 13:24
128                                         // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
129        goto -> bb14;                    // bb10[3]: scope 2 at $DIR/match_test.rs:12:5: 17:6
130    }
131
132    bb11: {
133        StorageDead(_9);                 // bb11[0]: scope 2 at $DIR/match_test.rs:13:24: 13:25
134        falseEdges -> [real: bb3, imaginary: bb6]; // bb11[1]: scope 2 at $DIR/match_test.rs:13:18: 13:19
135    }
136
137    bb12: {
138        _3 = const 1i32;                 // bb12[0]: scope 2 at $DIR/match_test.rs:14:20: 14:21
139                                         // ty::Const
140                                         // + ty: i32
141                                         // + val: Value(Scalar(0x00000001))
142                                         // mir::Constant
143                                         // + span: $DIR/match_test.rs:14:20: 14:21
144                                         // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
145        goto -> bb14;                    // bb12[1]: scope 2 at $DIR/match_test.rs:12:5: 17:6
146    }
147
148    bb13: {
149        _3 = const 2i32;                 // bb13[0]: scope 2 at $DIR/match_test.rs:15:15: 15:16
150                                         // ty::Const
151                                         // + ty: i32
152                                         // + val: Value(Scalar(0x00000002))
153                                         // mir::Constant
154                                         // + span: $DIR/match_test.rs:15:15: 15:16
155                                         // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
156        goto -> bb14;                    // bb13[1]: scope 2 at $DIR/match_test.rs:12:5: 17:6
157    }
158
159    bb14: {
160        StorageDead(_3);                 // bb14[0]: scope 2 at $DIR/match_test.rs:17:6: 17:7
161        _0 = const ();                   // bb14[1]: scope 0 at $DIR/match_test.rs:6:11: 18:2
162                                         // ty::Const
163                                         // + ty: ()
164                                         // + val: Value(Scalar(<ZST>))
165                                         // mir::Constant
166                                         // + span: $DIR/match_test.rs:6:11: 18:2
167                                         // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
168        StorageDead(_2);                 // bb14[2]: scope 1 at $DIR/match_test.rs:18:1: 18:2
169        StorageDead(_1);                 // bb14[3]: scope 0 at $DIR/match_test.rs:18:1: 18:2
170        return;                          // bb14[4]: scope 0 at $DIR/match_test.rs:18:2: 18:2
171    }
172}