fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
7.9 KiB275 linesraw
1- // MIR for `slices` before GVN
2+ // MIR for `slices` after GVN
3  
4  fn slices() -> () {
5      let mut _0: ();
6      let _1: &str;
7      let _2: ();
8      let mut _3: &str;
9      let _5: ();
10      let mut _6: &str;
11      let _7: ();
12      let mut _8: (&*const u8, &*const u8);
13      let mut _9: &*const u8;
14      let _10: *const u8;
15      let mut _11: &str;
16      let mut _12: &*const u8;
17      let _13: *const u8;
18      let mut _14: &str;
19      let mut _17: bool;
20      let mut _18: *const u8;
21      let mut _19: *const u8;
22      let mut _20: !;
23      let _22: !;
24      let mut _23: core::panicking::AssertKind;
25      let mut _24: &*const u8;
26      let _25: &*const u8;
27      let mut _26: &*const u8;
28      let _27: &*const u8;
29      let mut _28: std::option::Option<std::fmt::Arguments<'_>>;
30      let mut _30: &str;
31      let _31: ();
32      let mut _32: &[u8];
33      let _33: ();
34      let mut _34: (&*const u8, &*const u8);
35      let mut _35: &*const u8;
36      let _36: *const u8;
37      let mut _37: &str;
38      let mut _38: &*const u8;
39      let _39: *const u8;
40      let mut _40: &[u8];
41      let mut _43: bool;
42      let mut _44: *const u8;
43      let mut _45: *const u8;
44      let mut _46: !;
45      let _48: !;
46      let mut _49: core::panicking::AssertKind;
47      let mut _50: &*const u8;
48      let _51: &*const u8;
49      let mut _52: &*const u8;
50      let _53: &*const u8;
51      let mut _54: std::option::Option<std::fmt::Arguments<'_>>;
52      scope 1 {
53          debug s => _1;
54          let _4: &str;
55          scope 2 {
56              debug t => _4;
57              let _15: &*const u8;
58              let _16: &*const u8;
59              let _29: &[u8];
60              scope 3 {
61                  debug left_val => _15;
62                  debug right_val => _16;
63                  let _21: core::panicking::AssertKind;
64                  scope 4 {
65                      debug kind => _21;
66                  }
67              }
68              scope 5 {
69                  debug u => _29;
70                  let _41: &*const u8;
71                  let _42: &*const u8;
72                  scope 7 {
73                      debug left_val => _41;
74                      debug right_val => _42;
75                      let _47: core::panicking::AssertKind;
76                      scope 8 {
77                          debug kind => _47;
78                      }
79                  }
80              }
81              scope 6 {
82              }
83          }
84      }
85  
86      bb0: {
87-         StorageLive(_1);
88          _1 = const "my favourite slice";
89          StorageLive(_2);
90-         StorageLive(_3);
91-         _3 = _1;
92-         _2 = opaque::<&str>(move _3) -> [return: bb1, unwind continue];
93+         _2 = opaque::<&str>(_1) -> [return: bb1, unwind continue];
94      }
95  
96      bb1: {
97-         StorageDead(_3);
98          StorageDead(_2);
99          StorageLive(_4);
100          _4 = _1;
101          StorageLive(_5);
102-         StorageLive(_6);
103-         _6 = _4;
104-         _5 = opaque::<&str>(move _6) -> [return: bb2, unwind continue];
105+         _5 = opaque::<&str>(_1) -> [return: bb2, unwind continue];
106      }
107  
108      bb2: {
109-         StorageDead(_6);
110          StorageDead(_5);
111-         StorageLive(_7);
112          StorageLive(_8);
113          StorageLive(_9);
114          StorageLive(_10);
115          StorageLive(_11);
116          _11 = &(*_1);
117          _10 = core::str::<impl str>::as_ptr(move _11) -> [return: bb3, unwind continue];
118      }
119  
120      bb3: {
121          StorageDead(_11);
122          _9 = &_10;
123          StorageLive(_12);
124          StorageLive(_13);
125          StorageLive(_14);
126          _14 = &(*_4);
127          _13 = core::str::<impl str>::as_ptr(move _14) -> [return: bb4, unwind continue];
128      }
129  
130      bb4: {
131          StorageDead(_14);
132          _12 = &_13;
133          _8 = (move _9, move _12);
134          StorageDead(_12);
135          StorageDead(_9);
136          StorageLive(_15);
137          _15 = (_8.0: &*const u8);
138          StorageLive(_16);
139          _16 = (_8.1: &*const u8);
140          StorageLive(_17);
141          StorageLive(_18);
142          _18 = (*_15);
143          StorageLive(_19);
144          _19 = (*_16);
145          _17 = Eq(move _18, move _19);
146          switchInt(move _17) -> [0: bb6, otherwise: bb5];
147      }
148  
149      bb5: {
150          StorageDead(_19);
151          StorageDead(_18);
152-         _7 = const ();
153          StorageDead(_17);
154          StorageDead(_16);
155          StorageDead(_15);
156          StorageDead(_13);
157          StorageDead(_10);
158          StorageDead(_8);
159-         StorageDead(_7);
160-         StorageLive(_29);
161          StorageLive(_30);
162          _30 = &(*_1);
163          _29 = move _30 as &[u8] (Transmute);
164          StorageDead(_30);
165          StorageLive(_31);
166-         StorageLive(_32);
167-         _32 = _29;
168-         _31 = opaque::<&[u8]>(move _32) -> [return: bb7, unwind continue];
169+         _31 = opaque::<&[u8]>(_29) -> [return: bb7, unwind continue];
170      }
171  
172      bb6: {
173          StorageDead(_19);
174          StorageDead(_18);
175-         StorageLive(_21);
176          _21 = core::panicking::AssertKind::Eq;
177          StorageLive(_22);
178-         StorageLive(_23);
179-         _23 = move _21;
180          StorageLive(_24);
181          StorageLive(_25);
182          _25 = &(*_15);
183          _24 = &(*_25);
184          StorageLive(_26);
185          StorageLive(_27);
186          _27 = &(*_16);
187          _26 = &(*_27);
188          StorageLive(_28);
189          _28 = Option::<Arguments<'_>>::None;
190-         _22 = core::panicking::assert_failed::<*const u8, *const u8>(move _23, move _24, move _26, move _28) -> unwind continue;
191+         _22 = core::panicking::assert_failed::<*const u8, *const u8>(_21, move _24, move _26, move _28) -> unwind continue;
192      }
193  
194      bb7: {
195-         StorageDead(_32);
196          StorageDead(_31);
197-         StorageLive(_33);
198          StorageLive(_34);
199          StorageLive(_35);
200          StorageLive(_36);
201          StorageLive(_37);
202          _37 = &(*_1);
203          _36 = core::str::<impl str>::as_ptr(move _37) -> [return: bb8, unwind continue];
204      }
205  
206      bb8: {
207          StorageDead(_37);
208          _35 = &_36;
209          StorageLive(_38);
210          StorageLive(_39);
211          StorageLive(_40);
212          _40 = &(*_29);
213          _39 = core::slice::<impl [u8]>::as_ptr(move _40) -> [return: bb9, unwind continue];
214      }
215  
216      bb9: {
217          StorageDead(_40);
218          _38 = &_39;
219          _34 = (move _35, move _38);
220          StorageDead(_38);
221          StorageDead(_35);
222          StorageLive(_41);
223          _41 = (_34.0: &*const u8);
224          StorageLive(_42);
225          _42 = (_34.1: &*const u8);
226          StorageLive(_43);
227          StorageLive(_44);
228          _44 = (*_41);
229          StorageLive(_45);
230          _45 = (*_42);
231          _43 = Eq(move _44, move _45);
232          switchInt(move _43) -> [0: bb11, otherwise: bb10];
233      }
234  
235      bb10: {
236          StorageDead(_45);
237          StorageDead(_44);
238-         _33 = const ();
239          StorageDead(_43);
240          StorageDead(_42);
241          StorageDead(_41);
242          StorageDead(_39);
243          StorageDead(_36);
244          StorageDead(_34);
245-         StorageDead(_33);
246          _0 = const ();
247-         StorageDead(_29);
248          StorageDead(_4);
249-         StorageDead(_1);
250          return;
251      }
252  
253      bb11: {
254          StorageDead(_45);
255          StorageDead(_44);
256-         StorageLive(_47);
257          _47 = core::panicking::AssertKind::Eq;
258          StorageLive(_48);
259-         StorageLive(_49);
260-         _49 = move _47;
261          StorageLive(_50);
262          StorageLive(_51);
263          _51 = &(*_41);
264          _50 = &(*_51);
265          StorageLive(_52);
266          StorageLive(_53);
267          _53 = &(*_42);
268          _52 = &(*_53);
269          StorageLive(_54);
270          _54 = Option::<Arguments<'_>>::None;
271-         _48 = core::panicking::assert_failed::<*const u8, *const u8>(move _49, move _50, move _52, move _54) -> unwind continue;
272+         _48 = core::panicking::assert_failed::<*const u8, *const u8>(_47, move _50, move _52, move _54) -> unwind continue;
273      }
274  }
275