<br><br>On Tuesday, April 28, 2015, Sean Silva <<a href="mailto:chisophugis@gmail.com">chisophugis@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 28, 2015 at 3:51 PM, David Majnemer <span dir="ltr"><<a href="javascript:_e(%7B%7D,'cvml','david.majnemer@gmail.com');" target="_blank">david.majnemer@gmail.com</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">I love the idea of having some sort of textual representation.  My only concern is that our YAML parser is not very actively maintained (is there someone expert with its implementation *and* active in the project?) and (IMHO) over-engineered when compared to the simplicity of our custom IR parser.<div><br></div><div>Without TLC, I'm afraid it would make for a poor piece of LLVM infrastructure to rely on.  The reliability of the serialization mechanism is very important if we are to have any chance of applying fuzz testing to the backend pieces; after all, testability is a huge motivation for this work.<div><br></div><div>As a concrete example, a file solely containing '%' crashes the yaml parser:</div><div><div>$ ~/llvm/Debug+Asserts/bin/yaml2obj -format=coff t.yaml</div><div>yaml2obj: ~/llvm/src/lib/Support/YAMLTraits.cpp:78: bool llvm::yaml::Input::setCurrentDocument(): Assertion `Strm->failed() && "Root is NULL iff parsing failed"' failed.</div><div>0  yaml2obj        0x000000000048682e</div><div>1  yaml2obj        0x0000000000486b43</div><div>2  yaml2obj        0x000000000048570e</div><div>3  libpthread.so.0 0x00007f5e79643340</div><div>4  libc.so.6       0x00007f5e78c9acc9 gsignal + 57</div><div>5  libc.so.6       0x00007f5e78c9e0d8 abort + 328</div><div>6  libc.so.6       0x00007f5e78c93b86</div><div>7  libc.so.6       0x00007f5e78c93c32</div><div>8  yaml2obj        0x000000000045f378</div><div>9  yaml2obj        0x000000000040d4b3</div><div>10 yaml2obj        0x000000000040b0fa</div><div>11 yaml2obj        0x0000000000404a79</div><div>12 yaml2obj        0x0000000000404dd8</div><div>13 libc.so.6       0x00007f5e78c85ec5 __libc_start_main + 245</div><div>14 yaml2obj        0x0000000000404879</div><div>Stack dump:</div><div>0.      Program arguments: ~/llvm/Debug+Asserts/bin/yaml2obj -format=coff t.yaml</div></div></div></div><div><div><div class="gmail_extra"><br></div></div></div></blockquote><div><br></div><div><br></div><div>Hopefully a fuzzer that is fuzzing a yaml input would not waste its time with syntactically invalid or unusual YAML.</div></div></div></div></blockquote><div><br></div><div>Maybe.  I don't see why we would want to lock ourselves out of using afl-fuzz though.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Also, you're thinking of YAMLIO which is a layer on top of the YAML parser (YAMLParser.{h,cpp}). It might make sense to not use YAMLIO (it is good for some types of data, not for all) but still use the YAML parser.</div><div><br></div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><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><div><div class="gmail_extra"><div class="gmail_quote">On Tue, Apr 28, 2015 at 2:00 PM, Alex L <span dir="ltr"><<a href="javascript:_e(%7B%7D,'cvml','arphaman@gmail.com');" target="_blank">arphaman@gmail.com</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"><br><div class="gmail_extra"><br><div class="gmail_quote">2015-04-28 10:14 GMT-07:00 Quentin Colombet <span dir="ltr"><<a href="javascript:_e(%7B%7D,'cvml','qcolombet@apple.com');" target="_blank">qcolombet@apple.com</a>></span>:<span><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 style="word-wrap:break-word">Hi Alex,<div><br></div><div>Thanks for working on this.</div><div><br></div><div>Personally I would rather not have to write YAML inputs but instead resort on the what the machine dumps look like. That being said, I can live with YAML :).</div><div><br></div><div>More importantly, how do you plan to report syntax errors to the users?</div><div>Things like invalid instruction, invalid registers, etc.?</div><div>What about unallocated code, i.e., virtual registers, invalid SSA form, etc.?</div><div><br></div><div>Cheers,</div><div>Q.<br></div></div></blockquote><div><br></div></span><div>Thanks,</div><div><br></div><div>Unfortunately, the machine dumps are quite incomplete (and tricky to parse too!), and thus some sort of new syntax has to be developed.</div><div>I think that a YAML based container is a good candidate for this purpose, as it has a structured format that represents things like machine functions,</div><div>frame information, register information, target specific machine function details, etc in a clear and readable way.</div><div><br></div><div>I haven't thought about error reporting that much, as I've been mostly working on developing the syntax and making sure that all the data structures</div><div>can be represented by it. But I believe that the errors that crop up in an invalid machine instruction syntax, like invalid basic block references, invalid instructions,</div><div>etc. can be reported quite well and I can rely on already existing error reporting facilities in LLVM to help me. The more structural errors, like missing attributes </div><div>will be handled by the YAML parser automatically, and I might extend it to provide better/more specific error messages. And I think that it's possible</div><div>to use the machine verifier to catch the other errors that you've mentioned.</div><span><font color="#888888"><div><br></div><div>Alex</div></font></span><div><div><div><br></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 style="word-wrap:break-word"><div><div><blockquote type="cite"><div><div><div>On Apr 28, 2015, at 9:56 AM, Alex L <<a href="javascript:_e(%7B%7D,'cvml','arphaman@gmail.com');" target="_blank">arphaman@gmail.com</a>> wrote:</div><br></div></div><div><div><div><div dir="ltr">
<pre style="margin-top:0px;margin-bottom:0px">Hi<span style="color:rgb(192,192,192)"> </span>all,</pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px">I<span style="color:rgb(192,192,192)"> </span>would<span style="color:rgb(192,192,192)"> </span>like<span style="color:rgb(192,192,192)"> </span>to<span style="color:rgb(192,192,192)"> </span>propose<span style="color:rgb(192,192,192)"> </span>a<span style="color:rgb(192,192,192)"> </span>text-based,<span style="color:rgb(192,192,192)"> </span>human<span style="color:rgb(192,192,192)"> </span>readable<span style="color:rgb(192,192,192)"> </span>format<span style="color:rgb(192,192,192)"> </span>that<span style="color:rgb(192,192,192)"> </span>will<span style="color:rgb(192,192,192)"> </span>be<span style="color:rgb(192,192,192)"> </span>used<span style="color:rgb(192,192,192)"> </span>to</pre>
<pre style="margin-top:0px;margin-bottom:0px">serialize<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>machine<span style="color:rgb(192,192,192)"> </span>level<span style="color:rgb(192,192,192)"> </span>IR.<span style="color:rgb(192,192,192)"> </span>The<span style="color:rgb(192,192,192)"> </span>major<span style="color:rgb(192,192,192)"> </span>goal<span style="color:rgb(192,192,192)"> </span>of<span style="color:rgb(192,192,192)"> </span>this<span style="color:rgb(192,192,192)"> </span>format<span style="color:rgb(192,192,192)"> </span>is<span style="color:rgb(192,192,192)"> </span>to<span style="color:rgb(192,192,192)"> </span>allow<span style="color:rgb(192,192,192)"> </span>LLVM</pre>
<pre style="margin-top:0px;margin-bottom:0px">to<span style="color:rgb(192,192,192)"> </span>save<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>machine<span style="color:rgb(192,192,192)"> </span>level<span style="color:rgb(192,192,192)"> </span>IR<span style="color:rgb(192,192,192)"> </span>after<span style="color:rgb(192,192,192)"> </span>any<span style="color:rgb(192,192,192)"> </span>code<span style="color:rgb(192,192,192)"> </span>generation<span style="color:rgb(192,192,192)"> </span>pass<span style="color:rgb(192,192,192)"> </span>and<span style="color:rgb(192,192,192)"> </span>then<span style="color:rgb(192,192,192)"> </span>to<span style="color:rgb(192,192,192)"> </span>load</pre>
<pre style="margin-top:0px;margin-bottom:0px">it<span style="color:rgb(192,192,192)"> </span>again<span style="color:rgb(192,192,192)"> </span>and<span style="color:rgb(192,192,192)"> </span>continue<span style="color:rgb(192,192,192)"> </span>running<span style="color:rgb(192,192,192)"> </span>passes<span style="color:rgb(192,192,192)"> </span>on<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>machine<span style="color:rgb(192,192,192)"> </span>level<span style="color:rgb(192,192,192)"> </span>IR.<span style="color:rgb(192,192,192)"> </span>The<span style="color:rgb(192,192,192)"> </span>primary<span style="color:rgb(192,192,192)"> </span>use<span style="color:rgb(192,192,192)"> </span>case</pre>
<pre style="margin-top:0px;margin-bottom:0px">of<span style="color:rgb(192,192,192)"> </span>this<span style="color:rgb(192,192,192)"> </span>format<span style="color:rgb(192,192,192)"> </span>is<span style="color:rgb(192,192,192)"> </span>to<span style="color:rgb(192,192,192)"> </span>enable<span style="color:rgb(192,192,192)"> </span>easier<span style="color:rgb(192,192,192)"> </span>testing<span style="color:rgb(192,192,192)"> </span>process<span style="color:rgb(192,192,192)"> </span>for<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>code<span style="color:rgb(192,192,192)"> </span>generation<span style="color:rgb(192,192,192)"> </span>passes,</pre>
<pre style="margin-top:0px;margin-bottom:0px">by<span style="color:rgb(192,192,192)"> </span>allowing<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>developers<span style="color:rgb(192,192,192)"> </span>to<span style="color:rgb(192,192,192)"> </span>write<span style="color:rgb(192,192,192)"> </span>tests<span style="color:rgb(192,192,192)"> </span>that<span style="color:rgb(192,192,192)"> </span>load<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>IR,<span style="color:rgb(192,192,192)"> </span>then<span style="color:rgb(192,192,192)"> </span>invoke<span style="color:rgb(192,192,192)"> </span>just<span style="color:rgb(192,192,192)"> </span>a</pre>
<pre style="margin-top:0px;margin-bottom:0px">specific<span style="color:rgb(192,192,192)"> </span>code<span style="color:rgb(192,192,192)"> </span>gen<span style="color:rgb(192,192,192)"> </span>pass<span style="color:rgb(192,192,192)"> </span>and<span style="color:rgb(192,192,192)"> </span>then<span style="color:rgb(192,192,192)"> </span>inspect<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>output<span style="color:rgb(192,192,192)"> </span>of<span style="color:rgb(192,192,192)"> </span>that<span style="color:rgb(192,192,192)"> </span>pass<span style="color:rgb(192,192,192)"> </span>by<span style="color:rgb(192,192,192)"> </span>checking<span style="color:rgb(192,192,192)"> </span>the</pre>
<pre style="margin-top:0px;margin-bottom:0px">printed<span style="color:rgb(192,192,192)"> </span>out<span style="color:rgb(192,192,192)"> </span>IR.</pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px">The<span style="color:rgb(192,192,192)"> </span>proposed<span style="color:rgb(192,192,192)"> </span>format<span style="color:rgb(192,192,192)"> </span>has<span style="color:rgb(192,192,192)"> </span>a<span style="color:rgb(192,192,192)"> </span>number<span style="color:rgb(192,192,192)"> </span>of<span style="color:rgb(192,192,192)"> </span>key<span style="color:rgb(192,192,192)"> </span>features:</pre>
<pre style="margin-top:0px;margin-bottom:0px">-<span style="color:rgb(192,192,192)"> </span>It<span style="color:rgb(192,192,192)"> </span>stores<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>machine<span style="color:rgb(192,192,192)"> </span>level<span style="color:rgb(192,192,192)"> </span>IR<span style="color:rgb(192,192,192)"> </span>and<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>optional<span style="color:rgb(192,192,192)"> </span>LLVM<span style="color:rgb(192,192,192)"> </span>IR<span style="color:rgb(192,192,192)"> </span>in<span style="color:rgb(192,192,192)"> </span>one<span style="color:rgb(192,192,192)"> </span>text<span style="color:rgb(192,192,192)"> </span>file.</pre>
<pre style="margin-top:0px;margin-bottom:0px">-<span style="color:rgb(192,192,192)"> </span>The<span style="color:rgb(192,192,192)"> </span>connections<span style="color:rgb(192,192,192)"> </span>between<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>machine<span style="color:rgb(192,192,192)"> </span>level<span style="color:rgb(192,192,192)"> </span>IR<span style="color:rgb(192,192,192)"> </span>and<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>LLVM<span style="color:rgb(192,192,192)"> </span>IR<span style="color:rgb(192,192,192)"> </span>are<span style="color:rgb(192,192,192)"> </span>preserved.</pre>
<pre style="margin-top:0px;margin-bottom:0px">-<span style="color:rgb(192,192,192)"> </span>The<span style="color:rgb(192,192,192)"> </span>format<span style="color:rgb(192,192,192)"> </span>uses<span style="color:rgb(192,192,192)"> </span>a<span style="color:rgb(192,192,192)"> </span>YAML<span style="color:rgb(192,192,192)"> </span>based<span style="color:rgb(192,192,192)"> </span>container<span style="color:rgb(192,192,192)"> </span>for<span style="color:rgb(192,192,192)"> </span>most<span style="color:rgb(192,192,192)"> </span>of<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>data<span style="color:rgb(192,192,192)"> </span>structures.<span style="color:rgb(192,192,192)"> </span>The<span style="color:rgb(192,192,192)"> </span>LLVM</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">  </span>IR<span style="color:rgb(192,192,192)"> </span>is<span style="color:rgb(192,192,192)"> </span>embedded<span style="color:rgb(192,192,192)"> </span>in<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>YAML<span style="color:rgb(192,192,192)"> </span>container.</pre>
<pre style="margin-top:0px;margin-bottom:0px">-<span style="color:rgb(192,192,192)"> </span>The<span style="color:rgb(192,192,192)"> </span>format<span style="color:rgb(192,192,192)"> </span>also<span style="color:rgb(192,192,192)"> </span>uses<span style="color:rgb(192,192,192)"> </span>a<span style="color:rgb(192,192,192)"> </span>new,<span style="color:rgb(192,192,192)"> </span>text-based<span style="color:rgb(192,192,192)"> </span>syntax<span style="color:rgb(192,192,192)"> </span>to<span style="color:rgb(192,192,192)"> </span>serialize<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>machine<span style="color:rgb(192,192,192)"> </span>instructions.</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">  </span>The<span style="color:rgb(192,192,192)"> </span>instructions<span style="color:rgb(192,192,192)"> </span>are<span style="color:rgb(192,192,192)"> </span>embedded<span style="color:rgb(192,192,192)"> </span>in<span style="color:rgb(192,192,192)"> </span>YAML.</pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px">This<span style="color:rgb(192,192,192)"> </span>is<span style="color:rgb(192,192,192)"> </span>an<span style="color:rgb(192,192,192)"> </span>incomplete<span style="color:rgb(192,192,192)"> </span>example<span style="color:rgb(192,192,192)"> </span>of<span style="color:rgb(192,192,192)"> </span>a<span style="color:rgb(192,192,192)"> </span>YAML<span style="color:rgb(192,192,192)"> </span>file<span style="color:rgb(192,192,192)"> </span>containing<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>LLVM<span style="color:rgb(192,192,192)"> </span>IR,<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>machine<span style="color:rgb(192,192,192)"> </span>level<span style="color:rgb(192,192,192)"> </span>IR</pre>
<pre style="margin-top:0px;margin-bottom:0px">and<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>instructions:</pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px">---</pre>
<pre style="margin-top:0px;margin-bottom:0px">ir:<span style="color:rgb(192,192,192)"> </span>|</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">  </span>define<span style="color:rgb(192,192,192)"> </span>i32<span style="color:rgb(192,192,192)"> </span>@fact(i32<span style="color:rgb(192,192,192)"> </span>%n)<span style="color:rgb(192,192,192)"> </span>{</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>%1<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>alloca<span style="color:rgb(192,192,192)"> </span>i32,<span style="color:rgb(192,192,192)"> </span>align<span style="color:rgb(192,192,192)"> </span>4</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>store<span style="color:rgb(192,192,192)"> </span>i32<span style="color:rgb(192,192,192)"> </span>%n,<span style="color:rgb(192,192,192)"> </span>i32*<span style="color:rgb(192,192,192)"> </span>%1,<span style="color:rgb(192,192,192)"> </span>align<span style="color:rgb(192,192,192)"> </span>4</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>%2<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>load<span style="color:rgb(192,192,192)"> </span>i32,<span style="color:rgb(192,192,192)"> </span>i32*<span style="color:rgb(192,192,192)"> </span>%1,<span style="color:rgb(192,192,192)"> </span>align<span style="color:rgb(192,192,192)"> </span>4</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>%3<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>icmp<span style="color:rgb(192,192,192)"> </span>eq<span style="color:rgb(192,192,192)"> </span>i32<span style="color:rgb(192,192,192)"> </span>%2,<span style="color:rgb(192,192,192)"> </span>0</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>br<span style="color:rgb(192,192,192)"> </span>i1<span style="color:rgb(192,192,192)"> </span>%3,<span style="color:rgb(192,192,192)"> </span>label<span style="color:rgb(192,192,192)"> </span>%10,<span style="color:rgb(192,192,192)"> </span>label<span style="color:rgb(192,192,192)"> </span>%4</pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">  </span>;<span style="color:rgb(192,192,192)"> </span><label>:4<span style="color:rgb(192,192,192)">                                       </span>;<span style="color:rgb(192,192,192)"> </span>preds<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>%0</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>%5<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>load<span style="color:rgb(192,192,192)"> </span>i32,<span style="color:rgb(192,192,192)"> </span>i32*<span style="color:rgb(192,192,192)"> </span>%1,<span style="color:rgb(192,192,192)"> </span>align<span style="color:rgb(192,192,192)"> </span>4</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>%6<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>sub<span style="color:rgb(192,192,192)"> </span>nsw<span style="color:rgb(192,192,192)"> </span>i32<span style="color:rgb(192,192,192)"> </span>%5,<span style="color:rgb(192,192,192)"> </span>1</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>%7<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>call<span style="color:rgb(192,192,192)"> </span>i32<span style="color:rgb(192,192,192)"> </span>@fact(i32<span style="color:rgb(192,192,192)"> </span>%6)</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>%8<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>load<span style="color:rgb(192,192,192)"> </span>i32,<span style="color:rgb(192,192,192)"> </span>i32*<span style="color:rgb(192,192,192)"> </span>%1,<span style="color:rgb(192,192,192)"> </span>align<span style="color:rgb(192,192,192)"> </span>4</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>%9<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>mul<span style="color:rgb(192,192,192)"> </span>nsw<span style="color:rgb(192,192,192)"> </span>i32<span style="color:rgb(192,192,192)"> </span>%7,<span style="color:rgb(192,192,192)"> </span>%8</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>br<span style="color:rgb(192,192,192)"> </span>label<span style="color:rgb(192,192,192)"> </span>%10</pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">  </span>;<span style="color:rgb(192,192,192)"> </span><label>:10<span style="color:rgb(192,192,192)">                                      </span>;<span style="color:rgb(192,192,192)"> </span>preds<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>%0,<span style="color:rgb(192,192,192)"> </span>%4</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>%11<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>phi<span style="color:rgb(192,192,192)"> </span>i32<span style="color:rgb(192,192,192)"> </span>[<span style="color:rgb(192,192,192)"> </span>%9,<span style="color:rgb(192,192,192)"> </span>%4<span style="color:rgb(192,192,192)"> </span>],<span style="color:rgb(192,192,192)"> </span>[<span style="color:rgb(192,192,192)"> </span>1,<span style="color:rgb(192,192,192)"> </span>%0<span style="color:rgb(192,192,192)"> </span>]</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>ret<span style="color:rgb(192,192,192)"> </span>i32<span style="color:rgb(192,192,192)"> </span>%11</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">  </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px">...</pre>
<pre style="margin-top:0px;margin-bottom:0px">---</pre>
<pre style="margin-top:0px;margin-bottom:0px">number:<span style="color:rgb(192,192,192)">          </span>0</pre>
<pre style="margin-top:0px;margin-bottom:0px">name:<span style="color:rgb(192,192,192)">            </span>fact</pre>
<pre style="margin-top:0px;margin-bottom:0px">alignment:<span style="color:rgb(192,192,192)">       </span>4</pre>
<pre style="margin-top:0px;margin-bottom:0px">regInfo:</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">  </span>....</pre>
<pre style="margin-top:0px;margin-bottom:0px">frameInfo:</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">  </span>....</pre>
<pre style="margin-top:0px;margin-bottom:0px">body:</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">  </span>-<span style="color:rgb(192,192,192)"> </span>bb:<span style="color:rgb(192,192,192)">              </span>0</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>llbb:<span style="color:rgb(192,192,192)">            </span>'%0'</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>successors:<span style="color:rgb(192,192,192)">      </span>[<span style="color:rgb(192,192,192)"> </span>'bb#2',<span style="color:rgb(192,192,192)"> </span>'bb#1'<span style="color:rgb(192,192,192)"> </span>]</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>liveIns:<span style="color:rgb(192,192,192)">         </span>[<span style="color:rgb(192,192,192)"> </span>'%edi'<span style="color:rgb(192,192,192)"> </span>]</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>instructions:</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">      </span>-<span style="color:rgb(192,192,192)"> </span>'push64r<span style="color:rgb(192,192,192)"> </span>undef<span style="color:rgb(192,192,192)"> </span>%rax,<span style="color:rgb(192,192,192)"> </span>%rsp,<span style="color:rgb(192,192,192)"> </span>%rsp'</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">      </span>-<span style="color:rgb(192,192,192)"> </span>'mov32mr<span style="color:rgb(192,192,192)"> </span>%rsp,<span style="color:rgb(192,192,192)"> </span>1,<span style="color:rgb(192,192,192)"> </span>%noreg,<span style="color:rgb(192,192,192)"> </span>4,<span style="color:rgb(192,192,192)"> </span>%noreg,<span style="color:rgb(192,192,192)"> </span>%edi'</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">      </span>-<span style="color:rgb(192,192,192)"> </span>....</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>....</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">  </span>-<span style="color:rgb(192,192,192)"> </span>bb:<span style="color:rgb(192,192,192)">              </span>1</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>llbb:<span style="color:rgb(192,192,192)">            </span>'%4'</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>successors:<span style="color:rgb(192,192,192)">      </span>[<span style="color:rgb(192,192,192)"> </span>'bb#2'<span style="color:rgb(192,192,192)"> </span>]</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>instructions:</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">      </span>-<span style="color:rgb(192,192,192)"> </span>'%edi<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>mov32rm<span style="color:rgb(192,192,192)"> </span>%rsp,<span style="color:rgb(192,192,192)"> </span>1,<span style="color:rgb(192,192,192)"> </span>%noreg,<span style="color:rgb(192,192,192)"> </span>4,<span style="color:rgb(192,192,192)"> </span>%noreg'</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">      </span>-<span style="color:rgb(192,192,192)"> </span>....</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>....</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">  </span>-<span style="color:rgb(192,192,192)"> </span>....</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>....</pre>
<pre style="margin-top:0px;margin-bottom:0px">...</pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px">The<span style="color:rgb(192,192,192)"> </span>example<span style="color:rgb(192,192,192)"> </span>above<span style="color:rgb(192,192,192)"> </span>shows<span style="color:rgb(192,192,192)"> </span>a<span style="color:rgb(192,192,192)"> </span>YAML<span style="color:rgb(192,192,192)"> </span>file<span style="color:rgb(192,192,192)"> </span>with<span style="color:rgb(192,192,192)"> </span>two<span style="color:rgb(192,192,192)"> </span>YAML<span style="color:rgb(192,192,192)"> </span>documents<span style="color:rgb(192,192,192)"> </span>(delimited<span style="color:rgb(192,192,192)"> </span>by<span style="color:rgb(192,192,192)"> </span>`---`</pre>
<pre style="margin-top:0px;margin-bottom:0px">and<span style="color:rgb(192,192,192)"> </span>`...`)<span style="color:rgb(192,192,192)"> </span>containing<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>LLVM<span style="color:rgb(192,192,192)"> </span>IR<span style="color:rgb(192,192,192)"> </span>and<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>machine<span style="color:rgb(192,192,192)"> </span>function<span style="color:rgb(192,192,192)"> </span>information<span style="color:rgb(192,192,192)"> </span>for<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>function<span style="color:rgb(192,192,192)"> </span>`fact`.</pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px">When<span style="color:rgb(192,192,192)"> </span>a<span style="color:rgb(192,192,192)"> </span>specific<span style="color:rgb(192,192,192)"> </span>format<span style="color:rgb(192,192,192)"> </span>is<span style="color:rgb(192,192,192)"> </span>chosen,<span style="color:rgb(192,192,192)"> </span>I'll<span style="color:rgb(192,192,192)"> </span>start<span style="color:rgb(192,192,192)"> </span>with<span style="color:rgb(192,192,192)"> </span>patches<span style="color:rgb(192,192,192)"> </span>that<span style="color:rgb(192,192,192)"> </span>serialize<span style="color:rgb(192,192,192)"> </span>the</pre>
<pre style="margin-top:0px;margin-bottom:0px">embedded<span style="color:rgb(192,192,192)"> </span>LLVM<span style="color:rgb(192,192,192)"> </span>IR.<span style="color:rgb(192,192,192)"> </span>Then<span style="color:rgb(192,192,192)"> </span>I'll<span style="color:rgb(192,192,192)"> </span>add<span style="color:rgb(192,192,192)"> </span>support<span style="color:rgb(192,192,192)"> </span>for<span style="color:rgb(192,192,192)"> </span>things<span style="color:rgb(192,192,192)"> </span>like<span style="color:rgb(192,192,192)"> </span>machine<span style="color:rgb(192,192,192)"> </span>functions<span style="color:rgb(192,192,192)"> </span>and</pre>
<pre style="margin-top:0px;margin-bottom:0px">machine<span style="color:rgb(192,192,192)"> </span>basic<span style="color:rgb(192,192,192)"> </span>blocks,<span style="color:rgb(192,192,192)"> </span>and<span style="color:rgb(192,192,192)"> </span>I<span style="color:rgb(192,192,192)"> </span>think<span style="color:rgb(192,192,192)"> </span>that<span style="color:rgb(192,192,192)"> </span>an<span style="color:rgb(192,192,192)"> </span>intrusive<span style="color:rgb(192,192,192)"> </span>implementation<span style="color:rgb(192,192,192)"> </span>will<span style="color:rgb(192,192,192)"> </span>work<span style="color:rgb(192,192,192)"> </span>best</pre>
<pre style="margin-top:0px;margin-bottom:0px">for<span style="color:rgb(192,192,192)"> </span>data<span style="color:rgb(192,192,192)"> </span>structures<span style="color:rgb(192,192,192)"> </span>like<span style="color:rgb(192,192,192)"> </span>these.<span style="color:rgb(192,192,192)"> </span>After<span style="color:rgb(192,192,192)"> </span>that<span style="color:rgb(192,192,192)"> </span>I<span style="color:rgb(192,192,192)"> </span>will<span style="color:rgb(192,192,192)"> </span>continue<span style="color:rgb(192,192,192)"> </span>adding<span style="color:rgb(192,192,192)"> </span>support<span style="color:rgb(192,192,192)"> </span>for</pre>
<pre style="margin-top:0px;margin-bottom:0px">serialization<span style="color:rgb(192,192,192)"> </span>of<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>remaining<span style="color:rgb(192,192,192)"> </span>data<span style="color:rgb(192,192,192)"> </span>structures.</pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px">Thanks<span style="color:rgb(192,192,192)"> </span>for<span style="color:rgb(192,192,192)"> </span>reading<span style="color:rgb(192,192,192)"> </span>through<span style="color:rgb(192,192,192)"> </span>the<span style="color:rgb(192,192,192)"> </span>proposal.<span style="color:rgb(192,192,192)"> </span>What<span style="color:rgb(192,192,192)"> </span>are<span style="color:rgb(192,192,192)"> </span>you<span style="color:rgb(192,192,192)"> </span>thoughts<span style="color:rgb(192,192,192)"> </span>about<span style="color:rgb(192,192,192)"> </span>this<span style="color:rgb(192,192,192)"> </span>format?</pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre></div></div></div><span>
_______________________________________________<br>LLVM Developers mailing list<br><a href="javascript:_e(%7B%7D,'cvml','LLVMdev@cs.uiuc.edu');" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></span></div></blockquote></div><br></div></div></blockquote></div></div></div><br></div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="javascript:_e(%7B%7D,'cvml','LLVMdev@cs.uiuc.edu');" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="javascript:_e(%7B%7D,'cvml','LLVMdev@cs.uiuc.edu');" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div></div>
</blockquote>