Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL] Move GroupNonUniform SPIR-V built-in declarations to clang SPIRVBuiltins.td #17627

Merged

Conversation

wenju-he
Copy link
Contributor

@wenju-he wenju-he commented Mar 25, 2025

This PR changes scope parameter type from enum to int, aligning with SPV-IR. Mangling becomes more portable for targets that bypass SPIR-V.

This PR constrains Id type in GroupNonUniformBroadcast to be either uint32_t or uint64_t.
Following parameter types are constrained to be uint32_t:

  • Index in OpGroupNonUniformBallotBitExtract
  • Id/Mask/Delta in GroupNonUniformShuffle*
  • ClusterSize in GroupNonUniformI*/S*/U*/F*, GroupNonUniformBitwise*, and GroupNonUniformLogical*

The constraints should align with current built-in implementations and SPV-IR.

…RVBuiltins.td

This PR changes scope parameter type from enum to int, aligning with
SPV-IR. Mangling becomes more portable for targets that bypass SPIR-V.

This PR constrains Id or Index type to be either uint32_t or uint64_t.
Copy link
Contributor

@frasercrmck frasercrmck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libclc/libspirv LGTM

def TLFloat : TypeList<[Float, Double, Half]>;
// FIXME: handle properly char (signed or unsigned depending on host)
def TLSignedInts : TypeList<[Char, Short, Int, Long]>;
def TLUnsignedInts : TypeList<[UChar, UShort, UInt, ULong]>;
def TLUnsignedIntLong : TypeList<[UInt, ULong]>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this should be UIntULong? Just because UnsignedInt seems to be used above as the descriptive collection of unsigned integers, as opposed to the specific UInt type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TLUnsignedIntLong is removed in 4155e54
[UInt, ULong] is now not only used for Id type in GroupNonUniformBroadcast. ULong is no longer used for Delta/ClusterSize/Index parameters.
So I changed GroupNonUniformBroadcast to use [UInt, ULong] directly instead of adding TLUnsignedIntLong.

…p ULong for Id type in GroupNonUniformBroadcast
@wenju-he
Copy link
Contributor Author

kindly ping @llvm-reviewers-runtime @KseniyaTikhomirova for review

Copy link
Contributor

@KseniyaTikhomirova KseniyaTikhomirova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/sycl LGTM

@wenju-he
Copy link
Contributor Author

@intel/llvm-gatekeepers please merge, thanks

@uditagarwal97 uditagarwal97 merged commit c040f9a into intel:sycl Mar 28, 2025
33 of 34 checks passed
@wenju-he wenju-he deleted the move-GroupNonUniform-to-SPIRVBuiltins.td branch March 28, 2025 04:38
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.

6 participants