KhronosGroup / KhronosGroup/SPIRV-LLVM-Translator
SPIR ABI injects OpenCL intrinsics names in global namespace
- Dominant language
- LLVM
- Stars
- 625
- Forks
- 279
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 34
Description
While working on the triSYCL compiler, I have just realized that at some point to generate some SPIR-df code we have to use the SPIR OpenCL intrinsics functions which are just normal C names according to SPIR 2.0 section "1.2 Name mangling" on page 6.
That works for the initial minimum goal of SPIR: supporting OpenCL, but then, what happens if some non-OpenCL code (let us say SYCL or even OpenCL C++ kernel language) is using some user functions with the exact same signature as one of the numerous OpenCL C instrinsic function? :-(
Using SPIR-V from LLVM does not seem to solve this issue since it is basically a translator form SPIR-df LLVM IR to SPIR-V and the clash will happen inside LLVM...
Is it a misinterpretation of the specification by me or we are in trouble...
Contributor guide
Research direction
Start by reading SPIR 2.0 section 1.2, “Name mangling,” and trace how the translator handles SPIR OpenCL intrinsic names in LLVM. Determine whether the reported global-name collision is a specification misinterpretation or an issue requiring a design change; done means reaching a documented conclusion and identifying the affected translation behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100