Skip to content

scalable vecs size incl. num vecs + no sret for scalable vecs#157915

Open
davidtwco wants to merge 2 commits into
rust-lang:mainfrom
davidtwco:scalable-vector-size-w-num-vectors
Open

scalable vecs size incl. num vecs + no sret for scalable vecs#157915
davidtwco wants to merge 2 commits into
rust-lang:mainfrom
davidtwco:scalable-vector-size-w-num-vectors

Conversation

@davidtwco

Copy link
Copy Markdown
Member

The correct size for Layout of a scalable vector ought to include the number of vectors, otherwise we generate memcpy that do not copy the entire vector and things like that. This is tested in ui/scalable-vectors/layout.rs.

Additionally, rustc typically uses a return area pointer if the size of a return value is larger than two pointers, except for SIMD vectors and now scalable vectors. Given the previous change, scalable types are more likely to trigger this conditional than previously. This is already tested in the output of the codegen-llvm/scalable-vectors/tuple-intrinsics.rs test.

r? @lqd

@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 Jun 15, 2026

@lqd lqd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. r=me when green

View changes since this review

@rust-log-analyzer

This comment has been minimized.

The correct size for `Layout` of a scalable vector ought to include the
number of vectors, otherwise we generate `memcpy` that do not copy the
entire vector and things like that.
rustc typically uses a return area pointer if the size of a return value
is larger than two pointers, except for SIMD vectors and now scalable
vectors. Given the previous commit, scalable types are more likely to
trigger this conditional than previously. This is already tested in the
output of the `codegen-llvm/scalable-vectors/tuple-intrinsics.rs` test.
@davidtwco davidtwco force-pushed the scalable-vector-size-w-num-vectors branch from e7a57aa to 07d3384 Compare June 15, 2026 13:14
@davidtwco

Copy link
Copy Markdown
Member Author

@bors r=lqd rollup

@rust-bors

rust-bors Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 07d3384 has been approved by lqd

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

4 participants