Skip to content

[MSan] Use vector.reduce.or for >64-bit vector shadows on SPIR/SPIR-V targets#21757

Merged
KornevNikita merged 5 commits intointel:syclfrom
zhaomaosu:msan-fix-large-access
Apr 22, 2026
Merged

[MSan] Use vector.reduce.or for >64-bit vector shadows on SPIR/SPIR-V targets#21757
KornevNikita merged 5 commits intointel:syclfrom
zhaomaosu:msan-fix-large-access

Conversation

@zhaomaosu
Copy link
Copy Markdown
Contributor

When MSan instruments a load of a vector type whose total bit-width exceeds 64 (e.g. <3 x i32> = 96 bits, <4 x i32> = 128 bits), the existing shadow scalar conversion path will emit an instruction like bitcast <3 x i32> %shadow to i96 (or wider). And i96 is only experimentally supported by GPU device.

Fix: detect the SPIR/SPIR-V target and BitWidth > 64 case early emits a legal llvm.vector.reduce.or intrinsic that reduces to i32/i64.

… targets

When MSan instruments a load of a vector type whose total bit-width exceeds
64 (e.g. <3 x i32> = 96 bits, <4 x i32> = 128 bits), the existing shadow
scalar conversion path will emit an instruction like `bitcast <3 x i32> %shadow
to i96` (or wider). And i96 is only experimentally supported by GPU device.

Fix: detect the SPIR/SPIR-V target and BitWidth > 64 case early emits a legal
`llvm.vector.reduce.or` intrinsic that reduces to i32/i64.
@zhaomaosu zhaomaosu requested a review from a team as a code owner April 14, 2026 05:44
@github-actions
Copy link
Copy Markdown
Contributor

@intel/llvm-gatekeepers please consider merging

@zhaomaosu
Copy link
Copy Markdown
Contributor Author

Hi @intel/llvm-gatekeepers, this PR is ready to be merged. Thanks.

@KornevNikita KornevNikita merged commit bde1e99 into intel:sycl Apr 22, 2026
31 checks passed
@zhaomaosu zhaomaosu deleted the msan-fix-large-access branch April 23, 2026 01:46
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.

3 participants