From: Samuel Pitoiset <samuel.pitoiset@gmail.com>
To: Hans de Goede <hdegoede@redhat.com>,
Francisco Jerez <currojerez@riseup.net>
Cc: "nouveau@lists.freedesktop.org" <nouveau@lists.freedesktop.org>,
"mesa-dev@lists.freedesktop.org" <mesa-dev@lists.freedesktop.org>
Subject: Re: llvm TGSI backend (WIP) questions
Date: Fri, 13 Nov 2015 19:04:16 +0100 [thread overview]
Message-ID: <56462620.1080003@gmail.com> (raw)
In-Reply-To: <5645E9CC.1040401@redhat.com>
On 11/13/2015 02:46 PM, Hans de Goede wrote:
> Hi All,
Hey Hans,
>
> So as discussed I've started working on a TGSI backend for
> llvm to use as a way to get compute going on nouveau (and other gpu-s).
>
> I'm still learning all the ins and outs of llvm so I do not have
> much to show yet.
>
> I've rebased Francisco's (curro's) latest version on top of llvm
> trunk, and added a commit on top to actual get it build with the
> latest trunk. So currently I'm at the point where I've just
> taken Francisco's code, and made it compile, no more and no less.
>
> I have a git repo with this work available here:
>
> http://cgit.freedesktop.org/~jwrdegoede/llvm/
Thanks for sharing your work. :-)
>
> So the next step would be to test this and see if it actually
> does anything, questions:
>
> 1) Does anyone have a simple test case / command where I can
> invoke just llvm and get TGSI asm output to check ?
>
> 2) Assuming I get the above to (somewhat) work, is there a
> way to make llvm show the output of the various intermediate
> passes in a human readable form ?
Basically, you need to ask Clang to emit LLVM code for you, for example,
this command will emit LLVM IR:
clang -cc1 -cl-std=CL1.2 -emit-llvm -triple spir64-unknown-unknown kernel.cl
Note that this command only works with an old LLVM version (I don't
remember exactly).
But in your case, and for that TGSI backend, I don't think there is a
-emit-tgsi option which can directly output TGSI from OpenCL.
The other way, and in my opinion the best, is to write a little C++
program based on Clang/LLVM API for generating TGSI code. To do that,
you can have a look at
src/gallium/state_trackers/clover/llvm/invocation.cpp which contains an
example (but it seems to be outdated).
Basically, you need to call that CompilerInvocation object with some
parameters and all the stuff around. This should not take more than
100LOC in my opinion. I think the first step should be to emit LLVM IR
before trying to get TGSI working.
I could write that program for you if you want but I don't think to have
time to do it during this weekend.
Thanks.
>
> Regards,
>
> Hans
--
-Samuel
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev
next prev parent reply other threads:[~2015-11-13 18:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-13 13:46 llvm TGSI backend (WIP) questions Hans de Goede
[not found] ` <5645E9CC.1040401-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-11-13 14:25 ` Emil Velikov
[not found] ` <CACvgo51PRgQ+=-_p-FWrqa55YmL1Qu8g92fWeWS4e16csaJ8Jg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-13 14:38 ` Ilia Mirkin
2015-11-13 15:38 ` [Nouveau] " Connor Abbott
2015-11-13 20:42 ` Emil Velikov
[not found] ` <CACvgo52T-D5_TOsROzohrL-YioTCdzGW8zYCH287o3yqr+4tvw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-13 20:46 ` Ilia Mirkin
2015-11-13 18:04 ` Samuel Pitoiset [this message]
2015-11-13 18:51 ` Tom Stellard
2015-11-16 14:33 ` Hans de Goede
2015-11-18 14:53 ` Hans de Goede
[not found] ` <564C90F1.5000700-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-11-18 15:11 ` [Mesa-dev] " Tom Stellard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56462620.1080003@gmail.com \
--to=samuel.pitoiset@gmail.com \
--cc=currojerez@riseup.net \
--cc=hdegoede@redhat.com \
--cc=mesa-dev@lists.freedesktop.org \
--cc=nouveau@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.