[llvm-dev] Google’s TensorFlow team would like to contribute MLIR to the LLVM Foundation

Mehdi Amini via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 11 15:04:04 PDT 2019


On Wed, Sep 11, 2019 at 1:54 PM David Greene <greened at obbligato.org> wrote:

> Mehdi AMINI <joker.eph at gmail.com> writes:
>
> > Of course by its nature, MLIR doesn't lend itself to concrete semantic
> >> descriptions, though I would expect the affine dialect (and others) to
> >> have documentation on par with the LLVM IR.
> >
> >
> > Just last week I had to scout through the affine dialect "LangRef
> > <https://github.com/tensorflow/mlir/blob/master/g3doc/Dialects/Affine.md
> >"
> > for something, and I also felt that it is due for a refresh! It seemed a
> > bit more than just BNF though, do you have example of what you would like
> > to see expanded there?
>
> I was referring to the base MLIR documentation with the BNF comment:
>
> https://github.com/tensorflow/mlir/blob/master/g3doc/LangRef.md
>
> Obviously there's more to it than that but I found this document pretty
> dense.
>

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:
- the definition of what is SSA, Module, Function, Block, terminator, phi
nodes. In particular that would be most of: Abstract
<https://llvm.org/docs/LangRef.html#abstract>, Introduction
<https://llvm.org/docs/LangRef.html#introduction>, Well-Formedness
<https://llvm.org/docs/LangRef.html#well-formedness>, Identifiers
<https://llvm.org/docs/LangRef.html#identifiers>, High Level Structure
<https://llvm.org/docs/LangRef.html#high-level-structure>, Module Structure
<https://llvm.org/docs/LangRef.html#module-structure>, and partially
Functions <https://llvm.org/docs/LangRef.html#functions> (which defines
CFG).
- the types and instructions semantics (all the rest of LangRef basically).

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).

Does it make sense?

-- 
Mehdi



> > The current proposal includes all the content of
> > https://github.com/tensorflow/mlir/ as-is.
> > It does *not* include the TensorFlow specific dialects and other pieces
> > here:
> >
> https://github.com/tensorflow/tensorflow/tree/master/tensorflow/compiler/mlir/
>
> Looks great, thanks for making it more clear!
>
>                     -David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190911/33740800/attachment.html>


More information about the llvm-dev mailing list