[Mesa-dev] [RFC] glsl-to-llvm

Eric Anholt eric at anholt.net
Wed Sep 19 00:07:41 PDT 2012


Tom Stellard <tom at stellard.net> writes:

> On Tue, Sep 11, 2012 at 11:12:49PM +0200, Vincent wrote:
>> Hi,
>> 
>> I'm currently working on a glsl to llvm pass that generates LLVM IR from
>> glsl tree for drivers that ships with a LLVM backend. The current code
>> is located here : http://cgit.freedesktop.org/~vlj/mesa in branch
>> glsl-to-llvm3. It is still a work in progress (I'm not fully satisfied
>> by some factorisation and coding style is not consistant atm)
>> 
>> I'm testing it against evergreen at the moment thus namespace are r600
>> oriented (all the intrinsics are prefixed with llvm.AMDGPU. or
>> llvm.R600.). However I'm trying to make it as driver agnostic as
>> possible.
>
> The r600 backend uses way too many intrinsics, and most of them could be
> replaced with either one or a sequence of LLVM IR instructions.
> However, there are several things that must be represented by intrinsics.
> These include texture instructions, shader inputs, shader outputs, and
> possibly others.  I think if this front end is used by multiple backends,
> it will be important to come up with some standard intrinsic definitions
> that backends can share.  Ideally GLSL->LLVM would not need to use any
> target-specific intrinsics.

That was my reaction when I saw vlj's work as well -- way too many
intrinsics for no apparent reason, and the previous llvm stuff from Luca
looked much nicer in that way.

> As I mentioned above, if this will be used by multiple backends, it
> makes sense to rename the intrinsics to something like
> llvm.mesa.store.position.

Agreed (and this is where Luca's code wasn't apparently useful -- no
real way to get inputs and outputs hooked up to it as-is)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120919/775a27d0/attachment.pgp>


More information about the mesa-dev mailing list