fork/rust

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

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

master
10.2 KiB342 linesraw
1- // MIR for `arithmetic` before GVN
2+ // MIR for `arithmetic` after GVN
3  
4  fn arithmetic(_1: u64) -> () {
5      debug x => _1;
6      let mut _0: ();
7      let _2: ();
8      let mut _3: u64;
9      let mut _4: u64;
10      let _5: ();
11      let mut _6: u64;
12      let mut _7: u64;
13      let _8: ();
14      let mut _9: u64;
15      let mut _10: u64;
16      let _11: ();
17      let mut _12: u64;
18      let mut _13: u64;
19      let _14: ();
20      let mut _15: u64;
21      let mut _16: u64;
22      let mut _17: bool;
23      let _18: ();
24      let mut _19: u64;
25      let mut _20: u64;
26      let mut _21: bool;
27      let _22: ();
28      let mut _23: u64;
29      let mut _24: u64;
30      let mut _25: bool;
31      let _26: ();
32      let mut _27: u64;
33      let mut _28: u64;
34      let mut _29: bool;
35      let _30: ();
36      let mut _31: u64;
37      let mut _32: u64;
38      let mut _33: bool;
39      let _34: ();
40      let mut _35: u64;
41      let mut _36: u64;
42      let mut _37: bool;
43      let _38: ();
44      let mut _39: u64;
45      let mut _40: u64;
46      let mut _41: bool;
47      let _42: ();
48      let mut _43: u64;
49      let mut _44: u64;
50      let mut _45: bool;
51      let _46: ();
52      let mut _47: u64;
53      let mut _48: u64;
54      let _49: ();
55      let mut _50: u64;
56      let mut _51: u64;
57      let _52: ();
58      let mut _53: u64;
59      let mut _54: u64;
60      let _55: ();
61      let mut _56: u64;
62      let mut _57: u64;
63      let _58: ();
64      let mut _59: u64;
65      let mut _60: u64;
66  
67      bb0: {
68          StorageLive(_2);
69          StorageLive(_3);
70-         StorageLive(_4);
71-         _4 = _1;
72-         _3 = Add(move _4, const 0_u64);
73-         StorageDead(_4);
74+         _3 = Add(_1, const 0_u64);
75          _2 = opaque::<u64>(move _3) -> [return: bb1, unwind unreachable];
76      }
77  
78      bb1: {
79          StorageDead(_3);
80          StorageDead(_2);
81          StorageLive(_5);
82          StorageLive(_6);
83-         StorageLive(_7);
84-         _7 = _1;
85-         _6 = Sub(move _7, const 0_u64);
86-         StorageDead(_7);
87+         _6 = Sub(_1, const 0_u64);
88          _5 = opaque::<u64>(move _6) -> [return: bb2, unwind unreachable];
89      }
90  
91      bb2: {
92          StorageDead(_6);
93          StorageDead(_5);
94          StorageLive(_8);
95          StorageLive(_9);
96-         StorageLive(_10);
97-         _10 = _1;
98-         _9 = Mul(move _10, const 0_u64);
99-         StorageDead(_10);
100+         _9 = Mul(_1, const 0_u64);
101          _8 = opaque::<u64>(move _9) -> [return: bb3, unwind unreachable];
102      }
103  
104      bb3: {
105          StorageDead(_9);
106          StorageDead(_8);
107          StorageLive(_11);
108          StorageLive(_12);
109-         StorageLive(_13);
110-         _13 = _1;
111-         _12 = Mul(move _13, const 1_u64);
112-         StorageDead(_13);
113+         _12 = Mul(_1, const 1_u64);
114          _11 = opaque::<u64>(move _12) -> [return: bb4, unwind unreachable];
115      }
116  
117      bb4: {
118          StorageDead(_12);
119          StorageDead(_11);
120          StorageLive(_14);
121          StorageLive(_15);
122-         StorageLive(_16);
123-         _16 = _1;
124          _17 = Eq(const 0_u64, const 0_u64);
125-         assert(!move _17, "attempt to divide `{}` by zero", _16) -> [success: bb5, unwind unreachable];
126+         assert(!_17, "attempt to divide `{}` by zero", _1) -> [success: bb5, unwind unreachable];
127      }
128  
129      bb5: {
130-         _15 = Div(move _16, const 0_u64);
131-         StorageDead(_16);
132+         _15 = Div(_1, const 0_u64);
133          _14 = opaque::<u64>(move _15) -> [return: bb6, unwind unreachable];
134      }
135  
136      bb6: {
137          StorageDead(_15);
138          StorageDead(_14);
139          StorageLive(_18);
140          StorageLive(_19);
141-         StorageLive(_20);
142-         _20 = _1;
143          _21 = Eq(const 1_u64, const 0_u64);
144-         assert(!move _21, "attempt to divide `{}` by zero", _20) -> [success: bb7, unwind unreachable];
145+         assert(!_21, "attempt to divide `{}` by zero", _1) -> [success: bb7, unwind unreachable];
146      }
147  
148      bb7: {
149-         _19 = Div(move _20, const 1_u64);
150-         StorageDead(_20);
151+         _19 = Div(_1, const 1_u64);
152          _18 = opaque::<u64>(move _19) -> [return: bb8, unwind unreachable];
153      }
154  
155      bb8: {
156          StorageDead(_19);
157          StorageDead(_18);
158          StorageLive(_22);
159          StorageLive(_23);
160-         StorageLive(_24);
161-         _24 = _1;
162-         _25 = Eq(_24, const 0_u64);
163-         assert(!move _25, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb9, unwind unreachable];
164+         _25 = Eq(_1, const 0_u64);
165+         assert(!_25, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb9, unwind unreachable];
166      }
167  
168      bb9: {
169-         _23 = Div(const 0_u64, move _24);
170-         StorageDead(_24);
171+         _23 = Div(const 0_u64, _1);
172          _22 = opaque::<u64>(move _23) -> [return: bb10, unwind unreachable];
173      }
174  
175      bb10: {
176          StorageDead(_23);
177          StorageDead(_22);
178          StorageLive(_26);
179          StorageLive(_27);
180-         StorageLive(_28);
181-         _28 = _1;
182-         _29 = Eq(_28, const 0_u64);
183-         assert(!move _29, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb11, unwind unreachable];
184+         assert(!_25, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb11, unwind unreachable];
185      }
186  
187      bb11: {
188-         _27 = Div(const 1_u64, move _28);
189-         StorageDead(_28);
190+         _27 = Div(const 1_u64, _1);
191          _26 = opaque::<u64>(move _27) -> [return: bb12, unwind unreachable];
192      }
193  
194      bb12: {
195          StorageDead(_27);
196          StorageDead(_26);
197          StorageLive(_30);
198          StorageLive(_31);
199-         StorageLive(_32);
200-         _32 = _1;
201-         _33 = Eq(const 0_u64, const 0_u64);
202-         assert(!move _33, "attempt to calculate the remainder of `{}` with a divisor of zero", _32) -> [success: bb13, unwind unreachable];
203+         assert(!_17, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb13, unwind unreachable];
204      }
205  
206      bb13: {
207-         _31 = Rem(move _32, const 0_u64);
208-         StorageDead(_32);
209+         _31 = Rem(_1, const 0_u64);
210          _30 = opaque::<u64>(move _31) -> [return: bb14, unwind unreachable];
211      }
212  
213      bb14: {
214          StorageDead(_31);
215          StorageDead(_30);
216          StorageLive(_34);
217          StorageLive(_35);
218-         StorageLive(_36);
219-         _36 = _1;
220-         _37 = Eq(const 1_u64, const 0_u64);
221-         assert(!move _37, "attempt to calculate the remainder of `{}` with a divisor of zero", _36) -> [success: bb15, unwind unreachable];
222+         assert(!_21, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb15, unwind unreachable];
223      }
224  
225      bb15: {
226-         _35 = Rem(move _36, const 1_u64);
227-         StorageDead(_36);
228+         _35 = Rem(_1, const 1_u64);
229          _34 = opaque::<u64>(move _35) -> [return: bb16, unwind unreachable];
230      }
231  
232      bb16: {
233          StorageDead(_35);
234          StorageDead(_34);
235          StorageLive(_38);
236          StorageLive(_39);
237-         StorageLive(_40);
238-         _40 = _1;
239-         _41 = Eq(_40, const 0_u64);
240-         assert(!move _41, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb17, unwind unreachable];
241+         assert(!_25, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb17, unwind unreachable];
242      }
243  
244      bb17: {
245-         _39 = Rem(const 0_u64, move _40);
246-         StorageDead(_40);
247+         _39 = Rem(const 0_u64, _1);
248          _38 = opaque::<u64>(move _39) -> [return: bb18, unwind unreachable];
249      }
250  
251      bb18: {
252          StorageDead(_39);
253          StorageDead(_38);
254          StorageLive(_42);
255          StorageLive(_43);
256-         StorageLive(_44);
257-         _44 = _1;
258-         _45 = Eq(_44, const 0_u64);
259-         assert(!move _45, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb19, unwind unreachable];
260+         assert(!_25, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb19, unwind unreachable];
261      }
262  
263      bb19: {
264-         _43 = Rem(const 1_u64, move _44);
265-         StorageDead(_44);
266+         _43 = Rem(const 1_u64, _1);
267          _42 = opaque::<u64>(move _43) -> [return: bb20, unwind unreachable];
268      }
269  
270      bb20: {
271          StorageDead(_43);
272          StorageDead(_42);
273          StorageLive(_46);
274          StorageLive(_47);
275-         StorageLive(_48);
276-         _48 = _1;
277-         _47 = BitAnd(move _48, const 0_u64);
278-         StorageDead(_48);
279+         _47 = BitAnd(_1, const 0_u64);
280          _46 = opaque::<u64>(move _47) -> [return: bb21, unwind unreachable];
281      }
282  
283      bb21: {
284          StorageDead(_47);
285          StorageDead(_46);
286          StorageLive(_49);
287          StorageLive(_50);
288-         StorageLive(_51);
289-         _51 = _1;
290-         _50 = BitOr(move _51, const 0_u64);
291-         StorageDead(_51);
292+         _50 = BitOr(_1, const 0_u64);
293          _49 = opaque::<u64>(move _50) -> [return: bb22, unwind unreachable];
294      }
295  
296      bb22: {
297          StorageDead(_50);
298          StorageDead(_49);
299          StorageLive(_52);
300          StorageLive(_53);
301-         StorageLive(_54);
302-         _54 = _1;
303-         _53 = BitXor(move _54, const 0_u64);
304-         StorageDead(_54);
305+         _53 = BitXor(_1, const 0_u64);
306          _52 = opaque::<u64>(move _53) -> [return: bb23, unwind unreachable];
307      }
308  
309      bb23: {
310          StorageDead(_53);
311          StorageDead(_52);
312          StorageLive(_55);
313          StorageLive(_56);
314-         StorageLive(_57);
315-         _57 = _1;
316-         _56 = Shr(move _57, const 0_i32);
317-         StorageDead(_57);
318+         _56 = Shr(_1, const 0_i32);
319          _55 = opaque::<u64>(move _56) -> [return: bb24, unwind unreachable];
320      }
321  
322      bb24: {
323          StorageDead(_56);
324          StorageDead(_55);
325          StorageLive(_58);
326          StorageLive(_59);
327-         StorageLive(_60);
328-         _60 = _1;
329-         _59 = Shl(move _60, const 0_i32);
330-         StorageDead(_60);
331+         _59 = Shl(_1, const 0_i32);
332          _58 = opaque::<u64>(move _59) -> [return: bb25, unwind unreachable];
333      }
334  
335      bb25: {
336          StorageDead(_59);
337          StorageDead(_58);
338          _0 = const ();
339          return;
340      }
341  }
342