summary refs log tree commit diff
path: root/tests/codegen-llvm
AgeCommit message (Collapse)AuthorLines
2025-08-28Revert "fix(debuginfo): disable overflow check for"Wesley Wiser-32/+0
This reverts commit 49eda8edd5c99e4c65c687fff0b8e194eb339a23.
2025-07-31Rollup merge of #144232 - xacrimon:explicit-tail-call, r=WaffleLapkinStuart Cook-0/+18
Implement support for `become` and explicit tail call codegen for the LLVM backend This PR implements codegen of explicit tail calls via `become` in `rustc_codegen_ssa` and support within the LLVM backend. Completes a task on (https://github.com/rust-lang/rust/issues/112788). This PR implements all the necessary bits to make explicit tail calls usable, other backends have received stubs for now and will ICE if you use `become` on them. I suspect there is some bikeshedding to be done on how we should go about implementing this for other backends, but it should be relatively straightforward for GCC after this is merged. During development I also put together a POC bytecode VM based on tail call dispatch to test these changes out and analyze the codegen to make sure it generates expected assembly. That is available [here](https://github.com/xacrimon/tcvm).
2025-07-30Rollup merge of #144042 - dpaoliello:verifyllvmcomp, r=jieyouxuStuart Cook-23/+21
Verify llvm-needs-components are not empty and match the --target value I recently discovered a test with an empty `llvm-needs-components` entry (fixed in rust-lang/rust#143979) which meant that it didn't work correctly when building Rust with a limited set of LLVM targets. This change makes a pair of improvements to prevent this issue from creeping in again: * When parsing directives with values, `compiletest` will now raise an error if there is an empty value. * Improved the `target_specific_tests` tidy checker to map targets to LLVM components, to verify that any existing `llvm-needs-components` contains the target being used. I also fixed all the issues flagged by the improved tidy checker.
2025-07-29Rollup merge of #144632 - nikic:llvm-21-tests, r=durin42Jacob Pratt-4/+10
Update some tests for LLVM 21 Fixes https://github.com/rust-lang/rust/issues/144604. Fixes https://github.com/rust-lang/rust/issues/144606. r? `@durin42`
2025-07-29Verify llvm-needs-components are not empty and match the --target valueDaniel Paoliello-23/+21
2025-07-29tests: Test line number in debuginfo for diverging function callsMartin Nordholts-0/+38
2025-07-29Rollup merge of #144407 - godzie44:godzie44/fix_dwarf_inconsistency, ↵Stuart Cook-0/+32
r=wesleywiser fix(debuginfo): disable overflow check for recursive non-enum types Commit b10edb4 introduce an overflow check when generating debuginfo for expanding recursive types. While this check works correctly for enums, it can incorrectly prune valid debug information for structures. For example see rust-lang/rust#143241 (https://github.com/rust-lang/rust/issues/143241#issuecomment-3073721477). Furthermore, for structures such check does not make sense, since structures with recursively expanding types simply will not compile (there is a `hir_analysis_recursive_generic_parameter` for that). closes rust-lang/rust#143241
2025-07-29Adjust enum-discriminant-eq.rs for LLVM 21Nikita Popov-4/+10
The two xors get folded into the select.
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-27fix(debuginfo): disable overflow check forgodzie44-0/+32
recursive non-enum types
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-26Implement support for explicit tail calls in the MIR block builders and the ↵Joel Wejdenstål-0/+18
LLVM codegen backend.
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