SPIR-V In GCC Is Already Being Talked About
Written by Michael Larabel in GNU on 4 March 2015 at 06:24 PM EST. 13 Comments
GNU --
Interested individuals are already discussing the prospects of dealing with SPIR-V intermediate representation for the new Vulkan graphics API within the GNU Compiler Collection.

An interested developer independent of GCC started the thread about SPIR-V in GCC in the possibilities that down the road GCC could produce SPIR-V for example to write shaders in C/C++ or any other language with a GCC front-end that in turn could be compiled to SPIR-V. This would allow using the same compiler for both CPU and GPU graphics/compute as an alternative to LLVM where much of the SPIR-V interest is around and already plans for having a SPIR-V to LLVM IR pass.

David Malcolm of Red Hat responded to the inquiry and talked about his plans for GCC 6 to make it possible for GCC's new JIT abilities (libgccjit to decouple the host from being the target. In GCC 5, the host is the target, but he's hoping for GCC 6 that it would be possible to change that to theoretically allow GCC JIT to target a graphics processor. Another GCC JIT possibility for GCC 6 he mentioned is multi-target support.

Malcolm also brought up the possibility of using GCC for optimizing SPIR-V and potentially compiling SPIR-V back to CPU code.

Right now there's no (at least public) commitment from any parties for building a GCC front-end to consume SPIR-V or for a GCC back-end to generate SPIR-V representation, but at least some interest is forming. Hopefully as Vulkan and SPIR-V start to become used, we'll see some activity within the GCC camp. Of course, RMS probably won't be happy about it given that SPIR was originally designed from LLVM IR (though SPIR-V is a clean sheet design) and his liking to distance of GNU projects from LLVM/Clang.
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 10,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter or contacted via MichaelLarabel.com.

Related GNU News
Popular News This Week