<div dir="ltr"><div class="gmail_quote">On Tue, 19 May 2015 at 11:34 Owen Anderson <<a href="mailto:resistor@mac.com">resistor@mac.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">More generally,  making it a target immediately invokes a lot of behavior that is undesirable for a serialization format between a fronted and a backend.  You don’t *want* LLVM to do a lot of wacky CodeGenPrepare and/or lowering before emitting SPIR-V, which is likely to lose source-level information that the eventual consumer wanted to have available.  You do not want to leverage any of the general target architecture.<br></blockquote><div><br></div><div>I don't think the suggestion is to use SelectionDAG and friends in this target. My understanding is that this would only involve registering as a target similar to the way the CppBackend does, then invoking the code from lib/SPIRV.</div><div><br></div><div>By registering as a target you can select SPIR-V for Clang emission the same way you select, say, X86 or ARM, rather than adding a special flag.</div><div><br></div><div>Stefanus</div></div></div>