[clang] [clang][SPIRV] Add builtin for OpGenericCastToPtrExplicit and its SPIR-V friendly binding (PR #137805)
Victor Lomuller via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 29 08:46:54 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())
+ return {{&BuiltinStrings, BuiltinInfos}};
----------------
Naghasan wrote:
> What if we had a BuiltinsSPIRVCore.td BuiltinsSPIRVVK.td and a BuiltinsSPIRVCL.td
I was looking into doing this.
> You won't have an unknown builtin if we do it this way because we would never expose the builtins that aren't valid for the target.
You will if you use a VK one when targeting `spirv64` rather than a clear message. But it is nitpicking and I only have a weak preference on the matter.
https://github.com/llvm/llvm-project/pull/137805
More information about the cfe-commits
mailing list