Commit graph

1081 commits

Author SHA1 Message Date
Antoni Boucher
f69d8fc324 Merge branch 'master' into sync_from_rust_2025_06_02 2025-06-02 14:12:36 -04:00
antoyo
8efeb495bc
Merge pull request #682 from rust-lang/sync_from_rust_2025_05_21
Sync from rust 2025/05/21
2025-06-02 14:03:44 -04:00
Antoni Boucher
ba53d97497 Fix cast from u128 to f128 2025-06-02 12:44:42 -04:00
bjorn3
f383b17668 Directly use from_immediate for handling bool 2025-05-30 10:12:57 +00:00
bjorn3
6c6c31d461 Avoid computing function type for intrinsic instances 2025-05-30 10:12:18 +00:00
bjorn3
926c8c80f6 Use layout field of OperandRef in generic_simd_intrinsic 2025-05-30 10:12:18 +00:00
bjorn3
5c4b7978de Use layout field of OperandRef and PlaceRef in codegen_intrinsic_call
This avoids having to get the function signature.
2025-05-30 10:12:16 +00:00
Matthias Krüger
acb2fcdf24 Rollup merge of #141507 - RalfJung:atomic-intrinsics, r=bjorn3
atomic_load intrinsic: use const generic parameter for ordering

We have a gazillion intrinsics for the atomics because we encode the ordering into the intrinsic name rather than making it a parameter. This is particularly bad for those operations that take two orderings. Let's fix that!

This PR only converts `load`, to see if there's any feedback that would fundamentally change the strategy we pursue for the const generic intrinsics.

The first two commits are preparation and could be a separate PR if you prefer.

`@BoxyUwU` -- I hope this is a use of const generics that is unlikely to explode? All we need is a const generic of enum type. We could funnel it through an integer if we had to but an enum is obviously nicer...

`@bjorn3` it seems like the cranelift backend entirely ignores the ordering?
2025-05-30 07:01:30 +02:00
Ralf Jung
dbbfb6e08b get rid of rustc_codegen_ssa::common::AtomicOrdering 2025-05-28 22:57:55 +02:00
bjorn3
0c6f946b82 Remove unused arg_memory_ty method 2025-05-28 20:55:00 +00:00
bjorn3
244ea125f1 Mark all optimize methods and the codegen method as safe
There is no safety contract and I don't think any of them can actually
cause UB in more ways than passing malicious source code to rustc can.
While LtoModuleCodegen::optimize says that the returned ModuleCodegen
points into the LTO module, the LTO module has already been dropped by
the time this function returns, so if the returned ModuleCodegen indeed
points into the LTO module, we would have seen crashes on every LTO
compilation, which we don't. As such the comment is outdated.
2025-05-28 20:55:00 +00:00
bjorn3
96be6effa4 Remove methods from StaticCodegenMethods that are not called in cg_ssa itself 2025-05-28 20:55:00 +00:00
bjorn3
f297400574 Make predefine methods take &mut self 2025-05-28 20:55:00 +00:00
bjorn3
4d47f6d72d Remove a couple of uses of interior mutability around statics 2025-05-28 20:55:00 +00:00
bjorn3
f6489c325f Remove codegen_unit from MiscCodegenMethods 2025-05-28 20:55:00 +00:00
antoyo
d80802b042
Merge pull request #684 from FractalFir/master
Fix to 128 bit int unaligned loads
2025-05-27 18:16:07 -04:00
michal kostrubiec
1afdb55019 Fix to 128 bit int unaligned loads 2025-05-27 23:54:41 +02:00
bjorn3
f99471360f Remove usage of FnAbi in codegen_intrinsic_call 2025-05-26 10:13:03 +00:00
bjorn3
03485093d4 Pass PlaceRef rather than Bx::Value to codegen_intrinsic_call 2025-05-26 10:13:03 +00:00
Noratrieb
8ad69573fa Cleanup CodegenFnAttrFlags
- Rename `USED` to `USED_COMPILER` to better reflect its behavior.
- Reorder some items to group the used and allocator flags together
- Renumber them without gaps
2025-05-24 20:31:37 +02:00
Antoni Boucher
dd6d5e2b10 Fix f128 intrinsics 2025-05-24 10:42:06 -04:00
Antoni Boucher
dca28e588c Only specify that we have reliable f16 and f128 on targets where those types are supported 2025-05-21 21:04:07 -04:00
Antoni Boucher
593d7ca571 Implement missing f16/f128 builtins 2025-05-21 21:03:48 -04:00
Antoni Boucher
721ac5af0f Merge branch 'master' into sync_from_rust_2025_05_21 2025-05-21 19:43:21 -04:00
Antoni Boucher
c430b87539 Fix typos 2025-05-21 18:06:19 -04:00
antoyo
3d962df0ae
Merge pull request #680 from FractalFir/master
Changes to constant handling - faster deduplication, more compact represtntation
2025-05-21 18:05:58 -04:00
michal kostrubiec
82160c49a3 Changes to constant handling - faster deduplication, more compact representation 2025-05-21 23:07:45 +02:00
Stuart Cook
e58e6974ad Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin
make `rustc_attr_parsing` less dominant in the rustc crate graph

