Commit Graph

4501 Commits

Author SHA1 Message Date
bjorn3
e9ac680447
Merge pull request #1541 from rust-lang/perf_opts
Use a BufWriter in emit_module to reduce syscall overhead
2024-11-09 12:14:06 +01:00
bjorn3
8a0053e9e1 Use a BufWriter in emit_module to reduce syscall overhead
For the coercions rustc-perf benchmark without this commit reduces the
total amount of time it takes to emit the object file from 270ms to
27ms.
2024-11-08 16:43:25 +01:00
bjorn3
c637a84ad4 Add finish_ongoing_codegen timer in join_codegen to match cg_llvm 2024-11-08 16:14:09 +01:00
bjorn3
b5966e4e88 Fix bootstrap test 2024-11-07 11:34:46 +00:00
bjorn3
b71483b2a1 Rustup to rustc 1.84.0-nightly (854980293 2024-11-06) 2024-11-07 10:40:15 +00:00
bjorn3
e7279c86be Sync from rust 8549802939 2024-11-07 09:45:59 +00:00
bjorn3
aedbae6ccc
Merge pull request #1540 from workingjubilee/directly-use-rustc-abi
cg_clif: Directly use rustc_abi
2024-11-03 15:38:12 +01:00
bjorn3
5e1298ccdb Revert "Skip testing extended_sysroot tests with cg_llvm on CI"
This reverts commit 521288ef0f.

I got what it tests backwards. It tests against a sysroot compiled with
LLVM. Not with the LLVM backend. The latter is done by the test_llvm CI
job.
2024-11-03 14:37:10 +00:00
Jubilee Young
42f71282a7 cg_clif: Directly use rustc_abi 2024-11-03 14:30:03 +00:00
bjorn3
521288ef0f Skip testing extended_sysroot tests with cg_llvm on CI 2024-11-03 13:47:58 +00:00
bjorn3
29d225d665 Manual rustup to rustc 1.84.0-nightly (b3f75cc87 2024-11-02) 2024-11-03 13:24:53 +00:00
bors
12677fd3d0 Auto merge of #132526 - bjorn3:sync_cg_clif-2024-11-02, r=bjorn3
Subtree sync for rustc_codegen_cranelift

The highlight this time is an update to Cranelift 0.113,

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2024-11-03 05:03:52 +00:00
Noratrieb
541c33ec41 Rename target triple to target tuple in many places in the compiler
This changes the naming to the new naming, used by `--print
target-tuple`.
It does not change all locations, but many.
2024-11-02 21:29:59 +01:00
bjorn3
2b97b2a6ce Merge branch 'sync_from_rust' 2024-11-02 14:57:11 +00:00
bjorn3
e2a5108657 Merge commit '5b1246bb4bed72fd0bb8fa497d8e5ed2c7f3515c' into sync_cg_clif-2024-11-02 2024-11-02 14:53:30 +00:00
bjorn3
5b1246bb4b Rustup to rustc 1.84.0-nightly (705cfe0e9 2024-11-01) 2024-11-02 14:16:06 +00:00
bjorn3
b856716b81 Sync from rust 705cfe0e96 2024-11-02 14:08:50 +00:00
Mads Marquart
322d392d90 Move versioned LLVM target creation to rustc_codegen_ssa
The OS version depends on the deployment target environment variables,
the access of which we want to move to later in the compilation pipeline
that has access to more information, for example `env_depinfo`.
2024-11-01 17:07:18 +01:00
bjorn3
297e933bf8 Fix rustc test suite 2024-10-31 09:51:09 +00:00
bjorn3
05126cdc10 Rustup to rustc 1.84.0-nightly (759e07f06 2024-10-30) 2024-10-31 09:28:49 +00:00
bjorn3
28701aa46d Sync from rust 759e07f063 2024-10-31 09:20:43 +00:00
Jubilee Young
e3c154705c cg_clif: rustc_abi::Abi => BackendRepr 2024-10-29 15:01:01 -07:00
Jubilee Young
988f49d04f cg_clif: Rename LayoutS to LayoutData 2024-10-27 22:32:40 -07:00
Matthias Krüger
a29a8f523e Rollup merge of #132168 - fee1-dead-contrib:fxclean, r=compiler-errors
Effects cleanup

