Commit graph

1638 commits

Author SHA1 Message Date
Antoni Boucher
06fdf3df2c Use mini_core in the tests 2025-01-13 08:10:53 -05:00
Antoni Boucher
b4418b896c Fix clippy warnings 2025-01-12 19:47:47 -05:00
Antoni Boucher
59689c43f3 Update to nightly-2025-01-12 2025-01-12 19:37:10 -05:00
Antoni Boucher
b44f3718bf Merge branch 'master' into sync_from_rust_2025_01_12 2025-01-12 19:29:42 -05:00
antoyo
f03d3c4a56
Merge pull request #579 from klensy/typo
fix typo
2025-01-12 13:36:18 -05:00
antoyo
153fbfd5c4
Merge pull request #578 from rust-lang/sync_from_rust_2024_12_11
Sync from rust 2024/12/11
2025-01-12 13:34:01 -05:00
Antoni Boucher
93f7f2fdeb Add LTO test 2025-01-12 12:06:25 -05:00
Antoni Boucher
fe608c7639 Add ThinLTO test 2025-01-12 09:10:40 -05:00
Antoni Boucher
37a9e5069d Remove LTO warning 2025-01-12 09:06:40 -05:00
Antoni Boucher
0d47dc0cf0 Correctly handle the relocation model for LTO 2025-01-11 21:04:38 -05:00
Antoni Boucher
423701a3cf Add comment 2025-01-11 21:04:26 -05:00
Antoni Boucher
3e4df68991 Fix for m68k 2025-01-11 21:03:58 -05:00
Antoni Boucher
93693a52dc Disable the LTO warning for now 2025-01-11 21:03:57 -05:00
Antoni Boucher
34ed154343 Fix LTO 2025-01-11 21:02:43 -05:00
Antoni Boucher
3f23706c6c Cleanup 2025-01-11 10:41:31 -05:00
Antoni Boucher
59afbe0913 Fix for the relocation bug 2025-01-11 10:41:31 -05:00
Antoni Boucher
8bc4863951 Fix for ThinLTO 2025-01-11 10:41:31 -05:00
Antoni Boucher
747924ad86 Debug global variable not initialized bug 2025-01-11 10:41:27 -05:00
Rémy Rakic
c6f258d884 migrate rustc_codegen_gcc to the DenseBitSet name 2025-01-11 11:34:03 +00:00
David Wood
90ae2cf418 mir_transform: implement forced inlining
Adds `#[rustc_force_inline]` which is similar to always inlining but
reports an error if the inlining was not possible, and which always
attempts to inline annotated items, regardless of optimisation levels.
It can only be applied to free functions to guarantee that the MIR
inliner will be able to resolve calls.
2025-01-10 18:37:54 +00:00
Matthew Maurer
3323e5a9ad llvm: Ignore error value that is always false
See llvm/llvm-project#121851

For LLVM 20+, this function (`renameModuleForThinLTO`) has no return
value. For prior versions of LLVM, this never failed, but had a
signature which allowed an error value people were handling.
2025-01-07 01:02:22 +00:00
bors
7991f17b20 Auto merge of #134794 - RalfJung:abi-required-target-features, r=workingjubilee
Add a notion of "some ABIs require certain target features"

I think I finally found the right shape for the data and checks that I recently added in https://github.com/rust-lang/rust/pull/133099, https://github.com/rust-lang/rust/pull/133417, https://github.com/rust-lang/rust/pull/134337: we have a notion of "this ABI requires the following list of target features, and it is incompatible with the following list of target features". Both `-Ctarget-feature` and `#[target_feature]` are updated to ensure we follow the rules of the ABI.  This removes all the "toggleability" stuff introduced before, though we do keep the notion of a fully "forbidden" target feature -- this is needed to deal with target features that are actual ABI switches, and hence are needed to even compute the list of required target features.

We always explicitly (un)set all required and in-conflict features, just to avoid potential trouble caused by the default features of whatever the base CPU is. We do this *before* applying `-Ctarget-feature` to maintain backward compatibility; this poses a slight risk of missing some implicit feature dependencies in LLVM but has the advantage of not breaking users that deliberately toggle ABI-relevant target features. They get a warning but the feature does get toggled the way they requested.

For now, our logic supports x86, ARM, and RISC-V (just like the previous logic did). Unsurprisingly, RISC-V is the nicest. ;)

As a side-effect this also (unstably) allows *enabling* `x87` when that is harmless. I used the opportunity to mark SSE2 as required on x86-64, to better match the actual logic in LLVM and because all x86-64 chips do have SSE2. This infrastructure also prepares us for requiring SSE on x86-32 when we want to use that for our ABI (and for float semantics sanity), see https://github.com/rust-lang/rust/issues/133611, but no such change is happening in this PR.

r? `@workingjubilee`
2025-01-05 23:21:06 +00:00
Ralf Jung
3aba2d96d1 add dedicated type for ABI target feature constraints 2025-01-05 10:46:30 +01:00
Manuel Drehwald
d7685c4cf6 upstream rustc_codegen_llvm changes for enzyme/autodiff 2025-01-01 21:42:45 +01:00
Ralf Jung
940cbb8f28 add ABI target features *before* -Ctarget-features 2024-12-31 12:41:20 +01:00
Ralf Jung
f06f568411 x86-64 hardfloat actually requires sse2 2024-12-31 12:41:20 +01:00
Ralf Jung
e6e72ce158 adjust GCC backend 2024-12-31 12:41:20 +01:00
Antoni Boucher
02198d8458 Fix a stack overflow caused by GCC creating too many local variables 2024-12-22 12:28:56 -05:00
许杰友 Jieyou Xu (Joe)
b39498c727 Rollup merge of #133702 - RalfJung:single-variant, r=oli-obk
Variants::Single: do not use invalid VariantIdx for uninhabited enums