It has/had a glob re-export of `rustc_attr_data_structures`, which is a crate much lower in the graph, and a lot of crates were using it *just* (or *mostly*) for that re-export, while they can rely on `rustc_attr_data_structures` directly.

Previous graph:
![graph_1](https://github.com/user-attachments/assets/f4a5f13c-4222-4903-b56d-28c83511fcbd)

Graph with this PR:
![graph_2](https://github.com/user-attachments/assets/1e053d9c-75cc-402b-84df-86229c98277a)

The first commit keeps the re-export, and just changes the dependency if possible. The second commit is the "breaking change" which removes the re-export, and "explicitly" adds the `rustc_attr_data_structures` dependency where needed. It also switches over some src/tools/*.

The second commit is actually a lot more involved than I expected. Please let me know if it's a better idea to back it out and just keep the first commit.
2025-05-19 13:24:54 +10:00
mejrs
f36e8f53db Remove rustc_attr_data_structures re-export from rustc_attr_parsing 2025-05-18 18:14:43 +02:00
Guillaume Gomez
f0648966e4 Add missing add_eval to generate __rdl_oom in the alloc error handler 2025-05-16 13:02:20 +02:00
Guillaume Gomez
d52b5e6df5 Merge commit '6ba33f5e11' into subtree-update_cg_gcc_2025-05-14 2025-05-14 13:51:02 +02:00
Antoni Boucher
878a1732bc Fix for the fminimum intrinsics 2025-05-14 05:00:18 -04:00
Antoni Boucher
57011501d5 Fix for libgccjit 12 2025-05-12 11:22:13 -04:00
Antoni Boucher
47beac18f4 Merge branch 'master' into sync_from_rust_2025_05_12 2025-05-12 11:04:56 -04:00
antoyo
2d794d4758
Merge pull request #671 from GuillaumeGomez/regen-intrinsics-2
Regenerate intrinsics
2025-05-11 13:59:26 -04:00
antoyo
d8e2d24738
Merge pull request #666 from FractalFir/master
Fixed a recursive inling bug, added a test for it
2025-05-11 09:50:58 -04:00
León Orell Valerian Liehr
c7740d2f17 Rollup merge of #140792 - Urgau:minimum-maximum-intrinsics, r=scottmcm,traviscross,tgross35
Use intrinsics for `{f16,f32,f64,f128}::{minimum,maximum}` operations

This PR creates intrinsics for `{f16,f32,f64,f64}::{minimum,maximum}` operations.

This wasn't done when those operations were added as the LLVM support was too weak but now that LLVM has libcalls for unsupported platforms we can finally use them.

Cranelift and GCC[^1] support are partial, Cranelift doesn't support `f16` and `f128`, while GCC doesn't support `f16`.

r? `@tgross35`

try-job: aarch64-gnu
try-job: dist-various-1
try-job: dist-various-2

[^1]: https://www.gnu.org/software///gnulib/manual/html_node/Functions-in-_003cmath_002eh_003e.html
2025-05-11 02:44:36 +02:00
michal kostrubiec
f111416e43 Fixed a recursive inling bug, added a test for it 2025-05-10 22:24:16 +02:00
Guillaume Gomez
43b95881f0 Regenerate intrinsics 2025-05-10 18:02:54 +02:00
Matthias Krüger
db5831c76c Rollup merge of #140660 - RalfJung:more-order, r=WaffleLapkin
remove 'unordered' atomic intrinsics

As their doc comment already indicates, these operations do not currently have a place in our memory model. The intrinsics were introduced to support a hack in compiler-builtins, but that hack recently got removed (see https://github.com/rust-lang/compiler-builtins/issues/788).
2025-05-10 16:26:02 +02:00
michal kostrubiec
33966ccbb6 Add a workaround for 128 bit switches 2025-05-10 00:34:54 +02:00
Ralf Jung
7e5fa896a2 remove 'unordered' atomic intrinsics 2025-05-09 17:39:52 +02:00
Urgau
1ac228397d Use intrinsics for {f16,f32,f64,f128}::{minimum,maximum} operations 2025-05-09 17:11:23 +02:00
Guillaume Gomez
390fc73ae7 Fix new clippy lints 2025-05-07 17:32:31 +02:00
Guillaume Gomez
0bdf0726cf Mark back::lto::optimize_thin_module and back::write::codegen` functions as safe 2025-05-07 17:20:25 +02:00
Guillaume Gomez
dcfd5c30d4 Remove unneeded let_chains feature 2025-05-07 17:12:22 +02:00
Guillaume Gomez
3278cb5545 Migrate to 2024 edition 2025-05-07 16:34:32 +02:00
Antoni Boucher
e608520b12 Stop ignoring the feature -sse 2025-05-06 17:58:21 -04:00
Michael Goulet
fcb4ef584d Rename Instance::new to Instance::new_raw and add a note that it is raw 2025-05-05 13:17:35 +00:00
Bryanskiy
7008f351b6 Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00