Skip to content

llvm: Use correct type for splat mask#156202

Open
maurer wants to merge 1 commit intorust-lang:mainfrom
maurer:splat
Open

llvm: Use correct type for splat mask#156202
maurer wants to merge 1 commit intorust-lang:mainfrom
maurer:splat

Conversation

@maurer
Copy link
Copy Markdown
Contributor

@maurer maurer commented May 5, 2026

After llvm/llvm-project#195486 , LLVM has explicit handling for null pointers in simd operations instead of using special handling based on zeroes.

This causes LLVM with asserts enabled to detect an improperly typed mask passed to splat (if the output vector does not have i32 elements), and can cause SIGSEGV in more complex cases with asserts disabled.

@rustbot label: +llvm-main

r? @durin42

After llvm/llvm-project#195486 , LLVM has explicit handling for null
pointers in simd operations instead of using special handling based on
zeroes.

This causes LLVM with asserts enabled to detect an improperly typed mask
passed to splat (if the output vector does not have i32 elements), and
can cause SIGSEGV in more complex cases with asserts disabled.
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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. llvm-main Marks PRs that are making Rust work with LLVM main (this label is consumed by CI tooling) labels May 5, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 5, 2026

⚠️ Warning ⚠️

  • There are issue links (such as #123) in the commit messages of the following commits.
    Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtree.

@nikic
Copy link
Copy Markdown
Contributor

nikic commented May 6, 2026

@bors r+ rollup

So previously this ended up creating a shuffle mask like <ptr null, ptr null, ...> and we got away with this because LLVM internally doesn't actually store shuffle masks as constants and the code happened to not care that this the all-zero value had the wrong type.

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 6, 2026

📌 Commit 3c83d3a has been approved by nikic

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 May 6, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 6, 2026
llvm: Use correct type for splat mask

After llvm/llvm-project#195486 , LLVM has explicit handling for null pointers in simd operations instead of using special handling based on zeroes.

This causes LLVM with asserts enabled to detect an improperly typed mask passed to splat (if the output vector does not have i32 elements), and can cause SIGSEGV in more complex cases with asserts disabled.

@rustbot label: +llvm-main

r? @durin42
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 6, 2026
llvm: Use correct type for splat mask

After llvm/llvm-project#195486 , LLVM has explicit handling for null pointers in simd operations instead of using special handling based on zeroes.

This causes LLVM with asserts enabled to detect an improperly typed mask passed to splat (if the output vector does not have i32 elements), and can cause SIGSEGV in more complex cases with asserts disabled.

@rustbot label: +llvm-main

r? @durin42
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 6, 2026
llvm: Use correct type for splat mask

After llvm/llvm-project#195486 , LLVM has explicit handling for null pointers in simd operations instead of using special handling based on zeroes.

This causes LLVM with asserts enabled to detect an improperly typed mask passed to splat (if the output vector does not have i32 elements), and can cause SIGSEGV in more complex cases with asserts disabled.

@rustbot label: +llvm-main

r? @durin42
rust-bors Bot pushed a commit that referenced this pull request May 6, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #146273 (lint ImproperCTypes: refactor linting architecture (part 2))
 - #156173 (Fewer global node_id_to_def_id lookups)
 - #155961 (Deny warnings in the test for crates that are available on stable)
 - #156130 (Fold/visit tweaks)
 - #156131 (Metadata macro/query cleanups)
 - #156141 (Resolve some cases of #132279 by using the right typing mode in the next solver)
 - #156202 (llvm: Use correct type for splat mask)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 6, 2026
llvm: Use correct type for splat mask

After llvm/llvm-project#195486 , LLVM has explicit handling for null pointers in simd operations instead of using special handling based on zeroes.

This causes LLVM with asserts enabled to detect an improperly typed mask passed to splat (if the output vector does not have i32 elements), and can cause SIGSEGV in more complex cases with asserts disabled.

@rustbot label: +llvm-main

r? @durin42
rust-bors Bot pushed a commit that referenced this pull request May 6, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #146273 (lint ImproperCTypes: refactor linting architecture (part 2))
 - #149509 (Lint unused pub items in binary crates)
 - #156173 (Fewer global node_id_to_def_id lookups)
 - #155961 (Deny warnings in the test for crates that are available on stable)
 - #156130 (Fold/visit tweaks)
 - #156131 (Metadata macro/query cleanups)
 - #156202 (llvm: Use correct type for splat mask)

Failed merges:

 - #156236 (resolve: Remove `MacroData`)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 6, 2026
llvm: Use correct type for splat mask

After llvm/llvm-project#195486 , LLVM has explicit handling for null pointers in simd operations instead of using special handling based on zeroes.

This causes LLVM with asserts enabled to detect an improperly typed mask passed to splat (if the output vector does not have i32 elements), and can cause SIGSEGV in more complex cases with asserts disabled.

@rustbot label: +llvm-main

r? @durin42
rust-bors Bot pushed a commit that referenced this pull request May 6, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #156061 (Support `-Cpanic=unwind` on WASI targets)
 - #146273 (lint ImproperCTypes: refactor linting architecture (part 2))
 - #149509 (Lint unused pub items in binary crates)
 - #156173 (Fewer global node_id_to_def_id lookups)
 - #155961 (Deny warnings in the test for crates that are available on stable)
 - #155981 (Use special DefIds for aliases)
 - #156130 (Fold/visit tweaks)
 - #156131 (Metadata macro/query cleanups)
 - #156202 (llvm: Use correct type for splat mask)

Failed merges:

 - #156236 (resolve: Remove `MacroData`)
@jhpratt
Copy link
Copy Markdown
Member

jhpratt commented May 7, 2026

@bors r-

#156254 (comment)

@rust-bors rust-bors Bot 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 May 7, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 7, 2026

This pull request was unapproved.

This PR was contained in a rollup (#156254), which was unapproved.

View changes since this unapproval

@maurer
Copy link
Copy Markdown
Contributor Author

maurer commented May 7, 2026

@jhpratt Can you explain how this change could be connected to the wasi failure in the tests?

This change adjusts how simd is done. The wasi failure has no vectorized IR as far as I can see?

@jhpratt
Copy link
Copy Markdown
Member

jhpratt commented May 7, 2026

I skimmed over the list of PRs included too quickly, believing that this was the only one connected to LLVM. #156061 is a much more likely candidate given exception handling.

Thanks for the callout! Re-approving

@bors r=nikic

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 7, 2026

📌 Commit 3c83d3a has been approved by nikic

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 7, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request May 7, 2026
llvm: Use correct type for splat mask

After llvm/llvm-project#195486 , LLVM has explicit handling for null pointers in simd operations instead of using special handling based on zeroes.

This causes LLVM with asserts enabled to detect an improperly typed mask passed to splat (if the output vector does not have i32 elements), and can cause SIGSEGV in more complex cases with asserts disabled.

@rustbot label: +llvm-main

r? @durin42
@maurer
Copy link
Copy Markdown
Contributor Author

maurer commented May 7, 2026

Thanks! Good luck with the merge queue.

jhpratt added a commit to jhpratt/rust that referenced this pull request May 7, 2026
llvm: Use correct type for splat mask

After llvm/llvm-project#195486 , LLVM has explicit handling for null pointers in simd operations instead of using special handling based on zeroes.

This causes LLVM with asserts enabled to detect an improperly typed mask passed to splat (if the output vector does not have i32 elements), and can cause SIGSEGV in more complex cases with asserts disabled.

@rustbot label: +llvm-main

r? @durin42
rust-bors Bot pushed a commit that referenced this pull request May 7, 2026
Rollup of 14 pull requests

Successful merges:

 - #146273 (lint ImproperCTypes: refactor linting architecture (part 2))
 - #149509 (Lint unused pub items in binary crates)
 - #156173 (Fewer global node_id_to_def_id lookups)
 - #156177 (windows/time: avoid being too close to 0)
 - #155961 (Deny warnings in the test for crates that are available on stable)
 - #155981 (Use special DefIds for aliases)
 - #156109 (Migrate libraries from ptr::slice_from_raw_parts to .cast_slice)
 - #156130 (Fold/visit tweaks)
 - #156131 (Metadata macro/query cleanups)
 - #156202 (llvm: Use correct type for splat mask)
 - #156227 (Add Trusty OS to the generic error implementation.)
 - #156237 (compiletest: prevent directives from having multiple revisions)
 - #156241 (Move tests coercion)
 - #156258 (Document wasi-sdk minimum versions for WASI targets)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. llvm-main Marks PRs that are making Rust work with LLVM main (this label is consumed by CI tooling) 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.

5 participants