about summary refs log tree commit diff
path: root/tests/codegen/transmute-scalar.rs
AgeCommit message (Collapse)AuthorLines
2025-07-22Rename `tests/codegen` into `tests/codegen-llvm`Guillaume Gomez-143/+0
2025-07-03Block SIMD in transmute_immediate; delete `OperandValueKind`Scott McMurray-4/+10
See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>.
2025-06-30fix bitcast of single-element SIMD vectorsFolkert de Vries-10/+45
2025-06-19Avoid a bitcast FFI call in transmutingScott McMurray-0/+45
For things that only change the valid ranges, we can just skip the `LLVMBuildBitCast` call. I tried to tweak this a bit more and broke stuff, so I also added some extra tests for that as we apparently didn't have coverage.
2025-02-19Emit `trunc nuw` for unchecked shifts and `to_immediate_scalar`Scott McMurray-1/+1
- For shifts this shrinks the IR by no longer needing an `assume` while still providing the UB information - Having this on the `i8`→`i1` truncations will hopefully help with some places that have to load `i8`s or pass those in LLVM structs without range information
2024-10-23Set `signext` or `zeroext` for integer arguments on RISC-VAsuna-1/+1
2024-03-11Lower transmutes from int to pointer type as gep on nullBen Kimock-1/+1
2024-02-22[AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives许杰友 Jieyou Xu (Joe)-1/+1
2023-07-27Update the minimum external LLVM to 15Josh Stone-1/+0
2023-07-08Always name the return place.Camille GILLOT-10/+10
2023-04-13`assume` value ranges in `transmute`Scott McMurray-7/+7
Fixes #109958
2023-04-04Allow `transmute`s to produce `OperandValue`s instead of always using `alloca`sScott McMurray-27/+17
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-27/+14
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.
2023-01-17Put `noundef` on all scalars that don't allow uninitNilstrieb-5/+5
Previously, it was only put on scalars with range validity invariants like bool, was uninit was obviously invalid for those. Since then, we have normatively declared all uninit primitives to be undefined behavior and can therefore put `noundef` on them. The remaining concern was the `mem::uninitialized` function, which cause quite a lot of UB in the older parts of the ecosystem. This function now doesn't return uninit values anymore, making users of it safe from this change. The only real sources of UB where people could encounter uninit primitives are `MaybeUninit::uninit().assume_init()`, which has always be clear in the docs about being UB and from heap allocations (like reading from the spare capacity of a vec. This is hopefully rare enough to not break anything.
2023-01-11Move /src/test to /testsAlbert Larsan-0/+81