From: Jason Ekstrand Date: Fri, 14 Aug 2020 20:48:59 +0000 (-0500) Subject: clover: Call clang with -O0 for the SPIR-V path X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=32dc71b23acc996198ecf429018a12326689ae01;p=mesa.git clover: Call clang with -O0 for the SPIR-V path SPIRV-LLVM-Translator isn't really built for handling optimized LLVM IR. It tends to fall over when, for instance, an optimization generates an i96 type which isn't legal in SPIR-V. Pass -O0 to avoid these cases. See https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/203. Reviewed-by: Karol Herbst Part-of: --- diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp index 38070a94e02..a305299f507 100644 --- a/src/gallium/frontends/clover/llvm/invocation.cpp +++ b/src/gallium/frontends/clover/llvm/invocation.cpp @@ -450,7 +450,7 @@ clover::llvm::compile_to_spirv(const std::string &source, "-spir-unknown-unknown" : "-spir64-unknown-unknown"; auto c = create_compiler_instance(dev, target, - tokenize(opts + " input.cl"), r_log); + tokenize(opts + " -O0 input.cl"), r_log); auto mod = compile(*ctx, *c, "input.cl", source, headers, dev, opts, false, r_log);