<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Indeed, SPIR-V not being a target would
prevent using clang to generate SPIR-V (which target triple would
be used?) On the other hand, maybe it would be possible to have a
clang target without a corresponding LLVM target. I'm not familiar
with the target machinery in clang so I don't know if it would
work or not.<br>
<br>
Either way, I don't think any LLVM tool should output SPIR-V
directly, except maybe a simple conversion tool between the two
IRs.<br>
<br>
Pierre-Andre<br>
<br>
On 19/05/15 09:25, Neil Henning wrote:<br>
</div>
<blockquote cite="mid:555AF380.6020002@duskborn.com" type="cite">
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
The problem is - as Sean and Pete (and others before) have pointed
out, from a users perspective they'll want to say 'clang make me
SPIR-V'. There are things in SPIR-V that are not representable by
the LLVM IR, so we'd have to add SPIR-V specific intrinsics for
this (again making the case for having it as a target more
palatable), and also there are things in the IR that won't be
allowed when producing SPIR-V (off the top of my head, in a
graphics shader with logical addressing mode a ton of pointer use
is banned).<br>
<br>
I think what Sean suggested of having a very thin backend that
satisfies what a user will want when producing SPIR-V + setting up
the target specific intrinsics, and then the majority of the
actual SPIR-V production code being in lib/SPIRV sounds like a
good approach to me!<br>
<br>
Cheers,<br>
-Neil.<br>
<br>
<div class="moz-cite-prefix">On 19/05/15 00:24, Owen Anderson
wrote:<br>
</div>
<blockquote
cite="mid:D628AE43-2815-485F-8A07-8A9AC068463A@mac.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On May 18, 2015, at 2:09 PM, Sean Silva <<a
moz-do-not-send="true"
href="mailto:chisophugis@gmail.com" class="">chisophugis@gmail.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="font-family: Helvetica; font-size: 12px;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;"
class="">From an end-user's perspective it sounds like
the use case for SPIR-V though is a lot more similar to
a target though. E.g. the user is notionally telling
clang "target SPIR-V" (including doing any IR
optimizations, any special "codegenprepare" special
passes, etc.), rather than "act like you're targeting X,
but -emit-llvm/-emit-spirv instead" (which is what I
imagine from a component purely in lib/SPIRV).</div>
<br class="Apple-interchange-newline">
</div>
</blockquote>
</div>
<br class="">
<div class="">SPIR-V is a serialization format between the
user’s frontend and the vendor’s backend. From the user’s
perspective, it looks like a target. From the vendor’s
perspective, it looks like a frontend. In this sense, it is
very comparable to LLVM bitcode itself.</div>
<div class=""><br class="">
</div>
<div class="">—Owen</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
</body>
</html>