Skip to content

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

Merged
uditagarwal97 merged 5 commits intointel:syclfrom
wenju-he:libspirv-align-with-downstream
Mar 17, 2026
Merged

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

Conversation

@wenju-he
Copy link
Copy Markdown
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
@github-actions
Copy link
Copy Markdown
Contributor

@intel/llvm-gatekeepers please consider merging

2 similar comments
@github-actions
Copy link
Copy Markdown
Contributor

@intel/llvm-gatekeepers please consider merging

@github-actions
Copy link
Copy Markdown
Contributor

@intel/llvm-gatekeepers please consider merging

@wenju-he
Copy link
Copy Markdown
Contributor Author

@intel/llvm-gatekeepers please merge, thanks

@uditagarwal97 uditagarwal97 merged commit 01d0252 into intel:sycl Mar 17, 2026
46 of 47 checks passed
@wenju-he wenju-he deleted the libspirv-align-with-downstream branch March 17, 2026 05:20
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