[clang] [clang][SPIRV] Add builtin for OpGenericCastToPtrExplicit and its SPIR-V friendly binding (PR #137805)
Farzon Lotfi via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 29 06:48:50 PDT 2025
================
@@ -35,8 +35,10 @@ static constexpr Builtin::Info BuiltinInfos[] = {
static_assert(std::size(BuiltinInfos) == NumBuiltins);
llvm::SmallVector<Builtin::InfosShard>
-SPIRVTargetInfo::getTargetBuiltins() const {
- return {{&BuiltinStrings, BuiltinInfos}};
+BaseSPIRTargetInfo::getTargetBuiltins() const {
+ if (getTriple().isSPIRV())
----------------
farzonl wrote:
if you are using this to extend the builtins to spirv32/spirv64 I have concerns that not all builtins will be valid for those targets. For example `__builtin_spirv_reflect` is only valid when targeting spirv because thats the target that enables GLSL extentions. It is not valid for spirv32/64 because there is no equivalent opencl extention. To expose across all targets without exposing builtins that break could be tricky and might require special codegen to emulate the behavior of other targets. It might be simpler to just do a new tablegen file for spirv32/spriv64.
https://github.com/llvm/llvm-project/pull/137805
More information about the cfe-commits
mailing list