~~Stacked on top of https://github.com/rust-lang/rust/pull/133681, only the last commit is new.~~

Currently, `Variants::Single` for an empty enum contains a `VariantIdx` of 0; looking that up in the enum variant list will ICE. That's quite confusing. So let's fix that by adding a new `Variants::Empty` case for types that have 0 variants.

try-job: i686-msvc
2024-12-19 16:48:07 +08:00
acceptacross
c3eed20ab1 chore: fix some typos
Signed-off-by: acceptacross <csqcqs@gmail.com>
2024-12-18 23:23:44 +08:00
Ralf Jung
bd26db4664 make no-variant types a dedicated Variants variant 2024-12-18 11:01:54 +01:00
Ralf Jung
4d1e772f97 Variants::Single: do not use invalid VariantIdx for uninhabited enums 2024-12-18 11:00:21 +01:00
Jonathan Dönszelmann
a845ca75a0 rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structures 2024-12-16 19:08:19 +01:00
Antoni Boucher
530cdb4b3a Ignore new failing test 2024-12-14 18:00:07 -05:00
Antoni Boucher
86a972345c Fix for simd_relaxed_fma 2024-12-14 17:59:23 -05:00
Antoni Boucher
e1439ba178 Automatically detect LTO tests to remove when the sysroot is not compiled with LTO 2024-12-14 17:38:11 -05:00
Antoni Boucher
660305dccb Fix simd_gather 2024-12-14 16:45:11 -05:00
Antoni Boucher
a29fd9cc34 Fix failures CI 2024-12-14 16:40:05 -05:00
Antoni Boucher
e91ec42e33 Clean fix for undefined symbol for allocator functions 2024-12-14 16:23:37 -05:00
Antoni Boucher
64b30d344c Merge branch 'master' into sync_from_rust_2024_12_11 2024-12-14 10:41:41 -05:00
antoyo
184d63de96
Merge pull request #582 from rust-lang/fix/ci
Fix CI by downgrading to Ubuntu 22.04
2024-12-14 10:41:16 -05:00
Antoni Boucher
96fd4a20cd Do not test the time crate since one test fails 2024-12-14 09:32:15 -05:00
Antoni Boucher
0dcb1e3bc1 Fix CI by downgrading to 22.04 2024-12-14 08:59:50 -05:00
Antoni Boucher
f0d9b56e72 WIP: Fix undefined symbol for allocator functions 2024-12-14 08:51:44 -05:00
Ralf Jung
1ff0558a94 target_features: control separately whether enabling and disabling a target feature is allowed 2024-12-14 08:24:18 +01:00
bors
90a70897a6 Auto merge of #133099 - RalfJung:forbidden-hardfloat-features, r=workingjubilee
forbid toggling x87 and fpregs on hard-float targets

Part of https://github.com/rust-lang/rust/issues/116344, follow-up to https://github.com/rust-lang/rust/pull/129884:

The `x87`  target feature on x86 and the `fpregs` target feature on ARM must not be disabled on a hardfloat target, as that would change the float ABI. However, *enabling* `fpregs` on ARM is [explicitly requested](https://github.com/rust-lang/rust/issues/130988) as it seems to be useful. Therefore, we need to refine the distinction of "forbidden" target features and "allowed" target features: all (un)stable target features can determine on a per-target basis whether they should be allowed to be toggled or not. `fpregs` then checks whether the current target has the `soft-float` feature, and if yes, `fpregs` is permitted -- otherwise, it is not. (Same for `x87` on x86).

Also fixes https://github.com/rust-lang/rust/issues/132351. Since `fpregs` and `x87` can be enabled on some builds and disabled on others, it would make sense that one can query it via `cfg`. Therefore, I made them behave in `cfg` like any other unstable target feature.

The first commit prepares the infrastructure, but does not change behavior. The second commit then wires up `fpregs` and `x87` with that new infrastructure.

r? `@workingjubilee`
2024-12-13 19:43:00 +00:00
Antoni Boucher
ae84d258c9 Fix undefined function error 2024-12-13 10:46:31 -05:00
klensy
a3eeee3f96 fix typo 2024-12-12 15:25:39 +03:00
bors
ca71dc1c9c Auto merge of #128004 - folkertdev:naked-fn-asm, r=Amanieu
codegen `#[naked]` functions using global asm

tracking issue: https://github.com/rust-lang/rust/issues/90957

Fixes #124375

This implements the approach suggested in the tracking issue: use the existing global assembly infrastructure to emit the body of `#[naked]` functions. The main advantage is that we now have full control over what gets generated, and are no longer dependent on LLVM not sneakily messing with our output (inlining, adding extra instructions, etc).

I discussed this approach with `@Amanieu` and while I think the general direction is correct, there is probably a bunch of stuff that needs to change or move around here. I'll leave some inline comments on things that I'm not sure about.

Combined with https://github.com/rust-lang/rust/pull/127853, if both accepted, I think that resolves all steps from the tracking issue.

r? `@Amanieu`
2024-12-11 21:51:07 +00:00
Guillaume Gomez
cd3f69974f
Merge pull request #576 from onur-ozkan/bless-lang-tests
stabilize `lang_tests_common` config parsing logic
2024-12-11 22:44:38 +01:00