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

__spirv_GenericCastToPtrExplicit_To* builtin, used in sycl header, has wrong mangled name for spir64 target #16703

Open
wenju-he opened this issue Jan 21, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@wenju-he
Copy link
Contributor

Describe the bug

When test sycl_cts/address_space_core is compiled with spir64 target, __spirv_GenericCastToPtrExplicit_ToPrivate builtin in device code is mangled as

declare dso_local spir_func noundef ptr @_Z42__spirv_GenericCastToPtrExplicit_ToPrivatePvi(ptr addrspace(4) noundef, i32 noundef) 

However, the correct mangled name should be _Z42__spirv_GenericCastToPtrExplicit_ToPrivatePU3AS4vi
This is causing name mismatch if a variant of libclc libspirv that also use 4 as generic addrspace is linked to the device code via -mlink-builtin-bitcode option before llvm-link step.
Please advise if this issue should be fixed in SYCL FE.

-fsycl-targets=amdgcn-amd-amdhsa and -fsycl-targets=nvptx64-nvidia-cuda don't have this issue because their flat address space is 0.

To reproduce

  1. checkout test code https://github.com/KhronosGroup/SYCL-CTS/blob/main/tests/address_space/address_space_core.cpp
  2. compile the test and dump device code before llvm-link step.
clang++ -fsycl ./tests/address_space/address_space_core.cpp -I./vendor/Catch2/src/catch2/.. -I./build/vendor/Catch2/generated-includes

Environment

Additional context

No response

@wenju-he wenju-he added the bug Something isn't working label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant