From 518b94e8e1a4c9f2772bc4ab7a7b9cd140afbf46 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 7 Jul 2021 14:05:06 +1000 Subject: [PATCH] clover/llvm: turn off optional CL 3 features. We don't support these with clover yet, so turn them off to get clang back to the older llvm 12 behaviour. Reviewed-by: Jesse Natalie Reviewed-by: Karol Herbst Acked-by: Adam Jackson Part-of: --- src/gallium/frontends/clover/llvm/invocation.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp index 30592e4343b..aada225e366 100644 --- a/src/gallium/frontends/clover/llvm/invocation.cpp +++ b/src/gallium/frontends/clover/llvm/invocation.cpp @@ -242,6 +242,17 @@ namespace { c->getTargetOpts().Triple = target.triple; c->getLangOpts().NoBuiltin = true; +#if LLVM_VERSION_MAJOR >= 13 + c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("-__opencl_c_generic_address_space"); + c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("-__opencl_c_pipes"); + c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("-__opencl_c_device_enqueue"); + c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("-__opencl_c_program_scope_global_variables"); + c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("-__opencl_c_subgroups"); + c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("-__opencl_c_work_group_collective_functions"); + c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("-__opencl_c_atomic_scope_device"); + c->getTargetOpts().OpenCLExtensionsAsWritten.push_back("-__opencl_c_atomic_order_seq_cst"); +#endif + // This is a workaround for a Clang bug which causes the number // of warnings and errors to be printed to stderr. // http://www.llvm.org/bugs/show_bug.cgi?id=19735