<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 Jul 9, 2014, at 3:09 PM, Evan Cheng <<a href="mailto:evan.cheng@apple.com" class="">evan.cheng@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" 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=""><br class="Apple-interchange-newline">On Jun 17, 2014, at 1:24 PM, Rafael Espíndola <<a href="mailto:rafael.espindola@gmail.com" class="">rafael.espindola@gmail.com</a>> wrote:<br class=""><br class="">On 17 June 2014 16:07, Anton Korobeynikov <<a href="mailto:anton@korobeynikov.info" class="">anton@korobeynikov.info</a>> wrote:<br class=""><blockquote type="cite" class="">Hi Rafael,<br class=""><br class=""><blockquote type="cite" class="">Do others agree that this is the case or at least that this would be a<br class="">reasonable balance?<br class=""></blockquote>IMO it's easier to be compatible on .ll level, no?<br class=""></blockquote><br class="">That is not my experience with the bitcode format. The way the API is<br class="">structured makes it really easy to support backwards compatibility.<br class=""><br class="">It also seems a lot more valuable from an user perspective to support<br class="">reading old .bc files. It means they can keep a library with IR for an<br class="">entire major LLVM release for example.<br class=""><br class=""><blockquote type="cite" class="">In case of binary<br class="">IR it's really easy to make incompatible changes. After all there are<br class="">no tests on IR binary compatibility, however the whole regression<br class="">testsuite can be viewed as a big test for .ll compatibility.<br class=""></blockquote><br class="">We do have tests that are done by checking in old versions of bitcode<br class="">files. We didn't use to be good about it, but I think we are now<br class="">fairly systematic about it any time we change the format.<br class=""><br class=""><blockquote type="cite" class="">There are two more points here:<br class=""><br class="">1. Actually we had much stronger policies wrt the bitcode<br class="">compatibility in minor releases. Something like x.y should be able to<br class="">read stuff from x.y-1, but x.y+2 is allowed not to read stuff there,<br class="">so the proper path is transition x.y-1 => x.y => x.y+2. Am I right?<br class=""></blockquote><br class="">That doesn't match what we have in trunk right now. For example, we<br class="">changed how inline asm is stored in r163185 (Sep 5 2012), but we still<br class="">support reading the old one. This is one of the cases where we have a<br class="">FIXME about 4.0.<br class=""></blockquote><br 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=""><span 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; float: none; display: inline !important;" class="">My understanding is newer version of LLVM should be able read older version with the same major release. And the .0 of the new major release must be able to read the bitcode of the previous major release. I think this is the right policy. We haven’t done a good job enforcing the policy, but we should.</span></div></blockquote><br class=""></div><div>That was also my understanding of our policy.</div><div><br class=""></div><div>You are right that we need to do a better job of testing this. We have some ad-hoc tests for particular bitcode auto-upgrades but nothing systematic. These tests just read binary bitcode files, run them through llvm-dis, and check for the expected output. An initial step to improve the situation would be to write similar tests that attempt to exercise every IR feature, not just the things that we already know need to be upgraded from old bitcode. We would need to adopt the convention of extending these tests whenever something is added to the IR. Whenever we make a release, we would make a copy this set of tests corresponding to that release and we would continue to run those tests on trunk, e.g., reading the bitcode from the 3.5 release. The expected output for these tests might need to be updated occasionally. I would want to try to pack these systematic tests into as few files as possible, ideally only one, so that it is easier to make copies as part of the release process. I don’t know if that is feasible, especially for checking target-specific intrinsics, but it would be a nice goal.</div><div><br class=""></div><div>Any feedback on that proposal?</div></body></html>