project-ideas icon indicating copy to clipboard operation
project-ideas copied to clipboard

MLIR support for LDC

Open thewilsonator opened this issue 6 years ago • 4 comments
trafficstars

Description

Multi-Level Intermediate Representation (MLIR) was recently announced as higher level IR for semantic aware transformation for optimisations. It is expected to be integrated into the LLVM project in the near future. MLIR represents an opportunity to leverage advanced optimisations at a higher level than that available in LLVM and target other systems such as .

What are rough milestones of this project?

Become familiar with the LDC & MLIR codebases.

Compile D through the LLVM dialect of MLIR.

Port some basic LDC specific optimisations (e.g. GC2Stack) as a D Dialect of MLIR to verify the functioning of optimisation with MLIR.

Expose the ability to utilise other MLIR dialects such as Affine (for polyhedral optimisations) and Vector

Investigate the ability to generate XLA with MLIR for use with Tensorflow.

How does this project help the D community?

Allow the utilisation of advanced optimisations for D code and potentially generate XLA for use with Tensorflow.

Recommended skills

  • C++ (insofar as the style that is used by LLVM, nothing too arcane needed)
  • Some Experience with compilers (ASTs, SSA-IRs, IR transformations)
  • Experience with LLVM is an added bonus.
  • Experience with D nice, but not necessary.

What can students expect to get out of doing this project?

Get experience with cutting edge high level compiler optimisation techniques and apply them to a production compiler.

An opportunity to present the work done at EuroLLVM (May 2020 Europe) (or LLVM Developers Meeting October 2020 San Jose) and possibly other conferences (e.g. Tensorflow Dev Summit).

Point of Contact

@thewilsonator (Nicholas Wilson)

Other references

thewilsonator avatar May 10 '19 15:05 thewilsonator

Isn't this already done @thewilsonator https://github.com/ldc-developers/ldc/pull/3313 or not fully supported?

ljmf00 avatar Nov 29 '21 16:11 ljmf00

Isn't this already done @thewilsonator ldc-developers/ldc#3313 or not fully supported?

MLIR is a whole thing in itself vs. the stuff present in LDC at the moment (i.e. it's a deep rabbit hole if you want to use it at full strength).

maxhaton avatar Nov 29 '21 23:11 maxhaton

Shouldn't this be an issue under ldc? Why is it a project here?

ibuclaw avatar Nov 30 '21 08:11 ibuclaw

GSoC

thewilsonator avatar Nov 30 '21 08:11 thewilsonator