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
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.

4 participants