about summary refs log tree commit diff
path: root/tests/codegen/intrinsics/transmute.rs
AgeCommit message (Collapse)AuthorLines
2023-07-27Update the minimum external LLVM to 15Josh Stone-1/+0
2023-07-08Always name the return place.Camille GILLOT-47/+43
2023-05-31Add a distinct `OperandValue::ZeroSized` variant for ZSTsScott McMurray-4/+71
These tend to have special handling in a bunch of places anyway, so the variant helps remember that. And I think it's easier to grok than non-Scalar Aggregates sometimes being `Immediates` (like I got wrong and caused 109992). As a minor bonus, it means we don't need to generate poison LLVM values for them to pass around in `OperandValue::Immediate`s.
2023-04-22Add `intrinsics::transmute_unchecked`Scott McMurray-33/+9
This takes a whole 3 lines in `compiler/` since it lowers to `CastKind::Transmute` in MIR *exactly* the same as the existing `intrinsics::transmute` does, it just doesn't have the fancy checking in `hir_typeck`. Added to enable experimenting with the request in <https://github.com/rust-lang/rust/pull/106281#issuecomment-1496648190> and because the portable-simd folks might be interested for dependently-sized array-vector conversions. It also simplifies a couple places in `core`.
2023-04-13`assume` value ranges in `transmute`Scott McMurray-4/+4
Fixes #109958
2023-04-09Handle not all immediates having `abi::Scalar`sScott McMurray-1/+57
2023-04-06Check `CastKind::Transmute` sizes in a better wayScott McMurray-1/+73
Fixes #110005
2023-04-04Allow `transmute`s to produce `OperandValue`s instead of always using `alloca`sScott McMurray-23/+130
LLVM can usually optimize these away, but especially for things like transmutes of newtypes it's silly to generate the `alloc`+`store`+`load` at all when it's actually a nop at LLVM level.
2023-03-22Add `CastKind::Transmute` to MIRScott McMurray-0/+196
Updates `interpret`, `codegen_ssa`, and `codegen_cranelift` to consume the new cast instead of the intrinsic. Includes `CastTransmute` for custom MIR building, to be able to test the extra UB.