Skip to content

Update the compiler-builtins subtree #142036

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

Merged
merged 31 commits into from
Jun 5, 2025
Merged

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Jun 4, 2025

Update the Josh subtree to rust-lang/compiler-builtins@5c3d8f2753b8.

r? @ghost

beetrees and others added 30 commits May 21, 2025 19:24
These were deleted during refactoring in 0a2dc5d9 ("Combine the source
files for more generic implementations") but got added back by accident
in 54bac411 ("refactor: Move the libm crate to a subdirectory"). Remove
them again here.
As seen at [1], LLVM uses `long long` on LLP64 (to get a 64-bit integer
matching pointer size) and `long` on everything else, with exceptions
for AArch64 and AVR. Our current logic always uses an `i32`. This
happens to work because LLVM uses 32-bit instructions to check the
output on x86-64, but the GCC checks the full 64-bit register so garbage
in the upper half leads to incorrect results.

Update our return type to be `isize`, with exceptions for AArch64 and
AVR.

Fixes: rust-lang/compiler-builtins#919

[1]: https://github.com/llvm/llvm-project/blob/0cf3c437c18ed27d9663d87804a9a15ff6874af2/compiler-rt/lib/builtins/fp_compare_impl.inc#L11-L27
Link to Apache License changed from htps:// to https://
Since the two crates are now in the same repo, it is easier to share
code. Begin some deduplication with the integer traits.
These are now provided by `compiler-builtins`, so there is no need to
also build the C versions. This was detected by checking for duplicate
symbols and not excluding weak symbols (like CI currently does).
This should be less error-prone and adaptable than the `nm` version, and
have better cross-platform support without needing LLVM `nm` installed.
Since a working `nm` is no longer needed as part of CI, the rustup
component can be removed.
Do the same for `builtins-test-intrinsics`. Mostly this means updating
`extern` to `unsafe extern`, and fixing a few new Clippy lints.
As part of this, the u256 benchmarks are reorganized to a group.
Currently we only build this, but it is possible to run the binary.
Change the CI script to do so here.
When multiple merges to `master` happen before a CI run completes, the
in-progress job is getting canceled. Fix this by using the commit sha
for the group key if a pull request number is not available, rather than
`github.ref` (which is always `refs/head/master` after merge). This
should prevent jobs running on previous commits from getting cancelled,
while still ensuring there is only ever one active run per pull request.
We may soon want to use some new nightly features in `compiler-builtins`
and `libm`, specifically `cfg_target_has_reliable_f16_f128` which was
added in the past few weeks. This will mean we need a newer toolchain
for benchmarks to continue building.

Bump to the current latest nightly so we are not blocked on this down
the line.
Currently we run logspace tests for extensive tests, but there isn't any
reason we couldn't also run more kinds of tests more extensively (e.g.
more edge cases, combine edge cases with logspace for multi-input
functions, etc). As a first step toward making this possible, make
`extensive` a new field in `CheckCtx`, and rename `QuickSpaced` to
`Spaced`.
We don't actually need this for now, but eventually it would be nice to
run icount benchmarks on multiple targets. Start tagging artifact names
with the architecture, and allow passing `--tag` to `ci-util.py` in
order to retrieve the correct one.
In particular, this includes a fix to `iai-callgrind` that will allow us
to simplify our benchmark runner.
iai-callgrind now correctly exits with error if regressions were found
[1], so we no longer need to check for regressions manually. Remove this
check and instead exit based on the exit status of the benchmark run.

[1] iai-callgrind/iai-callgrind#337
`binop_common` emits a `SKIP` that is intended to apply only to
`copysign`, but is instead applying to all binary operators. Correct the
general case but leave the currently-failing `maximum_num` tests as a
FIXME, to be resolved separately in [1].

Also simplify skip logic and NaN checking, and add a few more `copysign`
checks.

[1]: rust-lang/compiler-builtins#939
The submodule was causing issues in rust-lang/rust, so eliminiate it
here. `build-musl` is also removed from `libm-test`'s default features
so the crate doesn't need to be built by default.
This will be used by `josh` tooling.
Create a crate that handles pulling from and pushing to rust-lang/rust.
This can be invoked with the following:

    $ cargo run -p josh-sync -- rustc-pull
    $ RUSTC_GIT=/path/to/rust/checkout cargo run -p josh-sync -- rustc-push <username>
