Skip to content
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

Rollup of 5 pull requests #124241

Merged
merged 20 commits into from
Apr 21, 2024
Merged

Rollup of 5 pull requests #124241

merged 20 commits into from
Apr 21, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

bvanjoi and others added 20 commits April 21, 2024 20:40
…cjgillot

Add an intrinsic for `ptr::from_raw_parts(_mut)`

Fixes rust-lang#123174
cc `@CAD97` `@saethlin`
r? `@cjgillot`

As suggested in rust-lang#123190 (comment), this adds a new `AggregateKind::RawPtr` for creating a pointer from its data pointer and its metadata.

That means that `slice::from_raw_parts` and friends no longer need to hard-code pointer layout into `libcore`, and because it no longer does union hacks the MIR is shorter and more amenable to optimizations.
cleanup: unnecessary clone during lower generics args
…ifest, r=Mark-Simulacrum

Add gnullvm targets to manifest

Fixes an oversight from rust-lang#121712
remove from reviewers

not gonna be around for a few weeks
@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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 Apr 21, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Apr 21, 2024

📌 Commit 3315bf9 has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 21, 2024
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 21, 2024
@bors
Copy link
Contributor

bors commented Apr 21, 2024

⌛ Testing commit 3315bf9 with merge fb89862...

@bors
Copy link
Contributor

bors commented Apr 21, 2024

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 21, 2024
@bors bors merged commit fb89862 into rust-lang:master Apr 21, 2024
13 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 21, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#123840 Add an intrinsic for ptr::from_raw_parts(_mut) 9272ac8b48ff62a4a1cd0c809f2564a260aca0f9 (link)
#124224 cleanup: unnecessary clone during lower generics args 9934077154dde29a2d528fd108b5f4a2d9864d77 (link)
#124229 Add gnullvm targets to manifest c4b2d8b3d548f7da43486a22b791e61badb67d36 (link)
#124231 remove from reviewers 139b2c31eaedae8b394b4c3035f323481f9cbf5f (link)
#124235 Move some tests 998b258e5aa565341bc3de3cc8c4a4e7b01b8b5b (link)

previous master: 1b3fba066c

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
Collaborator

Finished benchmarking commit (fb89862): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

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

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.7% [0.2%, 1.6%] 7
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 1
Improvements ✅
(primary)
-0.9% [-2.8%, -0.3%] 7
Improvements ✅
(secondary)
-3.9% [-3.9%, -3.9%] 1
All ❌✅ (primary) -0.1% [-2.8%, 1.6%] 14

Max RSS (memory usage)

Results

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.

