[cfe-dev] Clang Intermediate Language

Chris Lattner via cfe-dev cfe-dev at lists.llvm.org
Wed Feb 27 09:53:34 PST 2019


On Feb 25, 2019, at 6:12 PM, dalas via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> Hi, I mail to all here folks working on Clang Infrastructure.
> 
> I read the MLIR workshop talk slides, and wonder whether the Clang IL(Intermediate Language) has never implemented yet.
> 
> If not, is there any plan on implementing CIL and some progress on working on this topic?
> 
> Wish there is a news :) Cheers.
> 
> 
> P.S. Sorry if this question looks dumb because I am newbie into the Clang Infrastructure development team. Just wanna know how the Clang development group thinks on CIL and what thoughts are going on.

Hi Dalas,

I’d love to see this for a variety of reasons, it would:

 - consolidate the clang “CFG” with the mainline codegen infrastructure (providing more completeness and better testing)
 - improve the static analyzer infra and dataflow diagnostics in Clang by providing a complete representation
 - it would improve the existing “Codegen” by allowing it to be split up into less monolithic pieces, making it more maintainable and better testable.
 - provide a natural representation for library level optimizations, e.g. reference count optimizations of std::shared_ptr, automatically introducing reserve calls on containers before a loop of push_back’s, etc.
 - provide a new avenue to explore tooling that needs more flow sensitivity than is easy to express on ASTs.

That said, as far as I know there is no plan to implement this in Clang, and it would be a significant project.  MLIR is also not open source yet - stay tuned, coming in a couple months!

-Chris




More information about the cfe-dev mailing list