Skip to content

Commit

Permalink
Auto merge of #116510 - scottmcm:no-1-simd-v2, r=compiler-errors
Browse files Browse the repository at this point in the history
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/rust#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`
  • Loading branch information
bors committed Oct 12, 2023
2 parents e087a1d + de4c8fd commit 2e61650
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 2e61650

Please sign in to comment.