From 32dc71b23acc996198ecf429018a12326689ae01 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 14 Aug 2020 15:48:59 -0500 Subject: [PATCH] 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: --- src/gallium/frontends/clover/llvm/invocation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.30.2