================
@@ -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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to