<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000'><br><br><hr id="zwchr"><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"Mehdi Amini via llvm-dev" <llvm-dev@lists.llvm.org><br><b>To: </b>"David Blaikie" <dblaikie@gmail.com><br><b>Cc: </b>"llvm-dev" <llvm-dev@lists.llvm.org><br><b>Sent: </b>Thursday, February 18, 2016 12:22:59 PM<br><b>Subject: </b>Re: [llvm-dev] RFC: Add bitcode tests to test-suite<br><br>
<br class=""><div><blockquote class=""><div class="">On Feb 18, 2016, at 10:15 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><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;" class=""><div class="gmail_quote" 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;">On Thu, Feb 18, 2016 at 10:03 AM, Mehdi Amini via llvm-dev<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><span class=""><br class="">> On Feb 18, 2016, at 8:42 AM, Philip Reames via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br class="">><br class="">> On 02/18/2016 06:54 AM, Hal Finkel via llvm-dev wrote:<br class="">>> Hi Chandler, et al.,<br class="">>><br class="">>> While this proposal to put IR into the test suite technically non-problematic, I've convinced myself that this is a suboptimal direction for the LLVM project. Here's what I think would be better:<br class="">>><br class="">>> - We create a test-suite/Frontends directory, and open this directory to actively-maintained external frontends, subject to the following restrictions:<br class="">>><br class="">>> - The frontend must be actively maintained, and the project must agree to actively maintain the test-suite version<br class="">>> - The frontend must use the LLVM API (either C or C++) - no printing textual IR<br class="">>> - The frontend must have no significant (non-optional) dependencies outside of LLVM itself, or things on which LLVM itself depends<br class="">>> - The frontend must have regression tests and benchmarks/correctness tests providing significant coverage of the frontend and its associated code generation<br class="">>><br class="">>> Here's the quid pro quo:<br class="">>><br class="">>> - The LLVM community gains additional testing coverage (which we definitely need)<br class="">>> - The LLVM community gains extra insight into how its APIs are being used (hopefully allowing us to make more-informed decisions about how to update them)<br class="">>><br class="">>> - The frontend gains free API updates<br class="">>> - The frontend's use of LLVM will be more stable<br class="">>><br class="">>> This involves extra work for everybody, but will help us all deliver higher-quality products. Plus, given the constant discussions about the difficulty for external projects to follow API updates, etc., this is a good way to help address those difficulties.<br class="">>><br class="">>> The fact that Halide will provide extra coverage of our vector code generation (aside from whatever we happen to produce from our autovectorizers), and our JIT infrastructure, makes it a good candidate for this. Intel's ispc, POCL, (maybe whatever bit of Mesa uses LLVM), etc. would also be natural candidates should the projects be interested.<br class="">> I think this is a really bad tradeoff and am strongly opposed to this proposal.<br class="">><br class="">> If we want to focus on improving test coverage, that's reasonable, but doing so at the cost of requiring LLVM contributors to maintain everyone's frontend is not a reasonable approach.<br class="">><br class="">> A couple of alternate approaches which might be worth considering:<br class="">> 1) The IR corpus approach mentioned previously. So long as external teams are willing to update the corpus regularly (weekly), this gives most of the backend coverage with none of the maintenance burden.<br class="">> 2) Use coverage information to determine which code paths Halide covers which are not covered by existing unit tests. Work to improve those unit tests. Using something along the lines with a mutation testing (i.e. change the source code and see what breaks), combined with test reduction (bugpoint), could greatly improve our test coverage in tree fairly quickly. This would require a lot of work from a single contributor, but that's much better than requiring a lot of work from all contributors.<br class=""><br class=""></span>I support the view of Philip on this topic.<br class="">I think that having the bitcode without the burden of the API and linking is the best trade-off for LLVM.<br class=""><br class="">About the bitcode, I'm not convince that it needs to be updated that often: we're interested in coverage for LLVM, not trying to validate that we support correctly frontend X or Y in a particular version. I'd even argue that if Halide version 13 generates a very different IR than Halide 12, then we should keep the Halide 12 generated bitcode in a separate directory because it is likely to stress LLVM differently.<br class=""></blockquote><div class=""><br class=""></div><div class="">Potentially, though I hesitate to make test-suite too much of a dumping ground (it is already, to an extent). Quantity isn't quality and all that - making sure bots cycle quickly (in a relative sense - of course running the test-suite is going to be a more involved process than our high priority regression 'unit'-y tests) is important for them to be meaningful/actionable by developers & not just noise.<br class=""></div></div></div></blockquote><div><br class=""></div><div id="DWT4202">Yeah this is why I stressed the "modular" aspect of the test-suite: I'd like this to be a *separate* repository that people (and bot owners) who want it can get it very easily through a unified test-suite infrastructure. Anyone could put any "external" test-suite on github and try to get it used. (Like if someone was to publish an "external" test-suite with a lot of cryptographic algorithm that could be benchmarked as part of the llvm test-suite infrastructure).</div></div></blockquote><br>Regardless of anything else, I support this idea. The reason why I think it is better for these things to be in our own repositories is that most (although not all) API updates are trivial, and it is better for us to make them ourselves as opposed to having to disable some external test-suite "module" while we await external developer action.<br><br> -Hal<br><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div><div></div><div><br class=""></div><div>-- </div><div>Mehdi</div><div><br class=""></div><br class=""><blockquote class=""><div class=""><div class="gmail_quote" 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 class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br class="">I have more questions for Alina. What kind of tests do you have:<br class=""><br class="">- "the compiler takes the bitcode and generates code without crashing"<br class="">- "the compiled test runs without crashing"<br class="">- "the compiled test will produce an output that be checked against a reference"<br class="">- "the compiled test is meaningful as a benchmarks"<br class=""><br class="">All these different aspects of testing can be interesting, but knowing what we're talking may influence the way forward.<br class=""><br class="">As mentioned before, the test-suite has a mechanism of "external" suites, it may be limited right now but could probably be expanded. Ideally there could be multiple repositories that would just be checked out independently (think about the way we build LLVM alone or LLVM+clang+libcxx+compiler-rt+...).<br class=""><span class="HOEnZb"><font class="" color="#888888"><br class="">--<br class="">Mehdi<br class=""></font></span><div class="HOEnZb"><div class="h5"><br class=""><br class="">>><br class="">>> Thanks again,<br class="">>> Hal<br class="">>><br class="">>> <hr id="zwchr"><br class="">>>> From: "Chandler Carruth" <<a href="mailto:chandlerc@google.com" class="" target="_blank">chandlerc@google.com</a>><br class="">>>> To: "Hal Finkel" <<a href="mailto:hfinkel@anl.gov" class="" target="_blank">hfinkel@anl.gov</a>>, "Alina Sbirlea" <<a href="mailto:alina.sbirlea@gmail.com" class="" target="_blank">alina.sbirlea@gmail.com</a>><br class="">>>> Cc: "llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org" class="" target="_blank">llvm-dev@lists.llvm.org</a>><br class="">>>> Sent: Wednesday, February 17, 2016 9:34:24 PM<br class="">>>> Subject: Re: [llvm-dev] RFC: Add bitcode tests to test-suite<br class="">>>><br class="">>>><br class="">>>> Some perhaps relevant aspects that make testing users of LLVM like<br class="">>>> Halide challenging:<br class="">>>><br class="">>>><br class="">>>> Halide uses the LLVM C++ APIs, but there isn't a good way to<br class="">>>> lock-step update it. So if we were to directly test Halide, it<br class="">>>> wouldn't link against the new LLVM.<br class="">>>><br class="">>>><br class="">>>> Practically speaking though, the LLVM IR generated by Halide should<br class="">>>> continue to work with newer LLVM optimizations and code generation.<br class="">>>> So the idea would be to snapshot the IR in bitcode (which is at<br class="">>>> least reasonably stable) so that we could replay the tests as LLVM<br class="">>>> changes. We can freshen the bitcode by re-generating it periodically<br class="">>>> so it doesn't drift too far from what Halide actually uses.<br class="">>>><br class="">>>><br class="">>>> The interesting questions IMO are:<br class="">>>><br class="">>>><br class="">>>> 1) Are folks happy using bitcode as the format here? I agree with Hal<br class="">>>> that it should be easy since Clang will actually Do The Right Thing<br class="">>>> if given a bitcode input.<br class="">>>><br class="">>>><br class="">>>> 2) Are folks happy with non-execution tests in some cases? I think<br class="">>>> Alina is looking at whether we can get a runtime library that will<br class="">>>> allow some of these to actually execute, but at least some of the<br class="">>>> tests are just snap-shots of a JIT, and would need the full Halide<br class="">>>> libraries (and introspection) to execute usefully.<br class="">>>><br class="">>>><br class="">>>> -Chandler<br class="">>>><br class="">>>><br class="">>>> On Wed, Feb 17, 2016 at 7:25 PM Hal Finkel via llvm-dev <<br class="">>>><span class="Apple-converted-space"> </span><a href="mailto:llvm-dev@lists.llvm.org" class="" target="_blank">llvm-dev@lists.llvm.org</a><span class="Apple-converted-space"> </span>> wrote:<br class="">>>><br class="">>>><br class="">>>><br class="">>>><br class="">>>><br class="">>>><br class="">>>><br class="">>>><br class="">>>> From: "Alina Sbirlea via llvm-dev" <<span class="Apple-converted-space"> </span><a href="mailto:llvm-dev@lists.llvm.org" class="" target="_blank">llvm-dev@lists.llvm.org</a><span class="Apple-converted-space"> </span>><br class="">>>> To: "llvm-dev" <<span class="Apple-converted-space"> </span><a href="mailto:llvm-dev@lists.llvm.org" class="" target="_blank">llvm-dev@lists.llvm.org</a><span class="Apple-converted-space"> </span>><br class="">>>> Sent: Wednesday, February 17, 2016 7:25:17 PM<br class="">>>> Subject: [llvm-dev] RFC: Add bitcode tests to test-suite<br class="">>>><br class="">>>><br class="">>>><br class="">>>><br class="">>>><br class="">>>><br class="">>>> Hi all,<br class="">>>><br class="">>>><br class="">>>> TL;DR: Add *.bc to test-suite; llc *.bc; run some.<br class="">>>><br class="">>>><br class="">>>><br class="">>>> We would like to propose adding bitcode tests to the llvm test-suite.<br class="">>>><br class="">>>><br class="">>>> Recent LLVM bugs [2-4] prompted us to look into upstreaming a subset<br class="">>>> of the tests the Halide library [1] is running and we'd like the<br class="">>>> community's feedback on moving forward with this.<br class="">>>><br class="">>>><br class="">>>><br class="">>>> Halide uses LLVM and can generate bitcode, but we cannot add C++<br class="">>>> tests to test-suite without including the library itself.<br class="">>>> This proposal is also potentially useful for other cases where there<br class="">>>> is no C++ front-end.<br class="">>>><br class="">>>><br class="">>>> As a first step we are interested in adding a set of correctness<br class="">>>> tests, for testing the IR without running the tests. Since these<br class="">>>> tests are generated, they are not instrumented like the .ll files in<br class="">>>> trunk, however we believe checking that llc runs without errors is<br class="">>>> still useful.<br class="">>>> The bitcode files for Halide may also be large, so including them as<br class="">>>> regression tests is not an option. If the smaller tests are found to<br class="">>>> be valuable or covering cases no other tests cover, we can<br class="">>>> instrument them and move them into the llvm trunk further along, but<br class="">>>> that is not the goal of this proposal.<br class="">>>> In addition, we're not sure whether the format for the tests should<br class="">>>> be .ll or .bc, we're open to either.<br class="">>>><br class="">>>><br class="">>>> After this first step, we're interested in upstreaming bitcode tests<br class="">>>> and also running them.<br class="">>>> We are very interested in tests for multiple architectures, aarch64<br class="">>>> in particular, since this is where we have seen things break. This<br class="">>>> may motivate adding .ll files rather than .bc in order to include<br class="">>>> the "RUN:" target.<br class="">>>> Where would these tests reside and with what directory structure?<br class="">>>> (similar to test/CodeGen?)<br class="">>>><br class="">>>><br class="">>>> Suggestion on what's the best approach for extending the test-suite<br class="">>>> framework for this proposal are more than welcome.<br class="">>>><br class="">>>><br class="">>>><br class="">>>> We already have architecture-specific tests in the test suite (e.g.<br class="">>>> SingleSource/UnitTests/Vector/{SSE,Altivec,etc.}, and Clang can deal<br class="">>>> with IR inputs. I suppose you need to compile some corresponding<br class="">>>> runtime library, but this does not seem like a big deal either.<br class="">>>> Mechanically, I don't see this as particularly complicated. I think<br class="">>>> the real question is: Is this the best way to have a kind of 'halide<br class="">>>> buildbot' that can inform the LLVM developer community?<br class="">>>><br class="">>>> -Hal<br class="">>>><br class="">>>><br class="">>>><br class="">>>><br class="">>>><br class="">>>><br class="">>>><br class="">>>><br class="">>>><br class="">>>><br class="">>>> This is just the high-level overview to start off the discussion, I'm<br class="">>>> sure there are many more aspects to touch on. Looking forward to<br class="">>>> your feedback!<br class="">>>><br class="">>>><br class="">>>><br class="">>>> Thanks,<br class="">>>> Alina<br class="">>>><br class="">>>><br class="">>>> [1] http:// halide -<a href="http://lang.org/" rel="noreferrer" target="_blank" class="">lang.org/</a><br class="">>>> [2] Broken: r259800 => Fixed: r260131<br class="">>>> [3] Broken: r260569 => Fixed: r260701<br class="">>>><br class="">>>> [4]<span class="Apple-converted-space"> </span><a href="https://llvm.org/bugs/show_bug.cgi?id=26642" rel="noreferrer" target="_blank" class="">https://llvm.org/bugs/show_bug.cgi?id=26642</a><br class="">>>><br class="">>>><br class="">>>><br class="">>>><br class="">>>> _______________________________________________<br class="">>>> LLVM Developers mailing list<br class="">>>><span class="Apple-converted-space"> </span><a href="mailto:llvm-dev@lists.llvm.org" class="" target="_blank">llvm-dev@lists.llvm.org</a><br class="">>>><span class="Apple-converted-space"> </span><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">>>><br class="">>>><br class="">>>><br class="">>>><br class="">>>><br class="">>>> --<br class="">>>><br class="">>>> Hal Finkel<br class="">>>> Assistant Computational Scientist<br class="">>>> Leadership Computing Facility<br class="">>>> Argonne National Laboratory<br class="">>>> _______________________________________________<br class="">>>> LLVM Developers mailing list<br class="">>>><span class="Apple-converted-space"> </span><a href="mailto:llvm-dev@lists.llvm.org" class="" target="_blank">llvm-dev@lists.llvm.org</a><br class="">>>><span class="Apple-converted-space"> </span><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">>>><br class="">><br class="">> _______________________________________________<br class="">> LLVM Developers mailing list<br class="">><span class="Apple-converted-space"> </span><a href="mailto:llvm-dev@lists.llvm.org" class="" target="_blank">llvm-dev@lists.llvm.org</a><br class="">><span class="Apple-converted-space"> </span><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class=""><br class="">_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="" target="_blank">llvm-dev@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a></div></div></blockquote></div></div></blockquote></div><br class=""><br>_______________________________________________<br>LLVM Developers mailing list<br>llvm-dev@lists.llvm.org<br>http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br></blockquote><br><br><br>-- <br><div><span name="x"></span>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory<span name="x"></span><br></div></div></body></html>