Skip to content

[libspirv] Align subgroup builtins and generic wrappers with downstream#21437

Open
wenju-he wants to merge 5 commits intointel:syclfrom
wenju-he:libspirv-align-with-downstream
Open

[libspirv] Align subgroup builtins and generic wrappers with downstream#21437
wenju-he wants to merge 5 commits intointel:syclfrom
wenju-he:libspirv-align-with-downstream

Conversation

@wenju-he
Copy link
Contributor

@wenju-he wenju-he commented Mar 4, 2026

Changes

  • use __ATOMIC_SEQ_CST for SequentiallyConsistent semantics mapping.
  • add GroupOperation::ClusteredReduce and the non-uniform overload without ClusterSize.
  • route __spirv_BuiltInSubgroupSize through __clc_get_sub_group_size.
  • delete amdgcn-amdhsa/workitem/get_sub_group_size.cl which is the same as the generic get_sub_group_size.cl.
  • delete private atomic functions. Not supported in SPIR-V spec.
  • clang-format include order.

llvm-diff shows that only __spirv_AtomicFlagClear and __spirv_AtomicFlagTestAndSet
changed in nvptx64-nvidia-cuda/libspirv.bc, with lowering switched from
llvm.nvvm.atomic.exch to atomicrmw xchg. To preserve previous behavior,
we should override __clc_atomic_flag_clear and __clc_atomic_flag_test_and_set
for NVPTX; this is left for future work.

Changes
* use __ATOMIC_SEQ_CST for SequentiallyConsistent semantics mapping.
* add GroupOperation::ClusteredReduce and the non-uniform overload
  without ClusterSize.
* route __spirv_BuiltInSubgroupSize through __clc_get_sub_group_size.
* delete amdgcn-amdhsa/workitem/get_sub_group_size.cl which is the same
  as the generic get_sub_group_size.cl.
* clang-format include order.

llvm-diff shows no change to nvptx64-nvidia-cuda/libspirv.bc.
@wenju-he wenju-he requested a review from a team as a code owner March 4, 2026 07:42
@wenju-he wenju-he requested a review from kekaczma March 4, 2026 07:42
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