<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 Nov 18, 2015, at 3:01 PM, Matthias Braun <<a href="mailto:mbraun@apple.com" class="">mbraun@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; 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 Nov 18, 2015, at 1:32 PM, Quentin Colombet via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class=""><br class="">Hi James,<br class=""><br class=""><blockquote type="cite" class="">On Nov 18, 2015, at 11:53 AM, James Molloy <<a href="mailto:james@jamesmolloy.co.uk" class="">james@jamesmolloy.co.uk</a>> wrote:<br class=""><br class="">Hi Quentin,<br class=""><br class="">I'm really excited to see this happening!<br class=""><br class="">My major question is over the testing story for this. How are we going to write unit tests for GIR?<br class=""></blockquote><br class="">Thanks for bringing that up!<br class="">That is a very good question and also one that will require a lot of work to address properly.<br class=""><br class="">Ultimately, I’d like we are able to write unit tests directly in the MachineInstr representation. Part of the goal of making the IR self contained, i.e., with no back links to LLVM IR, is to make the testing easier.<br class=""><br class="">Now, to answer the question on how we do that, I have a pragmatic answer, though I am not proud of it:<br class="">We are going to write unit tests with LLVM IR as input and check the MI output of the pass, e.g.,with print-after=IRTranslator.<br class=""><br class="">That’s not great, but at least we can test now!<br class=""></blockquote><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: 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="">We do have the .mir dumping and reading. </span>To me that code looks like it basically works and just might need a bug fix here and there. Should be the right thing to use when starting a new project like this, shouldn't it?</div></blockquote><div><br class=""></div><div>That’s the thing, I don’t want to spend time writing mir code. I basically want to be able to take the machine code I expect and add CHECK lines without going through the yaml formatting business.</div><div><br class=""></div><div>For just the translator, the story might be different though, because it’s LLVM IR to MI, so maybe that’s already well supported.</div><div>Then, I haven’t followed the mir stuff closely to know whether or not it would work with “a bug fix here and there”. For instance, I don’t know how it gets the opcode for the parser, i.e., how automatic/easy it is to add the generic opcode, plus we will have to teach it how to deal with type on instructions and so on.</div><div><br class=""></div><div>My impression was that it was sufficiently lacking usability so that a fresh start would make sense (basically I see it as a prototype), but you may well be right. Again, I don’t plan to look into it for the prototype timeframe, but if you are, by all means!</div><div><br class=""></div><div>Cheers,</div><div>-Quentin</div><br class=""><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: 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; 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="">- Matthias</span></div></blockquote></div><br class=""></body></html>