- Make the OpenCL Builtin lookup agnostic to programming models
Rename the OpenCL Builtin lookup system to make it agnostic. The Builtin emitter is now outputting the builtin information into a class so that different programming models can be produced and used.
- Add SPIR-V variants of TypeSampledImage as clang builtin type.
This patch adds SPIR-V sampled image types as derivative of the builtin OpenCL Image types. For each OpenCL image type, clang defines a Sampled<image type> variant and lowered as a "spirv.SampledImage.<image>" llvm opaque type.
- Enable SPIR-V builtin lookup
Add flag -fdeclare-spirv-builtins to enable lookup of SPIR-V builtins.
If -fdeclare-spirv-builtins is passed to clang, the compiler will try to lookup for the builtin described in SPIRVBuiltins.td for any match. If a match is found, overloads are build for the match.
This will enforce a stable way to express SPIR-V builtins and make them closer to how the translator mangles them. This will help ensuring builtin for CUDA does not break easily. This will also support any changes suggested by the SPIRV-LLVM people on how to represent builtins.
Define SPIRV_BUILTIN_DECLARATIONS when passing -fdeclare-spirv-builtins to clang.
Added OpenCL SPIR-V extended set builtins bindings and part of the core SPIR-V (mostly missing Images and Pipes)
TODO: Known vendor extensions are not implemented yet.
Signed-off-by: Victor Lomuller <email@example.com>