Cherry-pick to main: Fix use-of-uninitialized-value in SVE accumulator operations (#18)#25
Closed
Cherry-pick to main: Fix use-of-uninitialized-value in SVE accumulator operations (#18)#25
Conversation
Use `_m` (merge) instead of `_x` (don't-care) for SVE multiply-accumulate operations on accumulator vectors. The `_x` variant leaves inactive lanes undefined, but the final `svaddv` with `svptrue` sums all lanes including those undefined ones, causing MemorySanitizer to report use-of-uninitialized-value when vector length is not a multiple of the SVE register width. The `_m` variant preserves the accumulator value for inactive lanes, keeping them at their initialized zero. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> (cherry picked from commit 5a0677a)
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.
This is a cherry-pick of #18 to branch main
Use
_m(merge) instead of_x(don't-care) for SVE multiply-accumulate operations on accumulator vectors. The_xvariant leaves inactive lanes undefined, but the finalsvaddvwithsvptruesums all lanes including those undefined ones, causing MemorySanitizer to report use-of-uninitialized-value when vector length is not a multiple of the SVE register width. The_mvariant preserves the accumulator value for inactive lanes, keeping them at their initialized zero.(cherry picked from commit 5a0677a)