[libclc] [libclc] Remove bitcode prepare utility from OpenCL library build (PR #174447)
Wenju He via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 5 18:48:00 PST 2026
wenju-he wrote:
> This isn't related to this PR, but can you explain what the difference between the `clc/` and `opencl/` directories are in the project?
OpenCL builtin implementation is moved into clc directory by commit https://github.com/llvm/llvm-project/commit/b2bdd8bd39e90bfe3c66f6d5600468570a77ede6 and motivation is `The goal of this step is to allow additional libraries of builtins that provide entry points (or bindings) that are not written in OpenCL C but still wish to expose OpenCL-compatible builtins.`. Our downstream use this approach to share builtin implementations between OpenCL and SPIR-V builtins. See our libspirv implementation at https://github.com/intel/llvm/tree/sycl/libclc/libspirv. We plan to upstream libspirv to llvm-project in the future.
SPIR-V builtin is representation of SPIR-V instruction in LLVM IR function call: https://github.com/KhronosGroup/SPIRV-LLVM-Translator/blob/main/docs/SPIRVRepresentationInLLVM.rst#spir-v-instructions-mapped-to-llvm-function-calls. It is used in SYCL compiler https://github.com/intel/llvm/blob/2d512becc1d5d0cd78a480f6c01253235dcde8d4/sycl/include/sycl/stl_wrappers/__sycl_cmath_wrapper_impl.hpp#L13 and mlir.
There are also support of SPIR-V builtins in clang https://github.com/llvm/llvm-project/blob/main/clang/lib/Headers/__clang_spirv_builtins.h and llvm https://github.com/llvm/llvm-project/blob/912a68303ceb7ffdfca37758d6ac781536d0a77e/llvm/lib/Target/SPIRV/SPIRVBuiltins.td#L113.
https://github.com/llvm/llvm-project/pull/174447
More information about the cfe-commits
mailing list