Skip to content

Rollup of 6 pull requests - #136389

Merged
bors merged 15 commits into
rust-lang:masterfrom
matthiaskrgr:rollup-x453dy9
Feb 1, 2025
Merged

Rollup of 6 pull requests#136389
bors merged 15 commits into
rust-lang:masterfrom
matthiaskrgr:rollup-x453dy9

Conversation

@matthiaskrgr

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

WaffleLapkinand others added 15 commits January 31, 2025 05:30
- add tests for `a == b` where missing
- try to make all the tests more similar
- try to use more illustrative test values
`<` seems to be the "lucky one" for llvm
…oli-obk
Implement MIR lowering for unsafe binders
This is the final bit of the unsafe binders puzzle. It implements MIR, CTFE, and codegen for unsafe binders, and enforces that (for now) they are `Copy`. Later on, I'll introduce a new trait that relaxes this requirement to being "is `Copy` or `ManuallyDrop<T>`" which more closely models how we treat union fields.
Namely, wrapping unsafe binders is now `Rvalue::WrapUnsafeBinder`, which acts much like an `Rvalue::Aggregate`. Unwrapping unsafe binders are implemented as a MIR projection `ProjectionElem::UnwrapUnsafeBinder`, which acts much like `ProjectionElem::Field`.
Tracking:
- rust-lang#130516
docs: Documented Send and Sync requirements for Mutex + MutexGuard
This an attempt to continue where rust-lang#123225 left off.
I did some light clean up from the work done in that PR.
I also documented the `!Send` + `Sync` implementations for `MutexGuard` to the best of my knowledge.
Let me know if I got anything wrong 😄
fixesrust-lang#122856
cc: ``@IoaNNUwU``
r? ``@joboet``
Implement all mix/max functions in a (hopefully) more optimization amendable way
Previously the graph was like this:
```
min -> Ord::min -> min_by -> match on compare() (in these cases compare = Ord::cmp)
^
|
min_by_key
```
now it looks like this:
```
min -> Ord::min -> `<=` <- min_by_key
min_by -> `Ordering::is_le` of `compare()`
```
(`max*` and `minmax*` are the exact same, i.e. they also use `<=` and `is_le`)
I'm not sure how to test this, but it should probably be easier for the backend to optimize.
r? `@scottmcm`
cc rust-lang#115939 (comment)
Stabilize `once_wait`
Closes: rust-lang#127527.
`@rustbot` label: +T-libs-api
r? libs-api
Add link attribute for Enzyme's LLVMRust FFI
Since rust-lang#133429 landed, the compiler doesn't build with `-Zcross-crate-inline-threshold=always`. I don't expect anyone else to test or fix issues with that goofy configuration, so I'm fixing it.
This PR adds a link attribute just like rust-lang#118142 for all the new LLVMRust functions. They were actually added in rust-lang#130060 but weren't used until just now.
@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. rollup A PR which is a rollup labels Feb 1, 2025
@matthiaskrgr

Copy link
Copy Markdown
MemberAuthor

@bors r+ rollup=never p=5

@bors

bors commented Feb 1, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit 2a82ebd has been approved by matthiaskrgr

It is now in the queue for this repository.

@borsbors 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. labels Feb 1, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 1, 2025
…iaskrgr
Rollup of 6 pull requests
Successful merges:
- rust-lang#130514 (Implement MIR lowering for unsafe binders)
- rust-lang#135684 (docs: Documented Send and Sync requirements for Mutex + MutexGuard)
- rust-lang#136307 (Implement all mix/max functions in a (hopefully) more optimization amendable way)
- rust-lang#136360 (Stabilize `once_wait`)
- rust-lang#136364 (document that ptr cmp is unsigned)
- rust-lang#136374 (Add link attribute for Enzyme's LLVMRust FFI)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors

bors commented Feb 1, 2025

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 2a82ebd with merge fa46e16...

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job dist-x86_64-msvc failed! Check out the build log: (web)(plain)

Click to see the possible cause of the failure (guessed by this bot)
[2025-02-01T17:00:38Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2025-02-01T17:00:38Z INFO collector::compile::execute] run_rustc with incremental=false, profile=Debug, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2025-02-01T17:00:38Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpDAhMTw#bitmaps@3.1.0" "--" "--wrap-rustc-with" "Eprintln"
[2025-02-01T17:00:39Z INFO collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
[2025-02-01T17:00:39Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpDAhMTw#bitmaps@3.1.0" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=C:\\a\\_temp\\msys64\\tmp\\.tmpDAhMTw\\incremental-state"
[2025-02-01T17:00:40Z INFO collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrUnchanged), patch=None, backend=Llvm, phase=benchmark
[2025-02-01T17:00:40Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpDAhMTw#bitmaps@3.1.0" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=C:\\a\\_temp\\msys64\\tmp\\.tmpDAhMTw\\incremental-state"
[2025-02-01T17:00:41Z DEBUG collector::compile::benchmark::patch] applying println to "C:\\a\\_temp\\msys64\\tmp\\.tmpDAhMTw"
[2025-02-01T17:00:41Z INFO collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrPatched), patch=Some(Patch { index: 0, name: PatchName("println"), path: "0-println.patch" }), backend=Llvm, phase=benchmark
[2025-02-01T17:00:41Z INFO collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrPatched), patch=Some(Patch { index: 0, name: PatchName("println"), path: "0-println.patch" }), backend=Llvm, phase=benchmark
[2025-02-01T17:00:41Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpDAhMTw#bitmaps@3.1.0" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=C:\\a\\_temp\\msys64\\tmp\\.tmpDAhMTw\\incremental-state"
[2025-02-01T17:00:41Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2025-02-01T17:00:42Z INFO collector::compile::execute] run_rustc with incremental=false, profile=Opt, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2025-02-01T17:00:42Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpdG51Yz#bitmaps@3.1.0" "--release" "--" "--wrap-rustc-with" "Eprintln"
[2025-02-01T17:00:43Z INFO collector::compile::execute] run_rustc with incremental=true, profile=Opt, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
---
[2025-02-01T17:08:26Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2025-02-01T17:08:26Z INFO collector::compile::execute] run_rustc with incremental=false, profile=Opt, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2025-02-01T17:08:26Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpaToiUN#diesel@1.4.8" "--release" "--" "--wrap-rustc-with" "Eprintln"
[2025-02-01T17:08:34Z INFO collector::compile::execute] run_rustc with incremental=true, profile=Opt, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
[2025-02-01T17:08:34Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpaToiUN#diesel@1.4.8" "--release" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=C:\\a\\_temp\\msys64\\tmp\\.tmpaToiUN\\incremental-state"
[2025-02-01T17:08:44Z INFO collector::compile::execute] run_rustc with incremental=true, profile=Opt, scenario=Some(IncrUnchanged), patch=None, backend=Llvm, phase=benchmark
[2025-02-01T17:08:44Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpaToiUN#diesel@1.4.8" "--release" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=C:\\a\\_temp\\msys64\\tmp\\.tmpaToiUN\\incremental-state"
[2025-02-01T17:08:46Z DEBUG collector::compile::benchmark::patch] applying println to "C:\\a\\_temp\\msys64\\tmp\\.tmpaToiUN"
[2025-02-01T17:08:46Z INFO collector::compile::execute] run_rustc with incremental=true, profile=Opt, scenario=Some(IncrPatched), patch=Some(Patch { index: 0, name: PatchName("println"), path: "0-println.patch" }), backend=Llvm, phase=benchmark
[2025-02-01T17:08:46Z INFO collector::compile::execute] run_rustc with incremental=true, profile=Opt, scenario=Some(IncrPatched), patch=Some(Patch { index: 0, name: PatchName("println"), path: "0-println.patch" }), backend=Llvm, phase=benchmark
[2025-02-01T17:08:46Z DEBUG collector::compile::execute] "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///C:/a/_temp/msys64/tmp/.tmpaToiUN#diesel@1.4.8" "--release" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=C:\\a\\_temp\\msys64\\tmp\\.tmpaToiUN\\incremental-state"
Executing benchmark externs (5/8)
Preparing externs
[2025-02-01T17:08:49Z INFO collector::compile::execute] run_rustc with incremental=false, profile=Check, scenario=None, patch=None, backend=Llvm, phase=dependencies
[2025-02-01T17:08:49Z INFO collector::compile::execute] run_rustc with incremental=false, profile=Debug, scenario=None, patch=None, backend=Llvm, phase=dependencies

@bors

bors commented Feb 1, 2025

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@borsbors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 1, 2025
@matthiaskrgr

Copy link
Copy Markdown
MemberAuthor

@bors retry

@borsbors 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. labels Feb 1, 2025
@matthiaskrgrmatthiaskrgr added the CI-spurious-fail-msvc CI spurious failure: target env msvc label Feb 1, 2025
@bors

bors commented Feb 1, 2025

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 2a82ebd with merge 8239a37...

@bors

bors commented Feb 1, 2025

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 8239a37 to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Feb 1, 2025
@bors
bors merged commit 8239a37 into rust-lang:masterFeb 1, 2025
@rustbotrustbot added this to the 1.86.0 milestone Feb 1, 2025
@rust-timer

Copy link
Copy Markdown
Collaborator

📌 Perf builds for each rolled up PR:

PR#MessagePerf Build Sha
#130514Implement MIR lowering for unsafe bindersbe995312299b441ca428237a2b2ba69b769d517e (link)
#135684docs: Documented Send and Sync requirements for Mutex + Mut…150da37e0764c39bc5b965f083a55a21e5f19b10 (link)
#136307Implement all mix/max functions in a (hopefully) more optim…20325765a05dc7b86aeadbd191aa4f4ad76407fb (link)
#136360Stabilize once_wait9264389d35dbaa441c31b3e866dd3ed7c3e671dd (link)
#136364document that ptr cmp is unsignedd38d22f13b2925ba4cc6cbb3c3653779f7d7d781 (link)
#136374Add link attribute for Enzyme's LLVMRust FFI590d9bf4e530bd53d93f53751628d70d78eb6426 (link)

previous master: e08cd3cf05

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (8239a37): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

meanrangecount
Regressions ❌
(primary)
0.1%[0.1%, 0.1%]1
Regressions ❌
(secondary)
0.4%[0.3%, 0.5%]2
Improvements ✅
(primary)
-0.3%[-0.3%, -0.3%]1
Improvements ✅
(secondary)
-0.2%[-0.3%, -0.1%]2
All ❌✅ (primary)-0.1%[-0.3%, 0.1%]2

Max RSS (memory usage)

Results (primary 0.7%, secondary 1.2%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

meanrangecount
Regressions ❌
(primary)
5.5%[4.6%, 6.4%]2
Regressions ❌
(secondary)
5.0%[2.5%, 6.0%]4
Improvements ✅
(primary)
-4.1%[-4.6%, -3.6%]2
Improvements ✅
(secondary)
-1.8%[-2.7%, -1.1%]5
All ❌✅ (primary)0.7%[-4.6%, 6.4%]4

Cycles

Results (primary -5.0%, secondary -1.5%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
2.1%[2.1%, 2.1%]1
Improvements ✅
(primary)
-5.0%[-5.0%, -5.0%]1
Improvements ✅
(secondary)
-5.2%[-5.2%, -5.2%]1
All ❌✅ (primary)-5.0%[-5.0%, -5.0%]1

Binary size

Results (primary -0.0%, secondary -0.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

meanrangecount
Regressions ❌
(primary)
0.2%[0.0%, 0.5%]15
Regressions ❌
(secondary)
0.0%[0.0%, 0.0%]18
Improvements ✅
(primary)
-0.1%[-0.4%, -0.0%]36
Improvements ✅
(secondary)
-0.4%[-0.4%, -0.4%]3
All ❌✅ (primary)-0.0%[-0.4%, 0.5%]51

Bootstrap: 777.851s -> 777.275s (-0.07%)
Artifact size: 328.84 MiB -> 328.69 MiB (-0.05%)

@rustbotrustbot added the perf-regression Performance regression. label Feb 2, 2025
@rylev

rylev commented Feb 5, 2025

Copy link
Copy Markdown
Member

Perf is a wash so I don't think it's worth investigating.

@rustbot label: +perf-regression-triaged

@rustbotrustbot added the perf-regression-triaged The performance regression has been triaged. label Feb 5, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI-spurious-fail-msvcCI spurious failure: target env msvcmerged-by-borsThis PR was explicitly merged by bors.perf-regressionPerformance regression.perf-regression-triagedThe performance regression has been triaged.rollupA PR which is a rollupS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

12 participants

@matthiaskrgr@bors@rust-log-analyzer@rust-timer@rylev@rustbot@WaffleLapkin@compiler-errors@slanterns@saethlin@ranger-ross@hkBst