|
1 | 1 | # ClangIR (CIR)
|
2 | 2 |
|
| 3 | +## Work-in-progress on CIR→MLIR lowering |
| 4 | + |
| 5 | +This is a huge work-in-progress version adding new features used by [`aie++` C++ |
| 6 | +programming model](https://github.com/keryell/mlir-aie/tree/clangir), such as |
| 7 | +better support for lowering through MLIR standard dialects. |
| 8 | + |
| 9 | +What is experimented here: |
| 10 | +- adding new features to CIR→MLIR lowering; |
| 11 | +- cleaner lowering C/C++arrays as `tensor` for value semantics (for example in |
| 12 | + structs) and `memref` for reference semantics (all the other uses); |
| 13 | +- fixing array support and allocation; |
| 14 | +- allowing pointer to array or struct; |
| 15 | +- adding support for class/struct/union by first experimenting with `tuple` and |
| 16 | + then introducing a new `named_tuple` dialect; |
| 17 | +- implementation of more type of C/C++ casts; |
| 18 | +- support struct member access through some `memref` flattening and casting |
| 19 | + casting; |
| 20 | +- fixing a lot of verification bugs which are triggered when using ClangIR in a |
| 21 | + broader framework; |
| 22 | +- enabling in-lining interface to CIR dialect; |
| 23 | +- exposing some API to use ClangIR from a broader framework. |
| 24 | + |
| 25 | +The output of this new lowering flow has not been tested yet followed by the |
| 26 | +MLIR std→LLVMIR. |
| 27 | + |
| 28 | +An alternative design could be to rely on some MLIR std→LLVMIR→MLIR std |
| 29 | +back-and-forth traveling in the same module to have some parts of the LLVMIR |
| 30 | +dialect to implement some missing features like it is done in the |
| 31 | +[Polygeist](https://github.com/llvm/Polygeist) project. |
| 32 | + |
| 33 | +## Main documentation |
| 34 | + |
3 | 35 | Check https://clangir.org for general information, build instructions and documentation.
|
0 commit comments