Skip to content

Cherry-pick to main: Fix use-of-uninitialized-value in SVE accumulator operations (#18)#25

Closed
vitlibar wants to merge 1 commit intomainfrom
cherry-pick-fix-sve-msan-uninitialized
Closed

Cherry-pick to main: Fix use-of-uninitialized-value in SVE accumulator operations (#18)#25
vitlibar wants to merge 1 commit intomainfrom
cherry-pick-fix-sve-msan-uninitialized

Conversation

@vitlibar
Copy link
Copy Markdown
Member

@vitlibar vitlibar commented Apr 8, 2026

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

(cherry picked from commit 5a0677a)

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)
@vitlibar vitlibar closed this Apr 8, 2026
@vitlibar vitlibar deleted the cherry-pick-fix-sve-msan-uninitialized branch April 8, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants