summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/reference_prop.reference_propagation_mut.ReferencePropagation.diff
blob: 7c7f424bba2bd26a9278cd101aeaea672118d859 (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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
- // MIR for `reference_propagation_mut` before ReferencePropagation
+ // MIR for `reference_propagation_mut` after ReferencePropagation
  
  fn reference_propagation_mut(_1: &mut T, _2: &mut T) -> () {
      debug single => _1;
      debug multiple => _2;
      let mut _0: ();
      let _3: ();
      let mut _4: usize;
      let _7: ();
      let mut _8: ();
      let _9: ();
      let mut _10: usize;
      let mut _13: &mut usize;
      let mut _14: &mut usize;
      let _16: ();
      let mut _17: ();
      let _18: ();
      let mut _19: usize;
      let _23: ();
      let mut _24: &&mut usize;
      let _25: ();
      let mut _26: usize;
      let _30: ();
      let mut _31: *mut &mut usize;
      let _32: ();
      let mut _33: usize;
      let _36: ();
      let mut _37: &mut usize;
      let _38: ();
      let mut _39: usize;
      let _45: ();
      let mut _46: &mut usize;
      let _47: ();
      let _48: &mut T;
      let _50: ();
      let mut _51: ();
      let _52: ();
      let _53: &mut T;
      let mut _54: &mut T;
      let mut _55: &mut T;
      let _57: ();
      let mut _58: ();
      let _59: ();
      let mut _60: usize;
      let _64: ();
      let mut _65: ();
      let mut _66: usize;
      let _70: ();
      let mut _71: ();
      scope 1 {
          debug a => _4;
          let _5: &mut usize;
          scope 2 {
              debug b => _5;
              let _6: usize;
              scope 3 {
                  debug c => _6;
              }
          }
      }
      scope 4 {
          debug a => _10;
          let mut _11: usize;
          scope 5 {
              debug a2 => _11;
              let mut _12: &mut usize;
              scope 6 {
                  debug b => _12;
                  let _15: usize;
                  scope 7 {
                      debug c => _15;
                  }
              }
          }
      }
      scope 8 {
          debug a => _19;
          let _20: &mut usize;
          scope 9 {
              debug b => _20;
              let _21: &&mut usize;
              scope 10 {
                  debug d => _21;
                  let _22: usize;
                  scope 11 {
                      debug c => _22;
                  }
              }
          }
      }
      scope 12 {
          debug a => _26;
          let mut _27: &mut usize;
          scope 13 {
              debug b => _27;
              let _28: *mut &mut usize;
              scope 14 {
                  debug d => _28;
                  let _29: usize;
                  scope 15 {
                      debug c => _29;
                  }
              }
          }
      }
      scope 16 {
          debug a => _33;
          let _34: &mut usize;
          scope 17 {
              debug b => _34;
              let _35: usize;
              scope 18 {
                  debug c => _35;
              }
          }
      }
      scope 19 {
          debug a => _39;
          let _40: &mut usize;
          scope 20 {
              debug b1 => _40;
              let _41: usize;
              scope 21 {
                  debug c => _41;
                  let _42: &mut usize;
                  scope 22 {
                      debug b2 => _42;
                      let _43: usize;
                      scope 23 {
                          debug c2 => _43;
                          let _44: &mut usize;
                          scope 24 {
                              debug b3 => _44;
                          }
                      }
                  }
              }
          }
      }
      scope 25 {
-         debug a => _48;
+         debug a => _1;
          let _49: T;
          scope 26 {
              debug b => _49;
          }
      }
      scope 27 {
          debug a => _53;
          let _56: T;
          scope 28 {
              debug b => _56;
          }
      }
      scope 29 {
          debug a => _60;
          let _61: &mut usize;
          scope 30 {
              debug b => _61;
              let _62: &&mut usize;
              scope 31 {
                  debug d => _62;
                  let _63: usize;
                  scope 32 {
                      debug c => _63;
                  }
              }
          }
      }
      scope 33 {
          debug a => _66;
          let mut _67: &mut usize;
          scope 34 {
              debug b => _67;
              let _68: &mut &mut usize;
              scope 35 {
                  debug d => _68;
                  let _69: usize;
                  scope 36 {
                      debug c => _69;
                  }
              }
          }
      }
  
      bb0: {
-         StorageLive(_3);
          StorageLive(_4);
          _4 = const 5_usize;
          StorageLive(_5);
          _5 = &mut _4;
          StorageLive(_6);
-         _6 = (*_5);
+         _6 = _4;
          StorageLive(_7);
          StorageLive(_8);
          _8 = ();
          _7 = opaque::<()>(move _8) -> [return: bb1, unwind continue];
      }
  
      bb1: {
          StorageDead(_8);
          StorageDead(_7);
-         _3 = const ();
          StorageDead(_6);
          StorageDead(_5);
          StorageDead(_4);
-         StorageDead(_3);
-         StorageLive(_9);
          StorageLive(_10);
          _10 = const 5_usize;
          StorageLive(_11);
          _11 = const 7_usize;
          StorageLive(_12);
          _12 = &mut _10;
          StorageLive(_13);
-         StorageLive(_14);
-         _14 = &mut _11;
-         _13 = &mut (*_14);
+         _13 = &mut _11;
          _12 = move _13;
          StorageDead(_13);
-         StorageDead(_14);
          StorageLive(_15);
          _15 = (*_12);
          StorageLive(_16);
          StorageLive(_17);
          _17 = ();
          _16 = opaque::<()>(move _17) -> [return: bb2, unwind continue];
      }
  
      bb2: {
          StorageDead(_17);
          StorageDead(_16);
-         _9 = const ();
          StorageDead(_15);
          StorageDead(_12);
          StorageDead(_11);
          StorageDead(_10);
-         StorageDead(_9);
-         StorageLive(_18);
          StorageLive(_19);
          _19 = const 5_usize;
          StorageLive(_20);
          _20 = &mut _19;
          StorageLive(_21);
          _21 = &_20;
          StorageLive(_22);
          _22 = (*_20);
          StorageLive(_23);
          StorageLive(_24);
          _24 = _21;
          _23 = opaque::<&&mut usize>(move _24) -> [return: bb3, unwind continue];
      }
  
      bb3: {
          StorageDead(_24);
          StorageDead(_23);
-         _18 = const ();
          StorageDead(_22);
          StorageDead(_21);
          StorageDead(_20);
          StorageDead(_19);
-         StorageDead(_18);
-         StorageLive(_25);
          StorageLive(_26);
          _26 = const 5_usize;
          StorageLive(_27);
          _27 = &mut _26;
          StorageLive(_28);
          _28 = &raw mut _27;
          StorageLive(_29);
          _29 = (*_27);
          StorageLive(_30);
          StorageLive(_31);
          _31 = _28;
          _30 = opaque::<*mut &mut usize>(move _31) -> [return: bb4, unwind continue];
      }
  
      bb4: {
          StorageDead(_31);
          StorageDead(_30);
-         _25 = const ();
          StorageDead(_29);
          StorageDead(_28);
          StorageDead(_27);
          StorageDead(_26);
-         StorageDead(_25);
-         StorageLive(_32);
          StorageLive(_33);
          _33 = const 7_usize;
          StorageLive(_34);
          _34 = &mut _33;
          StorageLive(_35);
          _35 = (*_34);
          StorageLive(_36);
          StorageLive(_37);
          _37 = move _34;
          _36 = opaque::<&mut usize>(move _37) -> [return: bb5, unwind continue];
      }
  
      bb5: {
          StorageDead(_37);
          StorageDead(_36);
-         _32 = const ();
          StorageDead(_35);
          StorageDead(_34);
          StorageDead(_33);
-         StorageDead(_32);
-         StorageLive(_38);
          StorageLive(_39);
          _39 = const 7_usize;
          StorageLive(_40);
          _40 = &mut _39;
          StorageLive(_41);
          _41 = (*_40);
          StorageLive(_42);
          _42 = move _40;
          StorageLive(_43);
          _43 = (*_42);
          StorageLive(_44);
          _44 = move _42;
          StorageLive(_45);
          StorageLive(_46);
          _46 = move _44;
          _45 = opaque::<&mut usize>(move _46) -> [return: bb6, unwind continue];
      }
  
      bb6: {
          StorageDead(_46);
          StorageDead(_45);
-         _38 = const ();
          StorageDead(_44);
          StorageDead(_43);
          StorageDead(_42);
          StorageDead(_41);
          StorageDead(_40);
          StorageDead(_39);
-         StorageDead(_38);
-         StorageLive(_47);
-         StorageLive(_48);
-         _48 = &mut (*_1);
          StorageLive(_49);
-         _49 = (*_48);
+         _49 = (*_1);
          StorageLive(_50);
          StorageLive(_51);
          _51 = ();
          _50 = opaque::<()>(move _51) -> [return: bb7, unwind continue];
      }
  
      bb7: {
          StorageDead(_51);
          StorageDead(_50);
-         _47 = const ();
          StorageDead(_49);
-         StorageDead(_48);
-         StorageDead(_47);
-         StorageLive(_52);
          StorageLive(_53);
          _53 = &mut (*_2);
          StorageLive(_54);
-         StorageLive(_55);
-         _55 = &mut (*_1);
-         _54 = &mut (*_55);
+         _54 = &mut (*_1);
          _2 = move _54;
          StorageDead(_54);
-         StorageDead(_55);
          StorageLive(_56);
          _56 = (*_53);
          StorageLive(_57);
          StorageLive(_58);
          _58 = ();
          _57 = opaque::<()>(move _58) -> [return: bb8, unwind continue];
      }
  
      bb8: {
          StorageDead(_58);
          StorageDead(_57);
-         _52 = const ();
          StorageDead(_56);
          StorageDead(_53);
-         StorageDead(_52);
-         StorageLive(_59);
          StorageLive(_60);
          _60 = const 5_usize;
          StorageLive(_61);
          _61 = &mut _60;
          StorageLive(_62);
          _62 = &_61;
          StorageLive(_63);
          _63 = (*_61);
          StorageLive(_64);
          StorageLive(_65);
          _65 = ();
          _64 = opaque::<()>(move _65) -> [return: bb9, unwind continue];
      }
  
      bb9: {
          StorageDead(_65);
          StorageDead(_64);
-         _59 = const ();
          StorageDead(_63);
          StorageDead(_62);
          StorageDead(_61);
          StorageDead(_60);
-         StorageDead(_59);
          StorageLive(_66);
          _66 = const 5_usize;
          StorageLive(_67);
          _67 = &mut _66;
          StorageLive(_68);
          _68 = &mut _67;
          StorageLive(_69);
          _69 = (*_67);
          StorageLive(_70);
          StorageLive(_71);
          _71 = ();
          _70 = opaque::<()>(move _71) -> [return: bb10, unwind continue];
      }
  
      bb10: {
          StorageDead(_71);
          StorageDead(_70);
          _0 = const ();
          StorageDead(_69);
          StorageDead(_68);
          StorageDead(_67);
          StorageDead(_66);
          return;
      }
  }