mean range count
Regressions ❌
(primary)
1.8% [0.3%, 3.3%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.9% [-8.8%, -2.3%] 5
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.0% [-8.8%, 3.3%] 7

Cycles

Results

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.

mean range count
Regressions ❌
(primary)
1.2% [0.6%, 1.7%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.5% [-2.9%, -0.8%] 3
Improvements ✅
(secondary)
-3.4% [-3.4%, -3.4%] 1
All ❌✅ (primary) -0.5% [-2.9%, 1.7%] 5

Binary size

Results

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.

mean range count
Regressions ❌
(primary)
0.5% [0.0%, 2.6%] 57
Regressions ❌
(secondary)
0.3% [0.2%, 0.3%] 4
Improvements ✅
(primary)
-0.2% [-0.7%, -0.0%] 26
Improvements ✅
(secondary)
-0.0% [-0.1%, -0.0%] 8
All ❌✅ (primary) 0.3% [-0.7%, 2.6%] 83

Bootstrap: 674.072s -> 671.331s (-0.41%)
Artifact size: 315.57 MiB -> 315.43 MiB (-0.05%)

@rustbot rustbot added the perf-regression Performance regression. label Apr 22, 2024
@Kobzol
Copy link
Contributor

Kobzol commented Apr 22, 2024

@rust-timer build 9272ac8

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (9272ac8): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.8% [0.2%, 1.6%] 9
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 1
Improvements ✅
(primary)
-1.1% [-2.7%, -0.3%] 4
Improvements ✅
(secondary)
-3.5% [-3.5%, -3.5%] 1
All ❌✅ (primary) 0.2% [-2.7%, 1.6%] 13

Max RSS (memory usage)

Results

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.

mean range count
Regressions ❌
(primary)
1.8% [0.3%, 3.0%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-5.0% [-9.0%, -2.6%] 5
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.4% [-9.0%, 3.0%] 8

Cycles

Results

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.

mean range count
Regressions ❌
(primary)
1.0% [0.7%, 1.4%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.8% [-2.8%, -0.8%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.1% [-2.8%, 1.4%] 5

Binary size

Results

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.

mean range count
Regressions ❌
(primary)
0.5% [0.0%, 2.4%] 57
Regressions ❌
(secondary)
0.3% [0.2%, 0.3%] 4
Improvements ✅
(primary)
-0.2% [-0.7%, -0.0%] 26
Improvements ✅
(secondary)
-0.0% [-0.1%, -0.0%] 8
All ❌✅ (primary) 0.3% [-0.7%, 2.4%] 83

Bootstrap: 674.072s -> 673.108s (-0.14%)
Artifact size: 315.57 MiB -> 315.44 MiB (-0.04%)

@rylev
Copy link
Member

rylev commented Apr 23, 2024

@scottmcm @cjgillot it looks like #123840 is the culprit for the regressions here which look significant enough to take a look. Looks like more time is being spent in LLVM than previously.

@scottmcm
Copy link
Member

scottmcm commented Apr 23, 2024

How meaningful are the runtime benchmarks these days? There's three improvements to runtime benchmarks, which would fit with this letting LLVM optimize more, thus also taking more instructions.

The IR we give to LLVM is actually substantially simpler with that PR https://rust.godbolt.org/z/EeT3K9q8M

Before:

%"core::ptr::metadata::PtrComponents<[i32]>" = type { ptr, i64 }
%"core::ptr::metadata::PtrRepr<[i32]>" = type { [2 x i64] }

define { ptr, i64 } @demo(ptr noundef %p, i64 noundef %n) unnamed_addr #0 {
  %_6 = alloca %"core::ptr::metadata::PtrComponents<[i32]>", align 8
  %_5 = alloca %"core::ptr::metadata::PtrRepr<[i32]>", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %_5)
  call void @llvm.lifetime.start.p0(i64 16, ptr %_6)
  store ptr %p, ptr %_6, align 8
  %0 = getelementptr inbounds i8, ptr %_6, i64 8
  store i64 %n, ptr %0, align 8
  %1 = load ptr, ptr %_6, align 8, !noundef !3
  %2 = getelementptr inbounds i8, ptr %_6, i64 8
  %3 = load i64, ptr %2, align 8, !noundef !3
  store ptr %1, ptr %_5, align 8
  %4 = getelementptr inbounds i8, ptr %_5, i64 8
  store i64 %3, ptr %4, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %_6)
  %_3.0 = load ptr, ptr %_5, align 8, !noundef !3
  %5 = getelementptr inbounds i8, ptr %_5, i64 8
  %_3.1 = load i64, ptr %5, align 8, !noundef !3
  call void @llvm.lifetime.end.p0(i64 16, ptr %_5)
  %6 = insertvalue { ptr, i64 } poison, ptr %_3.0, 0
  %7 = insertvalue { ptr, i64 } %6, i64 %_3.1, 1
  ret { ptr, i64 } %7
}

After:

define { ptr, i64 } @demo(ptr noundef %p, i64 noundef %n) unnamed_addr #0 {
start:
  %0 = insertvalue { ptr, i64 } poison, ptr %p, 0
  %1 = insertvalue { ptr, i64 } %0, i64 %n, 1
  ret { ptr, i64 } %1
}

(Godbolt is still on 04-20 nightly at time of posting, so I had to generate that after locally, but the link above should show it soon™.)

@Kobzol
Copy link
Contributor

Kobzol commented Apr 23, 2024

I would believe the runtime instruction counts (not cycles though) results, it looks like a small improvement.

@matthiaskrgr matthiaskrgr deleted the rollup-xhu90xr branch September 1, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.