message: Pass setSPIRVAllowUnknownIntrinsicsEnabled to SPIR-V translator (llvm 12.0)
diff: @@ -1149,7 +1149,16 @@ bool Module::translateToSPIRV(llvm::Module *module, std::stringstream &ss) {
  llvm::cl::desc("Allow DWARF operations not listed in the OpenCL.DebugInfo.100 "
  "specification (experimental, may produce incompatible SPIR-V "
  "module)"));
  +#if ISPC_LLVM_VERSION < ISPC_LLVM_12_0
  Opts.setSPIRVAllowUnknownIntrinsics({"llvm.genx"});
  +#else
  + llvm::cl::opt<bool> SPIRVAllowUnknownIntrinsics(
  + "spirv-allow-unknown-intrinsics", llvm::cl::init(true),
  + llvm::cl::desc("Unknown LLVM intrinsics will be translated as external function "
  + "calls in SPIR-V"));
  +
  + Opts.setSPIRVAllowUnknownIntrinsicsEnabled(SPIRVAllowUnknownIntrinsics);
  +#endif
  Opts.setAllowExtraDIExpressionsEnabled(SPIRVAllowExtraDIExpressions);
  Opts.setDesiredBIsRepresentation(SPIRV::BIsRepresentation::SPIRVFriendlyIR);
  Opts.setDebugInfoEIS(SPIRV::DebugInfoEIS::OpenCL_DebugInfo_100);
  