[clang][SPIRV] Add builtin for OpGenericCastToPtrExplicit and its SPIR-V friendly binding (#137805)

The patch introduce __builtin_spirv_generic_cast_to_ptr_explicit which
is lowered to the llvm.spv.generic.cast.to.ptr.explicit intrinsic.

The SPIR-V builtins are now split into 3 differents file:
BuiltinsSPIRVCore.td,
BuiltinsSPIRVVK.td for Vulkan specific builtins, BuiltinsSPIRVCL.td for
OpenCL specific builtins
and BuiltinsSPIRVCommon.td for common ones.

The patch also introduces a new header defining its SPIR-V friendly
equivalent (__spirv_GenericCastToPtrExplicit_ToGlobal,
__spirv_GenericCastToPtrExplicit_ToLocal and
__spirv_GenericCastToPtrExplicit_ToPrivate). The functions are declared
as aliases to the new builtin allowing C-like languages to have a
definition to rely on as well as gaining proper front-end diagnostics.

The motivation for the header is to provide a stable binding for
applications or library (such as SYCL) and allows non SPIR-V targets to
provide an implementation (via libclc or similar to how it is done for
gpuintrin.h).

GitOrigin-RevId: c474f8f2404dfe5a902cdf93d678a0bfe8cc8f44
24 files changed
tree: d7cc7b7b0e661917a8e3e741c42def252445c8ef
  1. bindings/
  2. cmake/
  3. docs/
  4. examples/
  5. include/
  6. lib/
  7. runtime/
  8. test/
  9. tools/
  10. unittests/
  11. utils/
  12. www/
  13. .clang-format
  14. .clang-tidy
  15. .gitignore
  16. AreaTeamMembers.txt
  17. CMakeLists.txt
  18. INSTALL.txt
  19. LICENSE.TXT
  20. Maintainers.rst
  21. NOTES.txt
  22. README.md
README.md

C language Family Front-end

Welcome to Clang.

This is a compiler front-end for the C family of languages (C, C++ and Objective-C) which is built as part of the LLVM compiler infrastructure project.

Unlike many other compiler frontends, Clang is useful for a number of things beyond just compiling code: we intend for Clang to be host to a number of different source-level tools. One example of this is the Clang Static Analyzer.

If you're interested in more (including how to build Clang) it is best to read the relevant websites. Here are some pointers: