Skip to content

[libspirv][remangler] Remangle pointer address space when target's default addrspace is private #18383

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

Open
wants to merge 2 commits into
base: sycl
Choose a base branch
from

Conversation

wenju-he
Copy link
Contributor

@wenju-he wenju-he commented May 9, 2025

For target where default address space is private, pointer address space mangling in libclc is not compatible with SYCL mangling. Take spir64 target as example,
OpenCL mangling:
_Z17__spirv_ocl_fractfPU3AS4f(float, ptr addrspace(4))
_Z17__spirv_ocl_fractfPf(float, ptr)
SYCL mangling:
_Z17__spirv_ocl_fractfPf(float, ptr addrspace(4))
_Z17__spirv_ocl_fractfPU3AS0f(float, ptr)
This leads to issue when linking libclc built-ins to SYCL device code. This PR fixes the issue by remangling libclc built-ins to align with SYCL: Remangle _Z17__spirv_ocl_fractfPU3AS4f to _Z17__spirv_ocl_fractfPf. Remangle _Z17__spirv_ocl_fractfPf to _Z17__spirv_ocl_fractfPU3AS0f.

Relates to #16703

…fault addrspace is private

For target where default address space is private, pointer address space
mangling in libclc is not compatible with SYCL mangling.
Take spir64 target as example,
OpenCL mangling:
  _Z17__spirv_ocl_fractfPU3AS4f(float, ptr addrspace(4))
  _Z17__spirv_ocl_fractfPf(float, ptr)
SYCL mangling:
  _Z17__spirv_ocl_fractfPf(float, ptr addrspace(4))
  _Z17__spirv_ocl_fractfPU3AS0f(float, ptr)
This leads to issue when linking libclc built-ins to SYCL device code.
This PR fixes the issue by remangling libclc built-ins to align with SYCL:
Remangle _Z17__spirv_ocl_fractfPU3AS4f to _Z17__spirv_ocl_fractfPf.
Remangle _Z17__spirv_ocl_fractfPf to _Z17__spirv_ocl_fractfPU3AS0f.

Relates to intel#16703
@wenju-he wenju-he requested a review from a team as a code owner May 9, 2025 10:34
@wenju-he wenju-he requested a review from npmiller May 9, 2025 10:34
@wenju-he wenju-he temporarily deployed to WindowsCILock May 9, 2025 10:35 — with GitHub Actions Inactive
@wenju-he wenju-he temporarily deployed to WindowsCILock May 9, 2025 11:01 — with GitHub Actions Inactive
@wenju-he wenju-he temporarily deployed to WindowsCILock May 9, 2025 11:01 — with GitHub Actions Inactive
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