<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<p style="margin-top:0;margin-bottom:0"><font size="2"><span style="font-size:11pt;"><br>
> This is great to see.  Is this code the basis of the forks that Anastasia<br>
talked about or did those come from somewhere else?</span></font><br>
</p>
<br>
Yes, indeed the base is <a href="https://github.com/KhronosGroup/SPIRV-LLVM/" class="OWAAutoLink">
https://github.com/KhronosGroup/SPIRV-LLVM/</a> and then there are multiple forks that include some rework as well (some of which were announced on the LLVM channels). I think the biggest problems we are trying to solve is:<br>
<br>
1. Keeping up to date with the LLVM code base development.<br>
<br>
2. Providing unified common place for everyone to contribute their changes.<br>
<br>
Now there are two extra goals that are more related to Clang:<br>
<br>
3. Missing targets that can be used as an end binary (except for AMD GPU). Addind SPIRV to LLVM would allow Clang open source users to generate this portable binary format without going to any other toolchains that just integrate Clang. This is also a reason
 why we keep maintaining Clang in all the toolchains. Hopefully, people will start improving LLVM for GPU targets upstream because they will be able to use SPIRV available directly in LLVM to demonstate their issues/improvements.<br>
<br>
4. There is a plan for adding OpenCL C++ support that mandates generation of SPIRV. I started a thread on this last week:
<a href="http://lists.llvm.org/pipermail/cfe-dev/2018-February/056972.html" class="OWAAutoLink">
http://lists.llvm.org/pipermail/cfe-dev/2018-February/056972.html</a><br>
<br>
So if for the goals (1) and (2) above, we could setup separate repository outside of LLVM and try to spread the information about it well enough that everyone starts using it. This won't help us with item (3) at all, and item (4) will be incomplete.<br>
<br>
Cheers,<br>
Anastasia<br>
<br>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>From:</b> llvm-dev <llvm-dev-bounces@lists.llvm.org> on behalf of Tom Stellard via llvm-dev <llvm-dev@lists.llvm.org><br>
<b>Sent:</b> 23 February 2018 20:28<br>
<b>To:</b> Tomeu Vizoso; LLVM Developers<br>
<b>Subject:</b> Re: [llvm-dev] SPIRV-LLVM as an external tool</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On 02/21/2018 03:34 PM, Pierre Moreau wrote:<br>
> On 2018-02-21 — 14:55, Tom Stellard via llvm-dev wrote:<br>
>> On 02/21/2018 12:15 AM, Tomeu Vizoso via llvm-dev wrote:<br>
>>> Hi,<br>
>>><br>
>>> for a few months already I have been asking around for opinions on how<br>
>>> people could best work together on Khronos' SPIR-V <-> LLVM-IR converter<br>
>>> and some consensus seems to have formed.<br>
>>><br>
>>> Most of the people I talked to favored having the converter become an<br>
>>> external tool within the LLVM project, similar to libclc. I think that<br>
>>> the LLVM project's processes, infrastructure and community form the best<br>
>>> place for this collaboration to happen.<br>
>>><br>
>>> I hope that having the converter as part of LLVM can help expand LLVM's<br>
>>> value proposition in heterogeneous computing, in part by complementing<br>
>>> the OpenCL C backend in clang.<br>
>>><br>
>>> Thus I would like to ask what the LLVM community needs to see from us<br>
>>> before SPIRV-LLVM can be accepted as an external tool, if at all.<br>
>>><br>
>><br>
>> Does the external tool exist already?  I recommend starting by posting<br>
>> the code publicly and then ensuring that going forward all development<br>
>> and discussions about the tool are happening in a public space.<br>
> <br>
> The code is publicly available at <a href="https://github.com/pierremoreau/llvm-spirv">
https://github.com/pierremoreau/llvm-spirv</a>.<br>
> It is based on <a href="https://github.com/KhronosGroup/SPIRV-LLVM/">https://github.com/KhronosGroup/SPIRV-LLVM/</a> and<br>
> <a href="https://github.com/thewilsonator/llvm-target-spirv/">https://github.com/thewilsonator/llvm-target-spirv/</a>, stripped off of everything<br>
> not related to SPIR-V and updated to work with llvm HEAD.<br>
> (Some of the commits were lost on the way, so we are in the process of redoing<br>
> the stripping and updating.)<br>
<br>
This is great to see.  Is this code the basis of the forks that Anastasia<br>
talked about or did those come from somewhere else?<br>
<br>
-Tom<br>
<br>
> <br>
> One user of that external tool will be Mesa [1] (for its OpenCL implementation<br>
> named clover) for<br>
> 1. enabling clCreateProgramWithIL(KHR)? on AMD cards through clover, by<br>
>    translating SPIR-V to LLVM IR; (patches under review [2])<br>
> 2. allowing additional drivers (nouveau, freedreno, etnativ) to be supported by<br>
>    clover, by compiling OpenCL C (via LLVM IR) to SPIR-V (and then translating<br>
>    from SPIR-V to NIR).<br>
> <br>
> Regards,<br>
> Pierre<br>
> <br>
> [1]: <a href="https://www.mesa3d.org/">https://www.mesa3d.org/</a><br>
> [2]: <a href="https://patchwork.freedesktop.org/series/38728/">https://patchwork.freedesktop.org/series/38728/</a><br>
> <br>
>> It's important to demonstrate that there is a developer community backing<br>
>> the tool and that it won't be abandoned if it is added as an llvm<br>
>> sub-project.<br>
>><br>
>> -Tom<br>
>><br>
>>> Thanks,<br>
>>><br>
>>> Tomeu<br>
>>> _______________________________________________<br>
>>> LLVM Developers mailing list<br>
>>> llvm-dev@lists.llvm.org<br>
>>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
>><br>
>> _______________________________________________<br>
>> LLVM Developers mailing list<br>
>> llvm-dev@lists.llvm.org<br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
llvm-dev@lists.llvm.org<br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</div>
</span></font></div>
</div>
</div>
</body>
</html>