<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 11, 2019 at 1:54 PM David Greene <<a href="mailto:greened@obbligato.org">greened@obbligato.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Mehdi AMINI <<a href="mailto:joker.eph@gmail.com" target="_blank">joker.eph@gmail.com</a>> writes:<br>
<br>
> Of course by its nature, MLIR doesn't lend itself to concrete semantic<br>
>> descriptions, though I would expect the affine dialect (and others) to<br>
>> have documentation on par with the LLVM IR.<br>
><br>
><br>
> Just last week I had to scout through the affine dialect "LangRef<br>
> <<a href="https://github.com/tensorflow/mlir/blob/master/g3doc/Dialects/Affine.md" rel="noreferrer" target="_blank">https://github.com/tensorflow/mlir/blob/master/g3doc/Dialects/Affine.md</a>>"<br>
> for something, and I also felt that it is due for a refresh! It seemed a<br>
> bit more than just BNF though, do you have example of what you would like<br>
> to see expanded there?<br>
<br>
I was referring to the base MLIR documentation with the BNF comment:<br>
<br>
<a href="https://github.com/tensorflow/mlir/blob/master/g3doc/LangRef.md" rel="noreferrer" target="_blank">https://github.com/tensorflow/mlir/blob/master/g3doc/LangRef.md</a><br>
<br>
Obviously there's more to it than that but I found this document pretty<br>
dense.<br></blockquote><div><br></div><div>Oh I see, indeed this is a bit difficult to grasp: since MLIR is designed for extensibility, a lot of the core "LangRef" things are very structural by nature at this level. If I draw a parallel with LLVM IR, it is like if you would split LangRef into:</div><div>- the definition of what is SSA, Module, Function, Block, terminator, phi nodes. In particular that would be most of: <a class="gmail-reference gmail-internal" href="https://llvm.org/docs/LangRef.html#abstract" id="gmail-id1016" style="font-family:"Lucida Grande","Lucida Sans Unicode",Geneva,Verdana,sans-serif;font-size:14px;color:rgb(202,121,0);text-decoration-line:none">Abstract</a>, <a class="gmail-reference gmail-internal" href="https://llvm.org/docs/LangRef.html#introduction" id="gmail-id1017" style="font-family:"Lucida Grande","Lucida Sans Unicode",Geneva,Verdana,sans-serif;font-size:14px;color:rgb(202,121,0);text-decoration-line:none">Introduction</a>, <a class="gmail-reference gmail-internal" href="https://llvm.org/docs/LangRef.html#well-formedness" id="gmail-id1018" style="font-family:"Lucida Grande","Lucida Sans Unicode",Geneva,Verdana,sans-serif;font-size:14px;color:rgb(202,121,0);text-decoration-line:none">Well-Formedness</a>, <a class="gmail-reference gmail-internal" href="https://llvm.org/docs/LangRef.html#identifiers" id="gmail-id1019" style="font-family:"Lucida Grande","Lucida Sans Unicode",Geneva,Verdana,sans-serif;font-size:14px;color:rgb(202,121,0);text-decoration-line:none">Identifiers</a>, <a class="gmail-reference gmail-internal" href="https://llvm.org/docs/LangRef.html#high-level-structure" id="gmail-id1020" style="font-family:"Lucida Grande","Lucida Sans Unicode",Geneva,Verdana,sans-serif;font-size:14px;color:rgb(202,121,0);text-decoration-line:none">High Level Structure</a>, <a class="gmail-reference gmail-internal" href="https://llvm.org/docs/LangRef.html#module-structure" id="gmail-id1021" style="font-family:"Lucida Grande","Lucida Sans Unicode",Geneva,Verdana,sans-serif;font-size:14px;color:rgb(202,121,0);text-decoration-line:none">Module Structure</a>, and partially <a class="gmail-reference gmail-internal" href="https://llvm.org/docs/LangRef.html#functions" id="gmail-id1031" style="background-color:rgb(248,248,248);font-family:"Lucida Grande","Lucida Sans Unicode",Geneva,Verdana,sans-serif;font-size:14px;color:rgb(202,121,0);text-decoration-line:none">Functions</a> (which defines CFG).</div><div>- the types and instructions semantics (all the rest of LangRef basically).</div><div><div><br></div><div>The MLIR LangRef corresponds to the former part only, because this is what is common to all dialects. On the other hand, each dialect will need to provide its own LangRef equivalent (for example I linked to the Affine dialect doc before).<br></div><div></div></div><div> </div><div>Does it make sense?</div><div><br></div><div>-- </div><div>Mehdi</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> The current proposal includes all the content of<br>
> <a href="https://github.com/tensorflow/mlir/" rel="noreferrer" target="_blank">https://github.com/tensorflow/mlir/</a> as-is.<br>
> It does *not* include the TensorFlow specific dialects and other pieces<br>
> here:<br>
> <a href="https://github.com/tensorflow/tensorflow/tree/master/tensorflow/compiler/mlir/" rel="noreferrer" target="_blank">https://github.com/tensorflow/tensorflow/tree/master/tensorflow/compiler/mlir/</a><br>
<br>
Looks great, thanks for making it more clear!<br>
<br>
                    -David<br>
</blockquote></div></div>