-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Rollup of 5 pull requests #146318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Rollup of 5 pull requests #146318
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
match clang's `va_arg` assembly on arm targets tracking issue: rust-lang#44930 For this example ```rust #![feature(c_variadic)] #[unsafe(no_mangle)] unsafe extern "C" fn variadic(a: f64, mut args: ...) -> f64 { let b = args.arg::<f64>(); let c = args.arg::<f64>(); a + b + c } ``` We currently generate (via llvm): ```asm variadic: sub sp, sp, rust-lang#12 stmib sp, {r2, r3} vmov d0, r0, r1 add r0, sp, rust-lang#4 vldr d1, [sp, rust-lang#4] add r0, r0, rust-lang#15 bic r0, r0, rust-lang#7 vadd.f64 d0, d0, d1 add r1, r0, rust-lang#8 str r1, [sp] vldr d1, [r0] vadd.f64 d0, d0, d1 vmov r0, r1, d0 add sp, sp, rust-lang#12 bx lr ``` LLVM is not doing a good job. In fact, it's well-known that LLVM's implementation of `va_arg` is kind of bad, and we implement it ourselves (based on clang) for many targets already. For arm, our own `emit_ptr_va_arg` saves 3 instructions. Next, it turns out it's important for LLVM to explicitly start and end the lifetime of the `va_list`. In rust-lang#146059 I already end the lifetime, but when looking at this again, I noticed that it is important to also start it, see https://godbolt.org/z/EGqvKTTsK: failing to explicitly start the lifetime uses an extra register. So, the combination of `emit_ptr_va_arg` with starting/ending the lifetime makes rustc emit exactly the instructions that clang generates:: ```asm variadic: sub sp, sp, rust-lang#12 stmib sp, {r2, r3} vmov d16, r0, r1 vldr d17, [sp, rust-lang#4] vadd.f64 d16, d16, d17 vldr d17, [sp, rust-lang#12] vadd.f64 d16, d16, d17 vmov r0, r1, d16 add sp, sp, rust-lang#12 bx lr ``` The arguments to `emit_ptr_va_arg` are based on [the clang implementation](https://github.com/llvm/llvm-project/blob/03dc2a41f3d9a500e47b513de5c5008c06860d65/clang/lib/CodeGen/Targets/ARM.cpp#L798-L844). r? `@workingjubilee` (I can re-roll if your queue is too full, but you do seem like the right person here)
In the rustc_llvm build script, don't consider arm64* to be 32-bit The build script for `rustc_llvm` needs to detect 32-bit targets so that it links against `libatomics`. To do this, it matches the target architecture against `arm`, unfortunately incorrectly matches Arm64EC, Arm64E, etc. This change adds a check that the target arch doesn't match `arm64`.
GVN: Ensure indirect is first projection in try_as_place. I haven't found any report for this bug on existing code, but managed to trigger it with rust-lang#143333
…lize-docs, r=jhpratt docs(std): add error docs for path canonicalize This PR adds the missing error documentation for both [Path.canonicalize](https://doc.rust-lang.org/std/path/struct.Path.html#method.canonicalize) and [PathBuf.canonicalize](https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.canonicalize) methods. Since both methods are wappers around [fs::canonicalize](https://doc.rust-lang.org/std/fs/fn.canonicalize.html), the error doc is copied directly from that function. This makes it faster to find what errors might arise when calling `path.canonicalize` or `path_buf.canonicalize` in the editor itself without needing to drill down to the `fs::canonicalzie` docs.
…=jhpratt Implement `Sum` and `Product` for `f16` and `f128`. Tracking issue: rust-lang#116909. This PR implements `core::iter::{Sum, Product}` for `f16` and `f128`. I'm curious as to why these two traits aren't already implemented. I've been unable to find any information about it at all, so if there is anything that currently blocks them, I would appreciate if someone could fill me in.
@bors r+ rollup=never p=5 |
bors
added a commit
that referenced
this pull request
Sep 8, 2025
Rollup of 5 pull requests Successful merges: - #144549 (match clang's `va_arg` assembly on arm targets) - #146184 (In the rustc_llvm build script, don't consider arm64* to be 32-bit) - #146298 (GVN: Ensure indirect is first projection in try_as_place.) - #146299 (docs(std): add error docs for path canonicalize) - #146300 (Implement `Sum` and `Product` for `f16` and `f128`.) r? `@ghost` `@rustbot` modify labels: rollup
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
rollup
A PR which is a rollup
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Successful merges:
va_arg
assembly on arm targets #144549 (match clang'sva_arg
assembly on arm targets)Sum
andProduct
forf16
andf128
. #146300 (ImplementSum
andProduct
forf16
andf128
.)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup