Commit Graph

6 Commits

Author SHA1 Message Date
Jakob Degen
9ac5e986ed Extend the MIR validator to check many more things around rvalues. 2022-04-11 15:18:54 -04:00
Gary Guo
cdec87cafa Add mir opt test for min_align_of -> AlignOf lowering 2021-09-13 00:08:35 +01:00
Tomasz Miąsko
5718cc2f9b Make forget intrinsic safe 2020-12-29 00:00:00 +00:00
Tomasz Miąsko
686237c49a Lower discriminant_value intrinsic
This allows const propagation to evaluate comparisons involving
field-less enums using derived implementations of `PartialEq` (after
inlining `eq`).
2020-12-11 03:25:40 +01:00
Tomasz Miąsko
2b7ffecee0 Don't special case constant operands when lowering intrinsics 2020-11-16 00:00:00 +00:00
Tomasz Miąsko
6903273339 Lower intrinsics calls: forget, size_of, unreachable, wrapping_*
This allows constant propagation to evaluate `size_of` and `wrapping_*`,
and unreachable propagation to propagate a call to `unreachable`.

The lowering is performed as a MIR optimization, rather than during MIR
building to preserve the special status of intrinsics with respect to
unsafety checks and promotion.
2020-11-14 00:00:00 +00:00