- removed extra bits from predicates queries that are no longer needed in the new system
- removed the need for `non_erasable_generics` to take in tcx and DefId, removed unused arguments in callers

r? compiler-errors
2024-10-26 06:29:48 +02:00
Deadbeef
83f1121ebd Effects cleanup
- removed extra bits from predicates queries that are no longer needed in the new system
- removed the need for `non_erasable_generics` to take in tcx and DefId, removed unused arguments in callers
2024-10-26 10:19:07 +08:00
Ralf Jung
6ca276df2e Re-do recursive const stability checks
Fundamentally, we have *three* disjoint categories of functions:
1. const-stable functions
2. private/unstable functions that are meant to be callable from const-stable functions
3. functions that can make use of unstable const features

This PR implements the following system:
- `#[rustc_const_stable]` puts functions in the first category. It may only be applied to `#[stable]` functions.
- `#[rustc_const_unstable]` by default puts functions in the third category. The new attribute `#[rustc_const_stable_indirect]` can be added to such a function to move it into the second category.
- `const fn` without a const stability marker are in the second category if they are still unstable. They automatically inherit the feature gate for regular calls, it can now also be used for const-calls.

Also, several holes in recursive const stability checking are being closed.
There's still one potential hole that is hard to avoid, which is when MIR
building automatically inserts calls to a particular function in stable
functions -- which happens in the panic machinery. Those need to *not* be
`rustc_const_unstable` (or manually get a `rustc_const_stable_indirect`) to be
sure they follow recursive const stability. But that's a fairly rare and special
case so IMO it's fine.

The net effect of this is that a `#[unstable]` or unmarked function can be
constified simply by marking it as `const fn`, and it will then be
const-callable from stable `const fn` and subject to recursive const stability
requirements. If it is publicly reachable (which implies it cannot be unmarked),
it will be const-unstable under the same feature gate. Only if the function ever
becomes `#[stable]` does it need a `#[rustc_const_unstable]` or
`#[rustc_const_stable]` marker to decide if this should also imply
const-stability.

Adding `#[rustc_const_unstable]` is only needed for (a) functions that need to
use unstable const lang features (including intrinsics), or (b) `#[stable]`
functions that are not yet intended to be const-stable. Adding
`#[rustc_const_stable]` is only needed for functions that are actually meant to
be directly callable from stable const code. `#[rustc_const_stable_indirect]` is
used to mark intrinsics as const-callable and for `#[rustc_const_unstable]`
functions that are actually called from other, exposed-on-stable `const fn`. No
other attributes are required.
2024-10-25 20:31:40 +02:00
bjorn3
616abf15d9
Merge pull request #1537 from dpaoliello/debugunwind
Don't panic about debug info for Arm64 Windows unwind info
2024-10-24 18:56:57 +02:00
Daniel Paoliello
bcb7de3bb6 Don't panic about debug info for Arm64 Windows unwind info 2024-10-24 09:33:49 -07:00
bjorn3
c28d433bd9 Update Cranelift to 0.113 2024-10-24 09:28:46 +00:00
bjorn3
3f06952be3 Rustup to rustc 1.84.0-nightly (4f2f477fd 2024-10-23) 2024-10-24 09:16:08 +00:00
bjorn3
0093a4b920 Sync from rust 4f2f477fde 2024-10-24 08:51:44 +00:00
Adrian Taylor
c5a5e86baa Rename Receiver -> LegacyReceiver
As part of the "arbitrary self types v2" project, we are going to
replace the current `Receiver` trait with a new mechanism based on a
new, different `Receiver` trait.

This PR renames the old trait to get it out the way. Naming is hard.
Options considered included:
* HardCodedReceiver (because it should only be used for things in the
  standard library, and hence is sort-of hard coded)
* LegacyReceiver
* TargetLessReceiver
* OldReceiver

These are all bad names, but fortunately this will be temporary.
Assuming the new mechanism proceeds to stabilization as intended, the
legacy trait will be removed altogether.

Although we expect this trait to be used only in the standard library,
we suspect it may be in use elsehwere, so we're landing this change
separately to identify any surprising breakages.

It's known that this trait is used within the Rust for Linux project; a
patch is in progress to remove their dependency.

This is a part of the arbitrary self types v2 project,
https://github.com/rust-lang/rfcs/pull/3519
https://github.com/rust-lang/rust/issues/44874

r? @wesleywiser
2024-10-22 12:55:16 +00:00
bjorn3
45c2002f08 Update abi-cafe test expectations for a recent fix of the rust abi 2024-10-20 14:29:22 +00:00
bjorn3
04f33cc839 Rustup to rustc 1.84.0-nightly (da935398d 2024-10-19) 2024-10-20 14:14:00 +00:00
bjorn3
383bb665d2 Sync from rust da935398d5 2024-10-20 13:57:42 +00:00
Michael Goulet
65201c20a6 Fix tests 2024-10-19 18:07:35 +00:00
Michael Goulet
2f1b15f145 Allow dropping dyn principal 2024-10-17 20:43:31 +02:00
bjorn3
6666435b8a Fix rustc test suite (broken by prev commit) 2024-10-17 16:58:00 +00:00
bjorn3
bbaaecc250 Stop copying libstd.so to dist/lib
It is only necessary in dist/lib/rustlib/*/lib anymore. The jit mode now
correctly find it there too.
2024-10-17 16:31:12 +00:00
bjorn3
16067fdea1 Mark blocks as cold in a couple more places 2024-10-17 17:57:34 +02:00
bjorn3
47a7e994f2 Rustup to rustc 1.84.0-nightly (798fb83f7 2024-10-16) 2024-10-17 10:55:09 +00:00
bjorn3
bf2da675c8 Sync from rust 798fb83f7d 2024-10-17 10:07:36 +00:00
Jed Brown
270fb2130c intrinsics.fmuladdf{16,32,64,128}: expose llvm.fmuladd.* semantics
Add intrinsics `fmuladd{f16,f32,f64,f128}`. This computes `(a * b) +
c`, to be fused if the code generator determines that (i) the target
instruction set has support for a fused operation, and (ii) that the
fused operation is more efficient than the equivalent, separate pair
of `mul` and `add` instructions.

https://llvm.org/docs/LangRef.html#llvm-fmuladd-intrinsic

MIRI support is included for f32 and f64.

The codegen_cranelift uses the `fma` function from libc, which is a
correct implementation, but without the desired performance semantic. I
think this requires an update to cranelift to expose a suitable
instruction in its IR.

I have not tested with codegen_gcc, but it should behave the same
way (using `fma` from libc).
2024-10-11 15:32:56 -06:00
bjorn3
76dfce7a6f Fix rustc test suite 2024-10-10 16:32:42 +00:00
bjorn3
5d7d2518b3 Rustup to rustc 1.83.0-nightly (eb4e23467 2024-10-09) 2024-10-10 16:19:54 +00:00
bjorn3
3cf701c845 Sync from rust eb4e234674 2024-10-10 16:13:20 +00:00
bjorn3
14f656ede3 Compile all abi-cafe tests with debuginfo enabled 2024-10-10 16:09:42 +00:00
Jubilee Young
48504415cf cg_clif: Factor out rustc_target::abi 2024-10-08 18:24:56 -07:00
Folkert de Vries
2811ce715d various fixes for naked_asm! implementation
- fix for divergence
- fix error message
- fix another cranelift test
- fix some cranelift things
- don't set the NORETURN option for naked asm
- fix use of naked_asm! in doc comment
- fix use of naked_asm! in run-make test
- use `span_bug` in unreachable branch
2024-10-06 19:00:09 +02:00
Urgau
0bd0b99729 Use wide pointers consistenly across the compiler 2024-10-04 14:06:48 +02:00