2024-06-16 03:22:58 -05:00
|
|
|
- // MIR for `array_len_by_value` before GVN
|
|
|
|
+ // MIR for `array_len_by_value` after GVN
|
2021-10-06 10:53:11 -05:00
|
|
|
|
|
|
|
fn array_len_by_value(_1: [u8; N]) -> usize {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug arr => _1;
|
|
|
|
let mut _0: usize;
|
|
|
|
let mut _2: &[u8];
|
|
|
|
let mut _3: &[u8; N];
|
2021-10-06 10:53:11 -05:00
|
|
|
|
|
|
|
bb0: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_2);
|
|
|
|
StorageLive(_3);
|
|
|
|
_3 = &_1;
|
2024-09-15 12:35:06 -05:00
|
|
|
_2 = move _3 as &[u8] (PointerCoercion(Unsize, Implicit));
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_3);
|
2024-06-16 03:22:58 -05:00
|
|
|
- _0 = PtrMetadata(move _2);
|
2023-06-06 08:47:00 -05:00
|
|
|
+ _0 = const N;
|
|
|
|
goto -> bb1;
|
2021-10-06 10:53:11 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_2);
|
|
|
|
return;
|
2021-10-06 10:53:11 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|