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

Copy 1-element arrays as scalars, not vectors #116510

Merged
merged 2 commits into from Oct 12, 2023

Conversation

scottmcm
Copy link
Member

@scottmcm scottmcm commented Oct 7, 2023

For [T; 1] it's silly to copy as <1 x T> when we can just copy as T.

Inspired by #101210 (comment), which pointed out that Option<[u8; 1]> was codegenning worse than Option<u8>.

(I'm not sure why LLVM doesn't optimize out <1 x u8>, but might as well just not emit it in the first place in this codepath.)


I think I bit off too much in #116479; let me try just the scalar case first.

r? @ghost

For `[T; 1]` it's silly to copy as `<1 x T>` when we can just copy as `T`.
@rustbot rustbot 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. labels Oct 7, 2023
@scottmcm
Copy link
Member Author

scottmcm commented Oct 7, 2023

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 7, 2023
@bors
Copy link
Contributor

bors commented Oct 7, 2023

⌛ Trying commit ae9cec5 with merge d52af76...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 7, 2023
Copy 1-element arrays as scalars, not vectors

For `[T; 1]` it's silly to copy as `<1 x T>` when we can just copy as `T`.

Inspired by rust-lang#101210 (comment), which pointed out that `Option<[u8; 1]>` was codegenning worse than `Option<u8>`.

(I'm not sure *why* LLVM doesn't optimize out `<1 x u8>`, but might as well just not emit it in the first place in this codepath.)

---

I think I bit off too much in rust-lang#116479; let me try just the scalar case first.

r? `@ghost`
@bors
Copy link
Contributor

bors commented Oct 7, 2023

☀️ Try build successful - checks-actions
Build commit: d52af76 (d52af767a3aca66205870ea02f2eef7df5561ec2)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d52af76): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-2.6%, -2.2%] 2
All ❌✅ (primary) - - 0

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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-9.8% [-10.0%, -9.6%] 6
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 624.196s -> 623.177s (-0.16%)
Artifact size: 270.66 MiB -> 270.65 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 8, 2023
@scottmcm scottmcm marked this pull request as ready for review October 8, 2023 07:07
@scottmcm
Copy link
Member Author

scottmcm commented Oct 8, 2023

Ok, much better. I'll replace #116479 with this one.

r? @erikdesjardins

@rustbot
Copy link
Collaborator

rustbot commented Oct 8, 2023

Failed to set assignee to erikdesjardins: invalid assignee

Note: Only org members with at least the repository "read" role, users with write permissions, or people who have commented on the PR may be assigned.

@scottmcm
Copy link
Member Author

scottmcm commented Oct 8, 2023

Oops, make that

r? @compiler-errors

@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Oct 12, 2023

📌 Commit ae9cec5 has been approved by compiler-errors

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. labels Oct 12, 2023
@bors
Copy link
Contributor

bors commented Oct 12, 2023

⌛ Testing commit ae9cec5 with merge dbe2d0a...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 12, 2023
…rors

Copy 1-element arrays as scalars, not vectors

For `[T; 1]` it's silly to copy as `<1 x T>` when we can just copy as `T`.

Inspired by rust-lang#101210 (comment), which pointed out that `Option<[u8; 1]>` was codegenning worse than `Option<u8>`.

(I'm not sure *why* LLVM doesn't optimize out `<1 x u8>`, but might as well just not emit it in the first place in this codepath.)

---

I think I bit off too much in rust-lang#116479; let me try just the scalar case first.

r? `@ghost`
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Oct 12, 2023

💔 Test failed - checks-actions

@bors bors 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 Oct 12, 2023
@scottmcm
Copy link
Member Author

@bors r=compiler-errors

@bors
Copy link
Contributor

bors commented Oct 12, 2023

📌 Commit f5cdd3e has been approved by compiler-errors

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. labels Oct 12, 2023
@bors
Copy link
Contributor

bors commented Oct 12, 2023

⌛ Testing commit f5cdd3e with merge df4379b...

@bors
Copy link
Contributor

bors commented Oct 12, 2023

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing df4379b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 12, 2023
@bors bors merged commit df4379b into rust-lang:master Oct 12, 2023
12 checks passed
@rustbot rustbot added this to the 1.75.0 milestone Oct 12, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (df4379b): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.3% [-3.8%, -0.9%] 2
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 626.816s -> 626.794s (-0.00%)
Artifact size: 271.27 MiB -> 271.27 MiB (-0.00%)

bors-ferrocene bot added a commit to ferrocene/ferrocene that referenced this pull request Oct 13, 2023
50: Automated pull from upstream `master` r=Dajamante a=github-actions[bot]


This PR pulls the following changes from the upstream repository:

* rust-lang/rust#116619
* rust-lang/rust#115964
* rust-lang/rust#116391
* rust-lang/rust#116510
* rust-lang/rust#116671
  * rust-lang/rust#116669
  * rust-lang/rust#116654
  * rust-lang/rust#116642
  * rust-lang/rust#116625
  * rust-lang/rust#116593
* rust-lang/rust#116649
* rust-lang/rust#116600
* rust-lang/rust#116628



Co-authored-by: Nadrieril <nadrieril+git@gmail.com>
Co-authored-by: Scott McMurray <scottmcm@users.noreply.github.com>
Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Co-authored-by: Nicholas Nethercote <n.nethercote@gmail.com>
Co-authored-by: Trevor Gross <tmgross@umich.edu>
Co-authored-by: Georg Semmler <github@weiznich.de>
Co-authored-by: Guillaume Gomez <guillaume.gomez@huawei.com>
Co-authored-by: Gurinder Singh <frederick.the.fool@gmail.com>
Co-authored-by: bors <bors@rust-lang.org>
@scottmcm scottmcm deleted the no-1-simd-v2 branch October 14, 2023 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants