1
Fork 0
Commit graph

1774 commits

Author SHA1 Message Date
Antoni Boucher
4b5940ad77 Fix overflow operations 2025-04-17 08:50:06 -04:00
Antoni Boucher
0d773175cc Add support for simd_insert_dyn and simd_extract_dyn 2025-04-17 08:50:02 -04:00
Antoni Boucher
bb1e6a3193 Fix tests 2025-04-17 08:49:55 -04:00
Antoni Boucher
6504f4c09c Format 2025-04-17 08:49:52 -04:00
Antoni Boucher
bc0bc8d5e1 Fix int_to_float_cast for f128 2025-04-17 08:49:49 -04:00
Antoni Boucher
ec44cfdfb4 Fix tests 2025-04-17 08:49:44 -04:00
Antoni Boucher
ecf0a1eea3 Update GCC version 2025-04-17 08:49:41 -04:00
Antoni Boucher
5cf2bbc4e2 Fix clippy warnings 2025-04-17 08:49:37 -04:00
Antoni Boucher
f9822772e8 Fix libcore tests 2025-04-17 08:49:33 -04:00
Antoni Boucher
9a453d46f4 Update other patches 2025-04-17 08:49:30 -04:00
Antoni Boucher
e1fa74b4a9 Implement copysignf128 2025-04-17 08:49:24 -04:00
Antoni Boucher
5c832e5ece Remove most of builtins hack since it's not necessary anymore 2025-04-17 08:49:21 -04:00
Antoni Boucher
be75a58538 Fix compilation 2025-04-17 08:49:15 -04:00
Antoni Boucher
cc81c706e4 Fix patches 2025-04-17 08:49:08 -04:00
Antoni Boucher
c1d21003bb Update to nightly-2025-04-17 2025-04-17 08:34:54 -04:00
Antoni Boucher
90c6c9f6a9 Merge branch 'master' into sync_from_rust_2025_04_17 2025-04-17 08:34:28 -04:00
Michael Goulet
22d3c0d70a Prepend temp files with a string per invocation of rustc 2025-04-07 20:48:40 +00:00
Michael Goulet
3c3a6a2995 Simplify temp path creation a bit 2025-04-07 20:48:40 +00:00
Matthias Krüger
3670f39732 Rollup merge of #138949 - madsmtm:rename-to-darwin, r=WaffleLapkin
Rename `is_like_osx` to `is_like_darwin`

Replace `is_like_osx` with `is_like_darwin`, which more closely describes reality (OS X is the pre-2016 name for macOS, and is by now quite outdated; Darwin is the overall name for the OS underlying Apple's macOS, iOS, etc.).

``@rustbot`` label O-apple
r? compiler
2025-04-04 08:02:05 +02:00
bors
de1dd8beee Auto merge of #138503 - bjorn3:string_merging, r=tmiasko
Avoid wrapping constant allocations in packed structs when not necessary

This way LLVM will set the string merging flag if the alloc is a nul terminated string, reducing binary sizes.

try-job: armhf-gnu
2025-03-28 10:18:32 +00:00
bjorn3
2f5aa084c8 Avoid wrapping constant allocations in packed structs when not necessary
This way LLVM will set the string merging flag if the alloc is a nul
terminated string, reducing binary sizes.
2025-03-28 09:19:57 +00:00
Mads Marquart
5743d381af Rename is_like_osx to is_like_darwin 2025-03-25 21:53:52 +01:00
bjorn3
b25a593b40 Remove implicit #[no_mangle] for #[rustc_std_internal_symbol] 2025-03-17 14:08:09 +00:00
Ralf Jung
7989568b8e intrinsics: remove unnecessary leading underscore from argument names 2025-03-12 08:04:09 +01:00
bors
b80255427c Auto merge of #137586 - nnethercote:SetImpliedBits, r=bjorn3
Speed up target feature computation

The LLVM backend calls `LLVMRustHasFeature` twice for every feature. In short-running rustc invocations, this accounts for a surprising amount of work.

r? `@bjorn3`
2025-03-11 12:05:16 +00:00
Matthias Krüger
454b083b56 Rollup merge of #138040 - thaliaarchi:use-prelude-size-of.compiler, r=compiler-errors
compiler: Use `size_of` from the prelude instead of imported

Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the prelude instead of importing or qualifying them. Apply this change across the compiler.

These functions were added to all preludes in Rust 1.80.

r? ``@compiler-errors``
2025-03-09 10:34:49 +01:00
antoyo
499de70f3a
Merge pull request #639 from madhav-madhusoodanan/test_update_mini_core
Cleaned up tests by bringing objects under `mini_core` into scope
2025-03-08 07:52:21 -05:00
Madhav Madhusoodanan
572da5cd26 cleaned up tests by bringing objects under mini_core into scope 2025-03-08 16:47:58 +05:30
Thalia Archibald
70b5888827 compiler: Use size_of from the prelude instead of imported
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the
prelude instead of importing or qualifying them.

These functions were added to all preludes in Rust 1.80.
2025-03-07 13:37:04 -08:00
Matthias Krüger
24bf40456f Rollup merge of #137549 - oli-obk:llvm-ffi, r=davidtwco
Clean up various LLVM FFI things in codegen_llvm

cc ```@ZuseZ4``` I touched some autodiff parts

The major change of this PR is [bfd88ce](https://github.com/rust-lang/rust/pull/137549/commits/bfd88cead0dd79717f123ad7e9a26ecad88653cb) which makes `CodegenCx` generic just like `GenericBuilder`

The other commits mostly took advantage of the new feature of making extern functions safe, but also just used some wrappers that were already there and shrunk unsafe blocks.

best reviewed commit-by-commit
2025-03-07 19:15:34 +01:00
Nicholas Nethercote
b2b94f4a40 Change signature of target_features_cfg.
Currently it is called twice, once with `allow_unstable` set to true and
once with it set to false. This results in some duplicated work. Most
notably, for the LLVM backend, `LLVMRustHasFeature` is called twice for
every feature, and it's moderately slow. For very short running
compilations on platforms with many features (e.g. a `check` build of
hello-world on x86) this is a significant fraction of runtime.

This commit changes `target_features_cfg` so it is only called once, and
it now returns a pair of feature sets. This halves the number of
`LLVMRustHasFeature` calls.
2025-03-05 09:49:17 +11:00
Nicholas Nethercote
ae07d7d368 Simplify implied_target_features.
Currently its argument is an iterator, but in practice it's always a
singleton.
2025-03-05 09:20:28 +11:00
bors
ab1780693e Auto merge of #137959 - matthiaskrgr:rollup-62vjvwr, r=matthiaskrgr
Rollup of 12 pull requests

Successful merges:

 - #135767 (Future incompatibility warning `unsupported_fn_ptr_calling_conventions`: Also warn in dependencies)
 - #137852 (Remove layouting dead code for non-array SIMD types.)
 - #137863 (Fix pretty printing of unsafe binders)
 - #137882 (do not build additional stage on compiler paths)
 - #137894 (Revert "store ScalarPair via memset when one side is undef and the other side can be memset")
 - #137902 (Make `ast::TokenKind` more like `lexer::TokenKind`)
 - #137921 (Subtree update of `rust-analyzer`)
 - #137922 (A few cleanups after the removal of `cfg(not(parallel))`)
 - #137939 (fix order on shl impl)
 - #137946 (Fix docker run-local docs)
 - #137955 (Always allow rustdoc-json tests to contain long lines)
 - #137958 (triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-04 02:27:56 +00:00
Matthias Krüger
273fe4a8a6 Rollup merge of #137894 - compiler-errors:no-scalar-pair-opt, r=oli-obk
Revert "store ScalarPair via memset when one side is undef and the other side can be memset"

cc #137892
reverts #135335

r? oli-obk
2025-03-03 20:47:12 +01:00
Matthias Krüger
fe9feb3120 Rollup merge of #137741 - cuviper:const_str-raw_entry, r=Mark-Simulacrum
Stop using `hash_raw_entry` in `CodegenCx::const_str`

That unstable feature (#56167) completed fcp-close, so the compiler needs to be
migrated away to allow its removal. In this case, `cg_llvm` and `cg_gcc`
were using raw entries to optimize their `const_str_cache` lookup and
insertion. We can change that to separate `get` and (on miss) `insert`
calls, so we still have the fast path avoiding string allocation when
the cache hits.
2025-03-03 10:41:00 +01:00
Michael Goulet
c25f12a667 Revert "Auto merge of #135335 - oli-obk:push-zxwssomxxtnq, r=saethlin"
This reverts commit a7a6c64a65, reversing
changes made to ebbe63891f.
2025-03-02 18:52:48 +00:00
Matthias Krüger
d344960f88 Rollup merge of #137804 - RalfJung:backend-repr-simd-vector, r=workingjubilee
rename BackendRepr::Vector → SimdVector

For many Rustaceans, "vector" does not imply "SIMD", so let's be more clear in this type that is used pervasively in the compiler.

r? `@workingjubilee`
2025-03-01 16:03:10 +01:00
bors
24b202f0c0 Auto merge of #133250 - DianQK:embed-bitcode-pgo, r=nikic
The embedded bitcode should always be prepared for LTO/ThinLTO

Fixes #115344. Fixes #117220.

There are currently two methods for generating bitcode that used for LTO. One method involves using `-C linker-plugin-lto` to emit object files as bitcode, which is the typical setting used by cargo. The other method is through `-C embed-bitcode=yes`.

When using with `-C embed-bitcode=yes -C lto=no`, we run a complete non-LTO LLVM pipeline to obtain bitcode, then the bitcode is used for LTO. We run the Call Graph Profile Pass twice on the same module.

This PR is doing something similar to LLVM's `buildFatLTODefaultPipeline`, obtaining the bitcode for embedding after running `buildThinLTOPreLinkDefaultPipeline`.

r? nikic
2025-03-01 08:22:18 +00:00
Ralf Jung
975dee20ef rename BackendRepr::Vector → SimdVector 2025-02-28 17:17:45 +01:00
Josh Stone
7721431d57 Stop using hash_raw_entry in CodegenCx::const_str
That unstable feature completed fcp-close, so the compiler needs to be
migrated away to allow its removal. In this case, `cg_llvm` and `cg_gcc`
were using raw entries to optimize their `const_str_cache` lookup and
insertion. We can change that to separate `get` and (on miss) `insert`
calls, so we still have the fast path avoiding string allocation when
the cache hits.
2025-02-27 09:09:52 -08:00
León Orell Valerian Liehr
b627900585 Rollup merge of #137595 - folkertdev:remove-simd-pow-powi, r=RalfJung
remove `simd_fpow` and `simd_fpowi`

Discussed in https://github.com/rust-lang/rust/issues/137555

These functions are not exposed from `std::intrinsics::simd`, and not used anywhere outside of the compiler. They also don't lower to particularly good code at least on the major ISAs (I checked x86_64, aarch64, s390x, powerpc), where the vector is just spilled to the stack and scalar functions are used for the actual logic.

r? `@RalfJung`
2025-02-25 13:07:40 +01:00
Folkert de Vries
78481458d1 remove simd_fpow and simd_fpowi 2025-02-25 09:20:10 +01:00
Oli Scherer
334eb82117 Remove an unused lifetime param 2025-02-24 15:11:29 +00:00
Oli Scherer
71c189a2ef Generalize BaseTypeCodegenMethods 2025-02-24 15:11:29 +00:00
Oli Scherer
e92466e22a Remove an unnecessary lifetime 2025-02-24 15:05:56 +00:00
Ralf Jung
15f0dca531 remove support for rustc_intrinsic_must_be_overridden from the compiler 2025-02-24 07:53:59 +01:00
Trevor Gross
a9e8cfe3f7 Rollup merge of #136543 - RalfJung:round-ties-even, r=tgross35
intrinsics: unify rint, roundeven, nearbyint in a single round_ties_even intrinsic

LLVM has three intrinsics here that all do the same thing (when used in the default FP environment). There's no reason Rust needs to copy that historically-grown mess -- let's just have one intrinsic and leave it up to the LLVM backend to decide how to lower that.

Suggested by `@hanna-kruppe` in https://github.com/rust-lang/rust/issues/136459; Cc `@tgross35`

try-job: test-various
2025-02-23 14:30:25 -05:00
DianQK
9b8701d27e Save pre-link bitcode to ModuleCodegen 2025-02-23 21:23:38 +08:00
DianQK
aa038c2d95 Add new_regular and new_allocator to ModuleCodegen 2025-02-23 21:23:38 +08:00
Zachary S
be635722bd Remove BackendRepr::Uninhabited, replaced with an uninhabited: bool field in LayoutData.
Also update comments that refered to BackendRepr::Uninhabited.
2025-02-20 13:27:32 -06:00