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

Chris Lattner via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 9 22:49:32 PDT 2019



> On Sep 9, 2019, at 3:39 PM, Renato Golin via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> On Mon, 9 Sep 2019 at 22:22, Chris Lattner <clattner at google.com> wrote:
>> Including a bunch of content, eg a full langref doc:
>> https://github.com/tensorflow/mlir/blob/master/g3doc/LangRef.md
> 
> Thanks Chris, that looks awesome!
> 
> This one could perhaps be improved with time:
> https://github.com/tensorflow/mlir/blob/master/g3doc/ConversionToLLVMDialect.md
> 
> Which I think was Hal's point. If we had a front-end already using it
> in tree, we could be a bit more relaxed with the conversion
> specification.

Don’t worry, Flang is coming soon :-).

In all seriousness, if you didn’t notice, the Flang team is planning to give a talk at LLVMDev in a month or so about Flang + MLIR.  I’d also love to see a round table or other discussion about MLIR integration at the event.

The topic of Clang generating MLIR is more sensitive and I think it is best broached as a separate conversation, one motivated with data.  I think that Clang generating MLIR can be a hugely positive thing (witness the explosion of recent proposals for LLVM IR extensions that are easily handled with MLIR) but it seems more conservative and logical to upgrade the existing Clang “CFG" representation to use MLIR first.  This brings simple and measurable improvements to the reliability, accuracy, and generality of the data flow analyses and the Clang Static Analyzer, without introducing a new step that could cause compile-time regressions.  Iff that goes well, we could consider the use of MLIR in the main compilation flow.

In any case, I hope that "Clang adoption" is not considered to be a blocker for MLIR to be adopted as part of the LLVM project.  This hasn’t been a formal or historical requirement for new LLVM subprojects, and I’d like to make sure we don’t put undue adoption pressure on Clang - it is important that we are deliberate about each step and do the right (data driven) thing for the (huge) Clang community.

-Chris


> 
> I remember when I did the EDG bridge to LLVM, I mostly repeated
> whatever Clang was doing, "bug-for-bug". :)
> 
> A cheeky request, perhaps, for the Flang people: they could help with
> that document on what they have learned using MLIR as a front-end into
> LLVM IR.
> 
> We get some common patterns written down, but also we get to review
> their assumptions earlier, and make sure that both Flang and MLIR
> co-evolve into something simpler.
> 
> cheers,
> --renato
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list