-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Conversation
For `[T; 1]` it's silly to copy as `<1 x T>` when we can just copy as `T`.
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
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`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (d52af76): comparison URL. Overall result: no relevant changes - no action neededBenchmarking 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 Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 624.196s -> 623.177s (-0.16%) |
Ok, much better. I'll replace #116479 with this one. |
Failed to set assignee to
|
Oops, make that |
@bors r+ |
…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`
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
@bors r=compiler-errors |
☀️ Test successful - checks-actions |
Finished benchmarking commit (df4379b): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis 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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 626.816s -> 626.794s (-0.00%) |
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 <[email protected]> Co-authored-by: Scott McMurray <[email protected]> Co-authored-by: bjorn3 <[email protected]> Co-authored-by: Nicholas Nethercote <[email protected]> Co-authored-by: Trevor Gross <[email protected]> Co-authored-by: Georg Semmler <[email protected]> Co-authored-by: Guillaume Gomez <[email protected]> Co-authored-by: Gurinder Singh <[email protected]> Co-authored-by: bors <[email protected]>
For
[T; 1]
it's silly to copy as<1 x T>
when we can just copy asT
.Inspired by #101210 (comment), which pointed out that
Option<[u8; 1]>
was codegenning worse thanOption<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