about summary refs log tree commit diff
path: root/tests/codegen-llvm
AgeCommit message (Collapse)AuthorLines
2025-07-27Auto merge of #144225 - purplesyringa:unwinding-intrinsics, r=nikicbors-1/+15
Don't special-case llvm.* as nounwind Certain LLVM intrinsics, such as `llvm.wasm.throw`, can unwind. Marking them as nounwind causes us to skip cleanup of locals and optimize out `catch_unwind` under inlining or when `llvm.wasm.throw` is used directly by user code. The motivation for forcibly marking llvm.* as nounwind is no longer present: most intrinsics are linked as `extern "C"` or other non-unwinding ABIs, so we won't codegen `invoke` for them anyway. Closes rust-lang/rust#132416. `@rustbot` label +T-compiler +A-panic
2025-07-27Auto merge of #144347 - scottmcm:ssa-enums-v0, r=WaffleLapkinbors-0/+31
No longer need `alloca`s for consuming `Result<!, i32>` and similar In optimized builds GVN gets rid of these already, but in `opt-level=0` we actually make `alloca`s for this, which particularly impacts `?`-style things that use actually-only-one-variant types like this. While doing so, rewrite `LocalAnalyzer::process_place` to be non-recursive, solving a 6+ year old FIXME. r? codegen
2025-07-26Rollup merge of #144359 - RalfJung:vararg-codegen, r=compiler-errorsJacob Pratt-0/+86
add codegen test for variadics This is a part of https://github.com/rust-lang/rust/pull/144066 that can land without FCP.
2025-07-26Auto merge of #143860 - scottmcm:transmute-always-rvalue, r=WaffleLapkinbors-10/+192
Let `codegen_transmute_operand` just handle everything When combined with rust-lang/rust#143720, this means `rvalue_creates_operand` can just return `true` for *every* `Rvalue`. (A future PR could consider removing it, though just letting it optimize out is fine for now.) It's nicer anyway, IMHO, because it avoids needing the layout checks to be consistent in the two places, and thus is an overall reduction in code. Plus it's a more helpful building block when used in other places this way. (TBH, it probably would have been better to have it this way the whole time, but I clearly didn't understand `rvalue_creates_operand` when I originally wrote rust-lang/rust#109843.)
2025-07-26Rollup merge of #144341 - CaiWeiran:const-vector_test, r=wesleywiserTrevor Gross-0/+2
Enable const-vector.rs test on RISC-V (riscv64) This PR replaces [#144283](https://github.com/rust-lang/rust/pull/144283) to resolve merge conflicts. This PR adds support for running the `tests/codegen/const-vector.rs` test on the RISC-V (riscv64) architecture. Previously, this test would fail on RISC-V targets due to architecture-specific code generation issues. This patch modifies the test to ensure compatibility while preserving its intent. The change has been tested locally using `./x test` on a riscv64 target, and the test now passes as expected. ### Notes: - This change is scoped specifically to improve RISC-V compatibility. - It does not affect behavior or test results on other architectures.
2025-07-23Don't emit two `assume`s in transmutes when one is a subset of the otherScott McMurray-8/+41
For example, transmuting between `bool` and `Ordering` doesn't need two `assume`s because one range is a superset of the other. Multiple are still used for things like `char` <-> `NonZero<u32>`, which overlap but where neither fully contains the other.
2025-07-23re-enable direct `bitcast`s for Int/Float vector transmutes (but not ones ↵Scott McMurray-0/+176
involving pointers)
2025-07-23Let `codegen_transmute_operand` just handle everythingScott McMurray-10/+16
When combined with 143720, this means `rvalue_creates_operand` can just return `true` for *every* `Rvalue`. (A future PR could consider removing it, though just letting it optimize out is fine for now.) It's nicer anyway, IMHO, because it avoids needing the layout checks to be consistent in the two places, and thus is an overall reduction in code. Plus it's a more helpful building block when used in other places this way.
2025-07-23add codegen test for variadics (also replacing some existing does-this-build ↵Ralf Jung-0/+86
tests)
2025-07-23Fix tests/codegen-llvm/const-vector.rs test failure on riscv64Caiweiran-0/+2
2025-07-23No longer need `alloca`s for consuming `Result<!, i32>` and similarScott McMurray-0/+31
In optimized builds GVN gets rid of these already, but in `opt-level=0` we actually make `alloca`s for this, which particularly impacts `?`-style things that use actually-only-one-variant types like this.
2025-07-23Don't special-case llvm.* as nounwindAlisa Sireneva-1/+15
Certain LLVM intrinsics, such as `llvm.wasm.throw`, can unwind. Marking them as nounwind causes us to skip cleanup of locals and optimize out `catch_unwind` under inlining or when `llvm.wasm.throw` is used directly by user code. The motivation for forcibly marking llvm.* as nounwind is no longer present: most intrinsics are linked as `extern "C"` or other non-unwinding ABIs, so we won't codegen `invoke` for them anyway.
2025-07-22Rename `tests/codegen` into `tests/codegen-llvm`Guillaume Gomez-0/+31706