<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 9, 2016 at 10:24 PM, Chandler Carruth via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">You've raised an important point here Pete, and while I disagree pretty strongly with it (regardless of whether Lanai makes sense or not), I'm glad that you've surfaced it where we can clearly look at the issue.<div><br></div><div>The idea of "it really should have users outside of just the people who have access to the HW" I think is deeply problematic for the project as a whole. Where does it stop?</div><div><br></div><div>While I may have the theoretical ability to get access to an AVR, Hexagon, MSP430, SystemZ, or XCore processor... It is a practical impossibility. There is no way that I, or I suspect 95% of LLVM contributors, will be able to run code for all these platforms. And for some of them, I suspect it is already the case that their only users have access to specialized, quite hard to acquire hardware (both Hexagon[1] and SystemZ come to mind).</div><div><br></div><div>But I really don't think we want to kick any of these backends out of LLVM, or that they were a mistake to include in the first place. So the question really is whether the lack of *theoretical* access matters substantially more than lack of *practical* access.</div><div><br></div><div>This policy would also set an extremely alarming precedent to me at least, maybe one that you're not even intending: what's the difference between hardware and an operating system? I don't think we want to limit the operating system support of Clang to those which are readily accessible. Lots of folks don't have a practical ability to use Apple's operating system because they don't own any of Apple's hardware. And the reverse is of course true -- I think if you work at Apple and only own Apple hardware, you probably shoudn't be expected to boot Windows or Linux and debug something.</div><div><br></div><div>We have a growing history of support diverse platforms, both hardware and software. And when we do this, we rely on the community contributors who care deeply about those platforms to bridge the gap and support those developers who don't have ready access to the platform. I don't want to see this change, as I think it has been absolutely critical to the community growing and thriving over the past few years. My best memory of this is with AMDGPU (which is why I brought it up, I agree with others that MSP430 or XCore are perhaps better examples here). I was making a change to a DAG combine of some form and it ended up regressing the AMDGPU (R600 at the time) regression tests. I was completely lost. While in theory, I could go pick up such a GPU and install it in a machine to test things out, in practice I'm never going to do that. If that were the requirement, I would just have to abandon such changes. But instead, Tom and Matt bent over backwards to help me out, looked at all the test case updates I sent them and helped verify that indeed, the changes were harmless or even helpful. I didn't need hardware, an emulator, or even an ISA spec. And I think this is *awesome*.</div><div><br></div><div>So regardless of what we do with Lanai, I feel really strongly that we don't want to use "have other users" or "can run the code" as the bar for supporting platforms.</div><div><br></div></div></blockquote><div><br></div><div>I fully agree with your analysis here. As far as maintenance of the LLVM project is concerned, leaning on active maintainers is the way that issues get solved in practice, so the "can I run the code" quality isn't relevant for maintenance.<br></div><div><br></div><div>I guess the "can I run the code" is more about enabling interesting/new use cases for *users* of LLVM, for which the ability to generate code with LLVM *and* run the code in their application is essential. But that is per se outside the LLVM community and e.g. Hexagon and SystemZ are a precedent for us not worrying too much about it.</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div></div><div><br></div><div>But all that really doesn't mean we should necessarily adopt Lanai. I think this is probably the nearest tradeoff the community has looked at (that's actually one reason I worked internally to see if we could contribute the backend). And it is definitely is a tradeoff.</div><div><br></div><div>IMO, it is worth the tradeoff, just like it was for BPF, AMDGPU, and others. Our goal should be to get more upstream contributors and LLVM developers, and to the extent that we can do that by encouraging people working on new (to the community) platforms, whether software or hardware, to work on them upstream and in-tree, I think we should.</div><div><br></div><div>Personally, I'm not concerned about how encumbered in any sense SystemZ is or isn't (I have no idea about such things). I don't care that I'm completely unlikely to be able to get a SystemZ system, or even an emulator. I'm probably not going to spend a whole lot of time trying to read the entire ISA spec. To me, while those things would *help* motivate the issue, they're not the operative factor in my decision. Instead, the fact that IBM contributed SystemZ, maintained it, and was able to do more work in-tree was justification enough.</div><div><br></div><div>My 2 cents, sorry I took so many words to express them. =]</div><div>-Chandler</div><div><br></div><div><br></div><div>[1] Yes, I know Hexagon chips are present all over Android devices, but I have no idea how one would go about actually programming most of them. Maybe it's actually much easier than I imagine, if so, apologize. My impression has just been that Qualcomm (the producer of the Hexagon chips) is by far the largest user of the backend if not the exclusive user. None of this is a criticism of course! =]</div></div><div class=""><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Tue, Feb 9, 2016 at 9:35 PM Pete Cooper via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div>On Feb 9, 2016, at 9:15 PM, Hal Finkel <<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>> wrote:</div><br><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">----- Original Message -----</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">From: "Pete Cooper via llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br>To: "Sean Silva" <<a href="mailto:chisophugis@gmail.com" target="_blank">chisophugis@gmail.com</a>><br>Cc: "llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br>Sent: Tuesday, February 9, 2016 10:59:58 PM<br>Subject: Re: [llvm-dev] [RFC] Lanai backend<br><br><br>Hi Sean<br><br><br>I think you’ve summed it up really well here.<br><br><br>Personally I don’t think we should accept backends for which there is<br>no way to run the code. The burden (however small) on the community<br>to having an in-tree backend they can’t use is too high IMO.<br><br><br>As you point out ‘no way to run the code’ may mean not having access<br>to HW, or having HW but no API.<br><br></blockquote><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Out of curiosity, would the existence of some kind of open-source emulator affect your opinion on this? Or does it need to be actual hardware?</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"></div></blockquote></div></div><div style="word-wrap:break-word"><div>I guess hardware isn’t even the correct term given we have BPF which I think is a virtual ISA of some kind.</div><div><br></div><div>I’d be ok with targeting an emulator, but with the caveat that people are actually using the emulator.  An emulator which exists purely to get this backend in to LLVM isn’t useful, but one which people do use for education or otherwise is useful.  But it really should have users outside of just the people who have access to the real HW.</div><div><br></div><div>Perhaps this can be an experimental backend to give time for an emulator and community to grow around it, and then we can decide later whether to promote to a first class backend?  Then we still have options, including just continuing as an experimental backend for longer if thats best.</div><div><br></div><div>As a small digression, I would say that this has raised a very valid discussion about the code that ends up in LLVM and is built as standard.  I don’t know, nor am I going to look, but I think the same could (should?) be applied to other code like passes.  If a pass isn’t used by anyone in tree then should it be in tree?</div><div><br></div><div>Pete</div></div><div style="word-wrap:break-word"><div><br><blockquote type="cite"><div><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">-Hal<span> </span></span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br>NVPTX is a good example. Now you can take the output from LLVM and<br>run it on HW. It may or may not be how Nvidia do it in their code,<br>but that doesn’t matter, you can do it. Same for AMDGPU.<br><br><br>So -1 from me to having backends we can’t make use of.<br><br><br>Finally, one option is to have perpetually experimental backends.<br>Then all the code is in tree but no-one in tree should ever be<br>expected to update it. That does have the big advantage that all of<br>the code is there to discuss and the maintainers can make<br>contributions to common code and gain/provide help in the community.<br>They can also be involved in discussions which impact them such as<br>changes to common code.<br><br><br>Cheers,<br>Pete<br><br><br><br><br>On Feb 9, 2016, at 4:18 PM, Sean Silva via llvm-dev <<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a> > wrote:<br><br><br>One data point (IIRC) is that the NVPTX backend sat in tree for a<br>long time without a way to actually use them. But lately this has<br>been opening up (e.g. <a href="http://llvm.org/docs/CompileCudaWithLLVM.html" target="_blank">http://llvm.org/docs/CompileCudaWithLLVM.html</a><br>). However, the obstacle for NVPTX was mostly a software<br>proprietary-ness (no way to plug it into the driver stack really,<br>except via nvidia's own proprietary software), whereas the actual<br>hardware was available. For the Lanai stuff, it seems like the<br>hardware is fundamentally not available for purchase.<br><br><br>The reverse situation is with e.g. Apple's GPU backends, where the<br>devices are readily available, but (AFAIK) even if the backend were<br>open-source you couldn't run the code produced by the open-source<br>compiler.<br><br><br>Or to put it in matrix form (this is all heavily prefixed by "AFAIK";<br>corrections welcome):<br><br><br>AMDGPU: InTree:Yes DevicesAvailable:Yes CanIRunTheCode:Yes<br>NVPTX: InTree:Yes DevicesAvailable:Yes CanIRunTheCode :Yes<br>Lanai: InTree:? DevicesAvailable:No CanIRunTheCode :No<br>Apple GPU's: InTree:No DevicesAvailable:Yes CanIRunTheCode :No<br><br>I couldn't come up with a good name for "Can I Run The Code" column.<br>Basically it means: "assuming the backend were in open source, could<br>I actually run the code produced by the open source backend<br>somehow?".<br><br><br>I had a quick look at lib/Target and it seems like every backend we<br>have has "CanIRunTheCode:Yes" in theory.<br>IIRC, the NVPTX stuff used to actually be "No" though?<br><br><br>Anyway, just a random thought. Not sure what the conclusion is.<br><br>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br><br></blockquote><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">--<span> </span></span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Hal Finkel</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Assistant Computational Scientist</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Leadership Computing Facility</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Argonne National Laboratory</span></div></blockquote></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>
</div></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div></div>