Commit Graph

1444 Commits

Author SHA1 Message Date
Robert Zakrzewski
b94cb8c01c Add missing types in the type_kind function
reorder type_kind

reorder type_kind

reorder type_kind

fix

fix

fix

fix
2024-06-21 16:12:05 +02:00
Robert Zakrzewski
fa18a181f7 Temporary downgrade compiler_builtins library. From version 0.1.110 the no-f16-f128 feautes introduced incompatibility 2024-06-21 16:12:05 +02:00
Robert Zakrzewski
a486dbfc17 Upgrade libgccjit.version 2024-06-21 16:12:05 +02:00
Robert Zakrzewski
d0977e3e2a Add support for Float16, Float32, Float64 and Float128
Upgrade libgccjit.version

Limit new Floatxx types to master branch only

apply rustfmt

Make new types available only when requested

Make new types available only when requested

Check if Float16 and Float128 are supported by the target platform

Replace Float with Float32 and Double with Float64 if target dependent type is defined

Add support for Float16|32|64|128 in the builder

Fix cargo fmt errors

Update gccjit wrapper

update hash of ligccjit
2024-06-21 16:12:05 +02:00
Nicholas Nethercote
8c5d84d102 Add blank lines after module-level //! comments.
Most modules have such a blank line, but some don't. Inserting the blank
line makes it clearer that the `//!` comments are describing the entire
module, rather than the `use` declaration(s) that immediately follows.
2024-06-20 09:23:20 +10:00
Oli Scherer
cb1bde07c1 Remove redundant argument from subdiagnostic method 2024-06-18 15:42:11 +00:00
Oli Scherer
527b3575ba Use a dedicated type instead of a reference for the diagnostic context
This paves the way for tracking more state (e.g. error tainting) in the diagnostic context handle
2024-06-18 15:42:11 +00:00
Shashank Trivedi
a63b83eb4e
ui pattern failure tests (#524) 2024-06-10 17:13:44 -04:00
Ralf Jung
d565d3d23d ScalarInt: size mismatches are a bug, do not delay the panic 2024-06-10 13:43:16 +02:00
Michael Goulet
b2d39816ba Uplift TypeRelation and Relate 2024-06-01 12:50:58 -04:00
Bennet Bleßmann
eccab8ba39
prevent libgccjit.so download on unsupported os/arch (#529)
prevent libgccjit.so download on unsupported os/arch (#529)


Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2024-06-01 13:29:55 +02:00
antoyo
c2c93ee721
Merge pull request #526 from GuillaumeGomez/readme-format
Improve Readme.md format
2024-05-28 07:55:47 -04:00
Guillaume Gomez
e7eeeb92da Improve Readme.md format 2024-05-28 12:03:35 +02:00
antoyo
02eb434da9
Merge pull request #519 from sadlerap/simd-ptr-provenance
simd: implement pointer provenance intrinsics
2024-05-27 12:48:19 -04:00
Gerson
b13943ed42
adding more env vars (#523) 2024-05-27 12:08:20 -04:00
Guillaume Gomez
a1d293337c Rollup merge of #125345 - durin42:thin-link-bitcode, r=bjorn3
rustc_codegen_llvm: add support for writing summary bitcode

Typical uses of ThinLTO don't have any use for this as a standalone file, but distributed ThinLTO uses this to make the linker phase more efficient. With clang you'd do something like `clang -flto=thin -fthin-link-bitcode=foo.indexing.o -c foo.c` and then get both foo.o (full of bitcode) and foo.indexing.o (just the summary or index part of the bitcode). That's then usable by a two-stage linking process that's more friendly to distributed build systems like bazel, which is why I'm working on this area.

I talked some to `@teresajohnson` about naming in this area, as things seem to be a little confused between various blog posts and build systems. "bitcode index" and "bitcode summary" tend to be a little too ambiguous, and she tends to use "thin link bitcode" and "minimized bitcode" (which matches the descriptions in LLVM). Since the clang option is thin-link-bitcode, I went with that to try and not add a new spelling in the world.

Per `@dtolnay,` you can work around the lack of this by using `lld --thinlto-index-only` to do the indexing on regular .o files of bitcode, but that is a bit wasteful on actions when we already have all the information in rustc and could just write out the matching minimized bitcode. I didn't test that at all in our infrastructure, because by the time I learned that I already had this patch largely written.
2024-05-23 23:39:26 +02:00
Augie Fackler
4a79b06f83 rustc_codegen_gcc: fix changed method signature 2024-05-23 15:23:21 -04:00
Augie Fackler
29fc479a30 rustc_codegen_llvm: add support for writing summary bitcode
Typical uses of ThinLTO don't have any use for this as a standalone
file, but distributed ThinLTO uses this to make the linker phase more
efficient. With clang you'd do something like `clang -flto=thin
-fthin-link-bitcode=foo.indexing.o -c foo.c` and then get both foo.o
(full of bitcode) and foo.indexing.o (just the summary or index part of
the bitcode). That's then usable by a two-stage linking process that's
more friendly to distributed build systems like bazel, which is why I'm
working on this area.

I talked some to @teresajohnson about naming in this area, as things
seem to be a little confused between various blog posts and build
systems. "bitcode index" and "bitcode summary" tend to be a little too
ambiguous, and she tends to use "thin link bitcode" and "minimized
bitcode" (which matches the descriptions in LLVM). Since the clang
option is thin-link-bitcode, I went with that to try and not add a new
spelling in the world.

Per @dtolnay, you can work around the lack of this by using `lld
--thinlto-index-only` to do the indexing on regular .o files of
bitcode, but that is a bit wasteful on actions when we already have all
the information in rustc and could just write out the matching minimized
bitcode. I didn't test that at all in our infrastructure, because by the
time I learned that I already had this patch largely written.
2024-05-22 14:04:22 -04:00
Scott McMurray
cae9e7ec6a Stop using to_hir_binop in codegen 2024-05-22 01:34:26 -07:00
Santiago Pastorino
21f58e4bc4 Rename Unsafe to Safety 2024-05-17 18:33:37 -03:00
bors
06f1ba4f65 Auto merge of #124972 - matthiaskrgr:rollup-3fablim, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #124615 (coverage: Further simplify extraction of mapping info from MIR)
 - #124778 (Fix parse error message for meta items)
 - #124797 (Refactor float `Primitive`s to a separate `Float` type)
 - #124888 (Migrate `run-make/rustdoc-output-path` to rmake)
 - #124957 (Make `Ty::builtin_deref` just return a `Ty`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-05-10 16:04:26 +00:00
Matthias Krüger
ce11a86648 Rollup merge of #124797 - beetrees:primitive-float, r=davidtwco
Refactor float `Primitive`s to a separate `Float` type

Now there are 4 of them, it makes sense to refactor `F16`, `F32`, `F64` and `F128` out of `Primitive` and into a separate `Float` type (like integers already are). This allows patterns like `F16 | F32 | F64 | F128` to be simplified into `Float(_)`, and is consistent with `ty::FloatTy`.

As a side effect, this PR also makes the `Ty::primitive_size` method work with `f16` and `f128`.

Tracking issue: #116909

`@rustbot` label +F-f16_and_f128
2024-05-10 16:10:46 +02:00
Ralf Jung
7ad734687c codegen: memmove/memset cannot be non-temporal 2024-05-09 18:59:00 +02:00
Andy Sadler
a0b4d735e3
simd: implement pointer provenance intrinsics
This adds support for the simd variants of the pointer provenance
intrinsics, which are `simd_cast_ptr`, `simd_expose_addr`, and
`simd_from_exposed_addr`.

The preconditions for each intrinsic are adapted from rustc_codegen_llvm
to preserve compatibility.  Each of these intrinsics are implemented as
calling the non-simd variant of each intrinsic on each lane.

This is enough to enable the UI test `ui/simd/intrinsic/ptr-cast.rs` to
pass.

Signed-off-by: Andy Sadler <andrewsadler122@gmail.com>
2024-05-08 20:51:21 -05:00
Nicholas Nethercote
6b7db50d89 Simplify use crate::rustc_foo::bar occurrences.
They can just be written as `use rustc_foo::bar`, which is far more
standard. (I didn't even know that a `crate::` prefix was valid.)
2024-05-08 16:57:31 +10:00
beetrees
f26221a936 Refactor float Primitives to a separate Float type 2024-05-06 14:56:10 +01:00
bors
efa15ebfef Auto merge of #123441 - saethlin:fixed-len-file-names, r=oli-obk
Stabilize the size of incr comp object file names

The current implementation does not produce stable-length paths, and we create the paths in a way that makes our allocation behavior is nondeterministic. I think `@eddyb` fixed a number of other cases like this in the past, and this PR fixes another one. Whether that actually matters I have no idea, but we still have bimodal behavior in rustc-perf and the non-uniformity in `find` and `ls` was bothering me.

I've also removed the truncation of the mangled CGU names. Before this PR incr comp paths look like this:
```
target/debug/incremental/scratch-38izrrq90cex7/s-gux6gz0ow8-1ph76gg-ewe1xj434l26w9up5bedsojpd/261xgo1oqnd90ry5.o
```
And after, they look like this:
```
target/debug/incremental/scratch-035omutqbfkbw/s-gux6borni0-16r3v1j-6n64tmwqzchtgqzwwim5amuga/55v2re42sztc8je9bva6g8ft3.o
```

On the one hand, I'm sure this will break some people's builds because they're on Windows and only a few bytes from the path length limit. But if we're that seriously worried about the length of our file names, I have some other ideas on how to make them smaller. And last time I deleted some hash truncations from the compiler, there was a huge drop in the number if incremental compilation ICEs that were reported: https://github.com/rust-lang/rust/pull/110367https://github.com/rust-lang/rust/pull/110367

---

Upon further reading, this PR actually fixes a bug. This comment says the CGU names are supposed to be a fixed-length hash, and before this PR they aren't: ca7d34efa9/compiler/rustc_monomorphize/src/partitioning.rs (L445-L448)
2024-05-03 17:41:48 +00:00
antoyo
d7c8e0fb43
Merge pull request #510 from GuillaumeGomez/fmt-cmd
Add `fmt` command
2024-05-03 08:07:47 -04:00
Guillaume Gomez
7e369b314b Simplify fmt check in CI 2024-05-03 11:52:47 +02:00
Guillaume Gomez
bd7c57b8cd Add fmt command 2024-05-03 11:52:47 +02:00
Guillaume Gomez
aee803b542
Merge pull request #512 from rust-lang/fix/tests
Fix segfault in tests due to a bug in libc 0.2.154
2024-05-03 00:05:22 +02:00
Antoni Boucher
5166efc3eb Fix segfault in tests due to a bug in libc 0.2.154
We now keep the Cargo.lock to fix the version of libc to 0.2.153.
2024-05-02 17:29:07 -04:00
Matthias Krüger
7ed351a508 Rollup merge of #124624 - WaffleLapkin:old_unit, r=fmease
Use `tcx.types.unit` instead of `Ty::new_unit(tcx)`

I don't think there is any need for the function, given that we can just access the `.types`, similarly to all other primitives?
2024-05-02 19:42:50 +02:00
Waffle Lapkin
3ea32a746d Inline & delete Ty::new_unit, since it's just a field access 2024-05-02 17:49:23 +02:00
Mark Rousskov
2b875f0927 Step bootstrap cfgs 2024-05-01 22:19:11 -04:00
antoyo
f557bc4680
Merge pull request #509 from GuillaumeGomez/signal-swallowing
Stop swallowing signals in build_system when running sub-commands
2024-05-01 10:29:14 -04:00
Guillaume Gomez
766f59d7f2 Stop swallowing signals in build_system when running sub-commands 2024-05-01 15:56:47 +02:00
antoyo
0f87072fdf
Merge pull request #508 from rust-lang/fix/aarch64
Some more fixes and workarounds for Aarch64
2024-04-29 11:34:59 -04:00
Antoni Boucher
9ed0543964 Some more fixes and workarounds for Aarch64 2024-04-29 11:07:54 -04:00
Guillaume Gomez
a79c5766e9
Merge pull request #507 from GuillaumeGomez/change-ci-download-urls
Download artifacts from `rust-lang/gcc` instead of old `antoyo/gcc`
2024-04-28 16:17:04 +02:00
Guillaume Gomez
4267ff0656 Download artifacts from rust-lang/gcc instead of old antoyo/gcc 2024-04-26 14:02:19 +02:00
antoyo
d408f23622
Merge pull request #504 from rust-lang/fix/aarch64
Some fixes for aarch64
2024-04-24 20:37:34 -04:00
Antoni Boucher
65e8717e45 Some fixes for aarch64 2024-04-24 20:15:15 -04:00
antoyo
01b0fb7b56
Merge pull request #494 from darcagn/custom_rustlib
Modify build_system's prepare stage to allow for custom sysroot source path
2024-04-24 19:25:38 -04:00
darc
04932ea22f Modify build_system's prepare stage to allow for custom sysroot source path 2024-04-24 16:53:44 -05:00
Oli Scherer
df0639b6e1 Error on using yield without also using #[coroutine] on the closure
And suggest adding the `#[coroutine]` to the closure
2024-04-24 08:05:29 +00:00
bors
752af44fc4 Auto merge of #122053 - erikdesjardins:alloca, r=nikic
Stop using LLVM struct types for alloca

The alloca type has no semantic meaning, only the size (and alignment, but we specify it explicitly) matter. Using `[N x i8]` is a more direct way to specify that we want `N` bytes, and avoids relying on LLVM's struct layout. It is likely that a future LLVM version will change to an untyped alloca representation.

Split out from #121577.

r? `@ghost`
2024-04-24 03:00:44 +00:00
Matthias Krüger
79d217fcf1 Rollup merge of #124003 - WaffleLapkin:dellvmization, r=scottmcm,RalfJung,antoyo
Dellvmize some intrinsics (use `u32` instead of `Self` in some integer intrinsics)

This implements https://github.com/rust-lang/compiler-team/issues/693 minus what was implemented in #123226.

Note: I decided to _not_ change `shl`/... builder methods, as it just doesn't seem worth it.

r? ``@scottmcm``
2024-04-23 20:17:51 +02:00
Ben Kimock
2d082aedf7 Stabilize the size of incr comp object file names 2024-04-22 10:50:07 -04:00
antoyo
41839175b0
Merge pull request #498 from rust-lang/fix/pass-indirect-with-params
Fix PassMode::Indirect with params
2024-04-22 09:44:46 -04:00