Skip to content

x86 (32/64): go back to passing SIMD vectors by-ptr #141309

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented May 20, 2025

Fixes #139029 by partially reverting #135408 and going back to passing SIMD vectors by-ptr on x86. Sadly, by-val confuses the LLVM inliner so much that it's not worth it...

Also fixes #141848 by no longer actually using vector registers with the "Rust" ABI.

r? @tgross35
Cc @nikic

try-job: test-various*
try-job: dist-i586-gnu-i586-i686-musl
try-job: x86_64-gnu-nopt
try-job: x86_64-msvc*
try-job: i686-msvc*

@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 May 20, 2025
@RalfJung
Copy link
Member Author

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request May 20, 2025
x86 (32/64): go back to passing SIMD vectors by-ptr

Fixes rust-lang#139029 by partially reverting rust-lang#135408 and going back to passing SIMD vectors by-ptr on x86. Sadly, by-val confuses the LLVM inliner so much that it's not worth it...

r? `@tgross35`
Cc `@nikic`

try-job: `test-various*`
try-job: x86_64-gnu-nopt
try-job: dist-i586-gnu-i586-i686-musl
try-job: x86_64-msvc-1
@bors
Copy link
Collaborator

bors commented May 20, 2025

⌛ Trying commit 436f812 with merge 11be405...

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

The code changes LGTM assuming the try job passes. However, I think it's worth waiting until 1-2 more people weigh in and agree this is worth a revert.

@bors
Copy link
Collaborator

bors commented May 20, 2025

☀️ Try build successful - checks-actions
Build commit: 11be405 (11be4058a43b716323bc6c2f5987d03a309c6d2c)

Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

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

Agree that we should go back to the old ABI for now. Can always switch back after the LLVM issue is fixed.

@RalfJung
Copy link
Member Author

Is there an LLVM issue we can reference?

@RalfJung
Copy link
Member Author

RalfJung commented Jun 1, 2025

However, I think it's worth waiting until 1-2 more people weigh in and agree this is worth a revert.

We got @nikic's +1. Anyone else we should ask?

FWIW this will also help with #141848: for people that disable SSE on an i686 target, the lint at #116558 (hard error on nightly and beta) can actually trigger for "Rust" ABI functions. We don't actually support such configurations, but we did not intent for them to become a hard error so quickly either.

@rust-log-analyzer

This comment has been minimized.

@RalfJung
Copy link
Member Author

RalfJung commented Jun 1, 2025

(That's rust-lang/miri#4367)

@RalfJung
Copy link
Member Author

RalfJung commented Jun 1, 2025

We may even consider backporting this, to avoid Rust 1.88 being the only release where a "Rust" ABI function with a by-value SIMD vector on an i686 target modified to disable SSE causes a hard error. (That's not a configuration we intend to support, but it wasn't really meant to hard-error quite so quickly.) See #141848 for context.

@RalfJung RalfJung added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jun 1, 2025
@tgross35
Copy link
Contributor

tgross35 commented Jun 1, 2025

We got @nikic's +1. Anyone else we should ask?

I think it's fine to merge with the CI fix 👍 a few other people have looked at this and upvoted the backport, so seems like there's more consensus there anyway.

@RalfJung
Copy link
Member Author

RalfJung commented Jun 1, 2025 via email

@tgross35
Copy link
Contributor

tgross35 commented Jun 1, 2025

Oops I missed that the linked Miri issue has since been fixed.

@tgross35
Copy link
Contributor

tgross35 commented Jun 1, 2025

(mistyped the bors command)

@bors r=tgross35,nikic

@bors
Copy link
Collaborator

bors commented Jun 1, 2025

📌 Commit a4d314f has been approved by tgross35,nikic

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 Jun 1, 2025
@workingjubilee
Copy link
Member

lgtm

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 2, 2025
…nikic

x86 (32/64): go back to passing SIMD vectors by-ptr

Fixes rust-lang#139029 by partially reverting rust-lang#135408 and going back to passing SIMD vectors by-ptr on x86. Sadly, by-val confuses the LLVM inliner so much that it's not worth it...

Also fixes rust-lang#141848 by no longer actually using vector registers with the "Rust" ABI.

r? `@tgross35`
Cc `@nikic`

try-job: `test-various*`
try-job: x86_64-gnu-nopt
try-job: dist-i586-gnu-i586-i686-musl
try-job: x86_64-msvc-1
bors added a commit that referenced this pull request Jun 2, 2025
Rollup of 6 pull requests

Successful merges:

 - #140715 (Clarify &mut-methods' docs on sync::OnceLock)
 - #141309 (x86 (32/64): go back to passing SIMD vectors by-ptr)
 - #141677 (Async drop - type instead of async drop fn, fixes #140484)
 - #141733 (C-variadic functions must be unsafe)
 - #141858 (Fix typo in `StructuralPartialEq` docs)
 - #141874 (add f16_epsilon and f128_epsilon diagnostic items)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 2, 2025
@RalfJung
Copy link
Member Author

RalfJung commented Jun 2, 2025 via email

@RalfJung RalfJung force-pushed the x86-simd-abi branch 2 times, most recently from e39a075 to ca94292 Compare June 3, 2025 06:39
@RalfJung
Copy link
Member Author

RalfJung commented Jun 3, 2025

Ah, due to #139261 we can't do a full revert of that test -- the alignment is capped at 4 on 32bit MSVC targets. It's probably fine to skip the test there as the Rust ABI is the same across targets (in terms of the LLVM IR we generate) so having the test covered on Linux and macOS is enough.

@bors2 try

@rust-bors
Copy link

rust-bors bot commented Jun 3, 2025

⌛ Trying commit ca94292 with merge 7041e19

rust-bors bot added a commit that referenced this pull request Jun 3, 2025
x86 (32/64): go back to passing SIMD vectors by-ptr

Fixes #139029 by partially reverting #135408 and going back to passing SIMD vectors by-ptr on x86. Sadly, by-val confuses the LLVM inliner so much that it's not worth it...

Also fixes #141848 by no longer actually using vector registers with the "Rust" ABI.

r? `@tgross35`
Cc `@nikic`

try-job: `test-various*`
try-job: dist-i586-gnu-i586-i686-musl
try-job: `x86_64-*`
try-job: `i686-*`
@rust-bors
Copy link

rust-bors bot commented Jun 3, 2025

💔 Test failed

@RalfJung
Copy link
Member Author

RalfJung commented Jun 3, 2025

@bors try

@bors
Copy link
Collaborator

bors commented Jun 3, 2025

⌛ Trying commit ca94292 with merge 702444e...

bors added a commit that referenced this pull request Jun 3, 2025
x86 (32/64): go back to passing SIMD vectors by-ptr

Fixes #139029 by partially reverting #135408 and going back to passing SIMD vectors by-ptr on x86. Sadly, by-val confuses the LLVM inliner so much that it's not worth it...

Also fixes #141848 by no longer actually using vector registers with the "Rust" ABI.

r? `@tgross35`
Cc `@nikic`

try-job: `test-various*`
try-job: dist-i586-gnu-i586-i686-musl
try-job: `x86_64-*`
try-job: `i686-msvc*`
@rust-log-analyzer

This comment has been minimized.

@RalfJung
Copy link
Member Author

RalfJung commented Jun 3, 2025

@bors2 try

@rust-bors
Copy link

rust-bors bot commented Jun 3, 2025

⌛ Trying commit ca94292 with merge 80aa953

rust-bors bot added a commit that referenced this pull request Jun 3, 2025
x86 (32/64): go back to passing SIMD vectors by-ptr

Fixes #139029 by partially reverting #135408 and going back to passing SIMD vectors by-ptr on x86. Sadly, by-val confuses the LLVM inliner so much that it's not worth it...

Also fixes #141848 by no longer actually using vector registers with the "Rust" ABI.

r? `@tgross35`
Cc `@nikic`

try-job: `test-various*`
try-job: dist-i586-gnu-i586-i686-musl
try-job: x86_64-gnu-nopt
try-job: `x86_64-msvc*`
try-job: `i686-msvc*`
@rust-bors
Copy link

rust-bors bot commented Jun 3, 2025

☀️ Try build successful (CI)
Build commit: 80aa953 (80aa953195c10278eb0af59ccd2a0383e126e497)

@RalfJung
Copy link
Member Author

RalfJung commented Jun 3, 2025

@bors r=tgross35,nikic,workingjubilee

@bors
Copy link
Collaborator

bors commented Jun 3, 2025

📌 Commit ca94292 has been approved by tgross35,nikic,workingjubilee

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 3, 2025
@bors
Copy link
Collaborator

bors commented Jun 4, 2025

☔ The latest upstream changes (presumably #141984) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 4, 2025
@RalfJung
Copy link
Member Author

RalfJung commented Jun 4, 2025

@bors r=tgross35,nikic,workingjubilee p=1

@bors
Copy link
Collaborator

bors commented Jun 4, 2025

📌 Commit f01bbfc has been approved by tgross35,nikic,workingjubilee

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-nominated Nominated for backporting to the compiler in the beta channel. 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
8 participants