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
|
- // MIR for `arithmetic` before GVN
+ // MIR for `arithmetic` after GVN
fn arithmetic(_1: u64) -> () {
debug x => _1;
let mut _0: ();
let _2: ();
let mut _3: u64;
let mut _4: u64;
let _5: ();
let mut _6: u64;
let mut _7: u64;
let _8: ();
let mut _9: u64;
let mut _10: u64;
let _11: ();
let mut _12: u64;
let mut _13: u64;
let _14: ();
let mut _15: u64;
let mut _16: u64;
let mut _17: bool;
let _18: ();
let mut _19: u64;
let mut _20: u64;
let mut _21: bool;
let _22: ();
let mut _23: u64;
let mut _24: u64;
let mut _25: bool;
let _26: ();
let mut _27: u64;
let mut _28: u64;
let mut _29: bool;
let _30: ();
let mut _31: u64;
let mut _32: u64;
let mut _33: bool;
let _34: ();
let mut _35: u64;
let mut _36: u64;
let mut _37: bool;
let _38: ();
let mut _39: u64;
let mut _40: u64;
let mut _41: bool;
let _42: ();
let mut _43: u64;
let mut _44: u64;
let mut _45: bool;
let _46: ();
let mut _47: u64;
let mut _48: u64;
let _49: ();
let mut _50: u64;
let mut _51: u64;
let _52: ();
let mut _53: u64;
let mut _54: u64;
let _55: ();
let mut _56: u64;
let mut _57: u64;
let _58: ();
let mut _59: u64;
let mut _60: u64;
bb0: {
StorageLive(_2);
StorageLive(_3);
- StorageLive(_4);
- _4 = _1;
- _3 = Add(move _4, const 0_u64);
- StorageDead(_4);
+ _3 = Add(_1, const 0_u64);
_2 = opaque::<u64>(move _3) -> [return: bb1, unwind continue];
}
bb1: {
StorageDead(_3);
StorageDead(_2);
StorageLive(_5);
StorageLive(_6);
- StorageLive(_7);
- _7 = _1;
- _6 = Sub(move _7, const 0_u64);
- StorageDead(_7);
+ _6 = Sub(_1, const 0_u64);
_5 = opaque::<u64>(move _6) -> [return: bb2, unwind continue];
}
bb2: {
StorageDead(_6);
StorageDead(_5);
StorageLive(_8);
StorageLive(_9);
- StorageLive(_10);
- _10 = _1;
- _9 = Mul(move _10, const 0_u64);
- StorageDead(_10);
+ _9 = Mul(_1, const 0_u64);
_8 = opaque::<u64>(move _9) -> [return: bb3, unwind continue];
}
bb3: {
StorageDead(_9);
StorageDead(_8);
StorageLive(_11);
StorageLive(_12);
- StorageLive(_13);
- _13 = _1;
- _12 = Mul(move _13, const 1_u64);
- StorageDead(_13);
+ _12 = Mul(_1, const 1_u64);
_11 = opaque::<u64>(move _12) -> [return: bb4, unwind continue];
}
bb4: {
StorageDead(_12);
StorageDead(_11);
StorageLive(_14);
StorageLive(_15);
- StorageLive(_16);
- _16 = _1;
_17 = Eq(const 0_u64, const 0_u64);
- assert(!move _17, "attempt to divide `{}` by zero", _16) -> [success: bb5, unwind continue];
+ assert(!_17, "attempt to divide `{}` by zero", _1) -> [success: bb5, unwind continue];
}
bb5: {
- _15 = Div(move _16, const 0_u64);
- StorageDead(_16);
+ _15 = Div(_1, const 0_u64);
_14 = opaque::<u64>(move _15) -> [return: bb6, unwind continue];
}
bb6: {
StorageDead(_15);
StorageDead(_14);
StorageLive(_18);
StorageLive(_19);
- StorageLive(_20);
- _20 = _1;
_21 = Eq(const 1_u64, const 0_u64);
- assert(!move _21, "attempt to divide `{}` by zero", _20) -> [success: bb7, unwind continue];
+ assert(!_21, "attempt to divide `{}` by zero", _1) -> [success: bb7, unwind continue];
}
bb7: {
- _19 = Div(move _20, const 1_u64);
- StorageDead(_20);
+ _19 = Div(_1, const 1_u64);
_18 = opaque::<u64>(move _19) -> [return: bb8, unwind continue];
}
bb8: {
StorageDead(_19);
StorageDead(_18);
StorageLive(_22);
StorageLive(_23);
- StorageLive(_24);
- _24 = _1;
- _25 = Eq(_24, const 0_u64);
- assert(!move _25, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb9, unwind continue];
+ _25 = Eq(_1, const 0_u64);
+ assert(!_25, "attempt to divide `{}` by zero", const 0_u64) -> [success: bb9, unwind continue];
}
bb9: {
- _23 = Div(const 0_u64, move _24);
- StorageDead(_24);
+ _23 = Div(const 0_u64, _1);
_22 = opaque::<u64>(move _23) -> [return: bb10, unwind continue];
}
bb10: {
StorageDead(_23);
StorageDead(_22);
StorageLive(_26);
StorageLive(_27);
- StorageLive(_28);
- _28 = _1;
- _29 = Eq(_28, const 0_u64);
- assert(!move _29, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb11, unwind continue];
+ assert(!_25, "attempt to divide `{}` by zero", const 1_u64) -> [success: bb11, unwind continue];
}
bb11: {
- _27 = Div(const 1_u64, move _28);
- StorageDead(_28);
+ _27 = Div(const 1_u64, _1);
_26 = opaque::<u64>(move _27) -> [return: bb12, unwind continue];
}
bb12: {
StorageDead(_27);
StorageDead(_26);
StorageLive(_30);
StorageLive(_31);
- StorageLive(_32);
- _32 = _1;
- _33 = Eq(const 0_u64, const 0_u64);
- assert(!move _33, "attempt to calculate the remainder of `{}` with a divisor of zero", _32) -> [success: bb13, unwind continue];
+ assert(!_17, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb13, unwind continue];
}
bb13: {
- _31 = Rem(move _32, const 0_u64);
- StorageDead(_32);
+ _31 = Rem(_1, const 0_u64);
_30 = opaque::<u64>(move _31) -> [return: bb14, unwind continue];
}
bb14: {
StorageDead(_31);
StorageDead(_30);
StorageLive(_34);
StorageLive(_35);
- StorageLive(_36);
- _36 = _1;
- _37 = Eq(const 1_u64, const 0_u64);
- assert(!move _37, "attempt to calculate the remainder of `{}` with a divisor of zero", _36) -> [success: bb15, unwind continue];
+ assert(!_21, "attempt to calculate the remainder of `{}` with a divisor of zero", _1) -> [success: bb15, unwind continue];
}
bb15: {
- _35 = Rem(move _36, const 1_u64);
- StorageDead(_36);
+ _35 = Rem(_1, const 1_u64);
_34 = opaque::<u64>(move _35) -> [return: bb16, unwind continue];
}
bb16: {
StorageDead(_35);
StorageDead(_34);
StorageLive(_38);
StorageLive(_39);
- StorageLive(_40);
- _40 = _1;
- _41 = Eq(_40, const 0_u64);
- assert(!move _41, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb17, unwind continue];
+ assert(!_25, "attempt to calculate the remainder of `{}` with a divisor of zero", const 0_u64) -> [success: bb17, unwind continue];
}
bb17: {
- _39 = Rem(const 0_u64, move _40);
- StorageDead(_40);
+ _39 = Rem(const 0_u64, _1);
_38 = opaque::<u64>(move _39) -> [return: bb18, unwind continue];
}
bb18: {
StorageDead(_39);
StorageDead(_38);
StorageLive(_42);
StorageLive(_43);
- StorageLive(_44);
- _44 = _1;
- _45 = Eq(_44, const 0_u64);
- assert(!move _45, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb19, unwind continue];
+ assert(!_25, "attempt to calculate the remainder of `{}` with a divisor of zero", const 1_u64) -> [success: bb19, unwind continue];
}
bb19: {
- _43 = Rem(const 1_u64, move _44);
- StorageDead(_44);
+ _43 = Rem(const 1_u64, _1);
_42 = opaque::<u64>(move _43) -> [return: bb20, unwind continue];
}
bb20: {
StorageDead(_43);
StorageDead(_42);
StorageLive(_46);
StorageLive(_47);
- StorageLive(_48);
- _48 = _1;
- _47 = BitAnd(move _48, const 0_u64);
- StorageDead(_48);
+ _47 = BitAnd(_1, const 0_u64);
_46 = opaque::<u64>(move _47) -> [return: bb21, unwind continue];
}
bb21: {
StorageDead(_47);
StorageDead(_46);
StorageLive(_49);
StorageLive(_50);
- StorageLive(_51);
- _51 = _1;
- _50 = BitOr(move _51, const 0_u64);
- StorageDead(_51);
+ _50 = BitOr(_1, const 0_u64);
_49 = opaque::<u64>(move _50) -> [return: bb22, unwind continue];
}
bb22: {
StorageDead(_50);
StorageDead(_49);
StorageLive(_52);
StorageLive(_53);
- StorageLive(_54);
- _54 = _1;
- _53 = BitXor(move _54, const 0_u64);
- StorageDead(_54);
+ _53 = BitXor(_1, const 0_u64);
_52 = opaque::<u64>(move _53) -> [return: bb23, unwind continue];
}
bb23: {
StorageDead(_53);
StorageDead(_52);
StorageLive(_55);
StorageLive(_56);
- StorageLive(_57);
- _57 = _1;
- _56 = Shr(move _57, const 0_i32);
- StorageDead(_57);
+ _56 = Shr(_1, const 0_i32);
_55 = opaque::<u64>(move _56) -> [return: bb24, unwind continue];
}
bb24: {
StorageDead(_56);
StorageDead(_55);
StorageLive(_58);
StorageLive(_59);
- StorageLive(_60);
- _60 = _1;
- _59 = Shl(move _60, const 0_i32);
- StorageDead(_60);
+ _59 = Shl(_1, const 0_i32);
_58 = opaque::<u64>(move _59) -> [return: bb25, unwind continue];
}
bb25: {
StorageDead(_59);
StorageDead(_58);
_0 = const ();
return;
}
}
|