New GLSL To LLVM Implementation For Mesa

Written by Michael Larabel in Mesa on 12 September 2012 at 12:08 PM EDT. 2 Comments
MESA
Vincent Lejeune has shared a new Mesa branch that he's currently soliciting for comments as it introduces a new GLSL to LLVM pass. He hopes drivers will begin to use it, including the Intel driver with their new-found LLVM compiler ambitions.

Vincent's glsl-to-llvm work is able to generate LLVM IR out of GLSL for drivers that have a LLVM back-end in mesa/Gallium3D. Right now most of the work has been toying with the R600g driver and its LLVM back-end. This conversion pass isn't doing any optimization work at this point but simply converting GLSL to LLVM, similar to the GLSL to TGSI work previously.

While the tree is now under an "RFC" state, it's not regression-free and has some work ahead before it could even be considered for merging. "So far I managed to get something like 200 regressions on 7000 passing tests in piglit, but recent changes (ie moving the interpolation logic inside backend) added 100 others regressions in current trunk, because of failing front/back face color issue I'm working on."

Lejeune ends his mailing list message with, "I'd like to request your feedback and suggestion on my work. Glsl-to-llvm does not calls any gallium function and can also be used by classic dri drivers. I don't know what is the current status of the recently announced llvm i965 compiler, I don't know if it has already its own glsl-to-llvm pass or not. If not, it would be really great if this pass was also shared by i965, as the more drivers use it, the more reliable it is."

It was shared last month in San Diego that Intel is finally looking at an LLVM compiler for their DRI driver rather than continuing to work on their own custom compiler implementation. The other Gallium3D drivers have already been after LLVM-based compiler back-ends for various reasons. There was also Mesa LunarGLASS previously as a different implementation that made Mesa use LLVM for its IR.
Related News
About The Author
Michael Larabel

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 20,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, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week