Repository navigation
[SLP]Fix detection of matching splat vector (backport to 20.x) - #70
Merged
vchuravy merged 1 commit intoDec 4, 2026
Merged
Conversation
Need to check, that the mask of the potentially matching splat node is not less defined than the requested mask to avoid poison propagation and incorrect code. Fixes llvm#135113 (cherry picked from commit 4ea57b3) [Backport: the regression test does not exist on this branch (upstream added it separately in 396e2ef), so the whole file is added here in its post-fix form.] Assisted-by: Claude Code (Claude Fable 5)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of llvm/llvm-project@4ea57b3 (fixes llvm#135113) to
julia-release/20.x.When SLP emits a zero-element splat it may reuse an existing splat shuffle of the same width. It only checked that both were zero-element splats, not that the existing one defines every lane the requested mask needs. A 3-lane splat padded to 4 lanes (
<0, 0, 0, poison>) could therefore be reused where all 4 lanes are live, propagating poison into the result.This is the cause of the wrong floating-point results on Julia 1.13 reported in JuliaLang/julia#65136. Running
opt -passes=slp-vectorizeron the pre-SLP IR of that reproducer shows the bad splat with LLVM 20.1.2 and 20.1.8, and not with 19.1.7, 21.1.8 or 22.1.8. The fix is inrelease/21.xand later but was never backported torelease/20.x.The source change applied cleanly. The regression test does not exist on this branch (upstream added it separately in llvm/llvm-project@396e2ef3b7f4), so the whole file is added here in its post-fix form.
Not yet verified: I have not finished building this branch, so the test's CHECK lines (generated against
mainat the time) have not been run against 20.x, and the Julia reproducer has not been re-run with the patched LLVM.After merging, this needs a new
julia-20.1.8-*tag and an LLVM bump on Juliarelease-1.13.This backport and description were prepared with Claude Code; the human author has not yet read or reviewed them.
🤖 Generated with Claude Code