Skip to content

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

Open
zhaomaosu wants to merge 1 commit intointel:syclfrom
zhaomaosu:msan-fix-large-access
Open

[MSan] Use vector.reduce.or for >64-bit vector shadows on SPIR/SPIR-V targets#21757
zhaomaosu wants to merge 1 commit 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
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.

1 participant