[clang] [SPIR-V] Add clang builtin for subgroup shuffles (PR #174655)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 8 10:18:24 PST 2026


farzonl wrote:

> Random question, why are the intrinsics called `spv.wave` when the spec seems to use `subgroup`? I wasn't sure if I should keep that convention or change it in #174862

> More importantly the intrinsic toggling we are doing is very basic between DirectX and SPIRV so the intrinsic names need to match.

It mostly became this way because when we started spirv in the frontend wasn't a thing yet.

It doesn't have to stay this way in `clang/lib/CodeGen/CGHLSLRuntime.h` there is a macro `GENERATE_HLSL_INTRINSIC_FUNCTION` we could make a `GENERATE_HLSL_INTRINSIC_FUNCTION_DEFAULT` that uses the same `IntrinsicPostfix` name for both spirv and directx but then for these cases where we want some intrinsics to be subgroup vs wave we have `GENERATE_HLSL_INTRINSIC_FUNCTION` a spvPostfix adn dxpostfix name.

https://github.com/llvm/llvm-project/pull/174655


More information about the cfe-commits mailing list