Uh oh!
There was an error while loading. Please reload this page.
Remove array_zip - #112096
Merged
Merged
Conversation
`[T; N]::zip` is "eager" but most zips are mapped. This causes poor optimization in generated code. This is a fundamental design issue and "zip" is "prime real estate" in terms of function names, so let's free it up again.
Comment on lines
-34
to
-43
| // CHECK-LABEL: @auto_vectorize_array_zip_map | ||
| #[no_mangle] | ||
| pub fn auto_vectorize_array_zip_map(a: [f32; 4], b: [f32; 4]) -> [f32; 4] { | ||
| // CHECK: load <4 x float> | ||
| // CHECK: load <4 x float> | ||
| // CHECK: fadd <4 x float> | ||
| // CHECK: store <4 x float> | ||
| a.zip(b).map(|(a, b)| a + b) | ||
| } |
Member
There was a problem hiding this comment.
I'd like to keep something with extra layers of abstraction here, so how about
Suggested change
| // CHECK-LABEL: @auto_vectorize_array_zip_map | |
| #[no_mangle] | |
| pubfnauto_vectorize_array_zip_map(a:[f32;4],b:[f32;4]) -> [f32;4]{ | |
| // CHECK: load <4 x float> | |
| // CHECK: load <4 x float> | |
| // CHECK: fadd <4 x float> | |
| // CHECK: store <4 x float> | |
| a.zip(b).map(|(a, b)| a + b) | |
| } | |
| // CHECK-LABEL: @auto_vectorize_array_from_fn | |
| #[no_mangle] | |
| pubfnauto_vectorize_array_from_fn(a:[f32;4],b:[f32;4]) -> [f32;4]{ | |
| // CHECK: load <4 x float> | |
| // CHECK: load <4 x float> | |
| // CHECK: fadd <4 x float> | |
| // CHECK: store <4 x float> | |
| std::array::from_fn(|i| a[i] + b[i]) | |
| } |
scottmcm
commented
May 30, 2023
Member
r=me with the codegen test suggested above |
workingjubilee
commented
May 31, 2023
MemberAuthor
@bors r=scottmcm rollup |
bors
commented
May 31, 2023
Collaborator
bors added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 31, 2023
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#112031 (Migrate `item_proc_macro` to Askama) - rust-lang#112053 (Remove `-Zcgu-partitioning-strategy`.) - rust-lang#112069 (offset_of: don't require type to be `Sized`) - rust-lang#112084 (enhancements on build_helper utilization and rustdoc-gui-test) - rust-lang#112096 (Remove array_zip) - rust-lang#112108 (Fix re-export of doc hidden item inside private item not displayed) - rust-lang#112113 (rustdoc: simplify `clean` by removing `FnRetTy`) r? `@ghost` `@rustbot` modify labels: rollup
overvenus added a commit
to overvenus/tikv
that referenced
this pull request
Dec 22, 2023
See rust-lang/rust/pull/112096 Signed-off-by: Neil Shen <overvenus@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[T; N]::zipis "eager" but most zips are mapped. This causes poor optimization in generated code. This is a fundamental design issue and "zip" is "prime real estate" in terms of function names, so let's free it up again.array_zip#80094 (comment)array_zip#80094array::zipin combination witharray::mapoptimises very poorly #103555Could use review to make sure we aren't losing any essential codegen tests.
r? @scottmcm