To prepare for merging from rust-lang/rust, set the version file to:

    df8102f Auto merge of rust-lang#142002 - onur-ozkan:follow-ups2, r=jieyouxu
…ub.com/rust-lang/rust

Pull recent changes from rust-lang/rust via Josh.

Upstream ref: df8102f
Filtered ref: 3c30d8cb1ec24e0b8a88a5cedcf6b9bece0117d7
@tgross35
Copy link
Contributor Author

tgross35 commented Jun 4, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 4, 2025

📌 Commit 1599091 has been approved by tgross35

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 4, 2025
@tgross35
Copy link
Contributor Author

tgross35 commented Jun 4, 2025

@bors r-

There will be one more change to sync in rust-lang/compiler-builtins#945

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 4, 2025
This was introduced before `#[panic_handler]` was stable, but should no
longer be needed. Additionally, we only need it for
`builtins-test-intrinsics`, not as a dependency of `compiler-builtins`.
@tgross35
Copy link
Contributor Author

tgross35 commented Jun 4, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 4, 2025

📌 Commit ab453db has been approved by tgross35

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 4, 2025
@tgross35
Copy link
Contributor Author

tgross35 commented Jun 5, 2025

@bors p=1 fixes dist breakage

@tgross35
Copy link
Contributor Author

tgross35 commented Jun 5, 2025

@matthiaskrgr fyi this should still be rolluppable (don't always like that p=1 puts things in front of everything else) , it's just p=1 for fixing some recent tooling & downsitream breakage

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 5, 2025
Update the `compiler-builtins` subtree

Update the Josh subtree to rust-lang/compiler-builtins@5c3d8f2753b8.

r? `@ghost`
bors added a commit that referenced this pull request Jun 5, 2025
Rollup of 7 pull requests

Successful merges:

 - #141709 (jsondocck: Refactor directive handling)
 - #141974 (`tests/ui`: A New Order [4/N])
 - #141989 (rustdoc-json-type: Depend on `serde` and `serde_derive` seperately)
 - #142015 (Report the actual item that evaluation failed for)
 - #142026 (bootstrap: Fix file permissions when dereferencing symlinks)
 - #142032 (Fix parsing of frontmatters with inner hyphens)
 - #142036 (Update the `compiler-builtins` subtree)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 9a9e160 into rust-lang:master Jun 5, 2025
10 checks passed
@rustbot rustbot added this to the 1.89.0 milestone Jun 5, 2025
rust-timer added a commit that referenced this pull request Jun 5, 2025
Rollup merge of #142036 - tgross35:update-builtins, r=tgross35

Update the `compiler-builtins` subtree

Update the Josh subtree to rust-lang/compiler-builtins@5c3d8f2753b8.

r? ``@ghost``
@bors
Copy link
Collaborator

bors commented Jun 5, 2025

⌛ Testing commit ab453db with merge 076ec59...

@tgross35 tgross35 deleted the update-builtins branch June 5, 2025 19:49
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jun 6, 2025
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#141709 (jsondocck: Refactor directive handling)
 - rust-lang/rust#141974 (`tests/ui`: A New Order [4/N])
 - rust-lang/rust#141989 (rustdoc-json-type: Depend on `serde` and `serde_derive` seperately)
 - rust-lang/rust#142015 (Report the actual item that evaluation failed for)
 - rust-lang/rust#142026 (bootstrap: Fix file permissions when dereferencing symlinks)
 - rust-lang/rust#142032 (Fix parsing of frontmatters with inner hyphens)
 - rust-lang/rust#142036 (Update the `compiler-builtins` subtree)

r? `@ghost`
`@rustbot` modify labels: rollup
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Jun 9, 2025
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#141709 (jsondocck: Refactor directive handling)
 - rust-lang/rust#141974 (`tests/ui`: A New Order [4/N])
 - rust-lang/rust#141989 (rustdoc-json-type: Depend on `serde` and `serde_derive` seperately)
 - rust-lang/rust#142015 (Report the actual item that evaluation failed for)
 - rust-lang/rust#142026 (bootstrap: Fix file permissions when dereferencing symlinks)
 - rust-lang/rust#142032 (Fix parsing of frontmatters with inner hyphens)
 - rust-lang/rust#142036 (Update the `compiler-builtins` subtree)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiler-builtins Area: compiler-builtins (https://github.com/rust-lang/compiler-builtins) has-merge-commits PR has merge commits, merge with caution. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants