Aim: A modern library for building production-grade compilers
Status
In the long term, the aim for xrcf is to allow building compilers that can compile any programming language to any target architecture.
In the near term, the aim is to use xrcf to build a fully functional compiler that can compile the ArnoldC language to an executable. To see the compiler in action, see the walkthrough. ArnoldC is just a test case. If xrcf can handle it well, then it will be useful for other compiler projects too.
Lowering to CPU
In the table below, a checkmark ✅ means that at least one implementation exists which can lower the construct to code that can be executed on the CPU (via LLVM).
Construct | MLIR | LLVM dialect | LLVM IR |
---|---|---|---|
functions | ✅ | ✅ | ✅ |
add | ✅ | ✅ | ✅ |
✅ | ✅ | ✅ | |
if else | ✅ | ✅ | ✅ |
for loop | |||
while loop | |||
... |
For example, this table means that print can be lowered from MLIR to the LLVM dialect and then to LLVM IR.
This means that to get your own print
operation to run on the CPU, you only need to convert your own print
operation to MLIR.
From there, xrcf can be used to run your code on the CPU.
Lowering to GPU
High on the priority list.