<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 18, 2015, at 2:09 PM, Sean Silva <<a href="mailto:chisophugis@gmail.com" class="">chisophugis@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sun, May 17, 2015 at 12:13 AM, Owen Anderson <span dir="ltr" class=""><<a href="mailto:resistor@mac.com" target="_blank" class="">resistor@mac.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><span class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On May 16, 2015, at 12:21 PM, Liu, Yaxun (Sam) <<a href="mailto:Yaxun.Liu@amd.com" target="_blank" class="">Yaxun.Liu@amd.com</a>> wrote:</div><br class=""><div class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">I am thinking maybe the functionality of the bi-way conversion can be kept at llvm/lib/Bitcode/SPIRV, which will facilitate OpenCL vendors to do conversions between LLVM and SPIR-V. On the other hand, we create a llvm/Target/SPIR-V, which uses llvm/lib/Bitcode/SPIRV to generate SPIR-V. The SPIR-V target allows Clang and other LLVM front ends to target generic OpenCL/Vulkan platforms.</span></div></blockquote></div><br class=""></span><div class="">I don’t think Chris was suggesting lib/Bitcode/SPIRV. That wouldn’t make a lot of sense, since Bitcode != SPIR-V.</div><div class=""><br class=""></div><div class="">FWIW, I agree with Chris that it makes sense as a parallel to lib/Bitcode. SPIR-V is (almost) an alternate encoding of LLVM IR, with a few things added/removed, and it makes sense to treat it in a similar manner to our normal serialization format.</div><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div></font></span></div></blockquote><div class=""><br class=""></div><div 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><div class=""><br class=""></div><div class="">So it sounds like having some "target-like" component for SPIR-V will be necessary to ease integration with regular clang flow. It might be that we have generic SPIR-V support factored out into lib/SPIRV, and then lib/Target/SPIRV for the logic that integrates with clang.</div></div></div></div></div></blockquote>I agree. I haven’t looked in to the SPIRV spec, but if its only intended to support GPU graphics/compute workloads then i doubt it supports everything the IR bitcode/ll code supports. That makes it feel more like a target to me.</div><div><br class=""></div><div>That is, is it appropriate to add lib/SPIRV as a serialization format when it doesn’t support all of LLVM IR? Targets can crash if they are fed code they don’t support, but I don’t like the sound of the file emitter crashing because the IR contained a function pointer.</div><div><br class=""></div><div>BTW, i’m not arguing against SPIRV in LLVM. I think it would be a great addition, just that we should be careful in making sure that everyone is ok with it not supporting all IR constructs but still being a first class serialization format.</div><div><br class=""></div><div>Cheers,</div><div>Pete<br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><div class="">-- Sean Silva</div><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><span class="HOEnZb"><font color="#888888" class=""><div class=""></div><div class="">—Owen</div></font></span></div><br class="">_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:LLVMdev@cs.uiuc.edu" class="">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu/" target="_blank" class="">http://llvm.cs.uiuc.edu</a><br class="">
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br class="">
<br class=""></blockquote></div><br class=""></div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:LLVMdev@cs.uiuc.edu" class="">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" class="">http://llvm.cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br class=""></div></blockquote></div><br class=""></body></html>