Skip to content

Commit

Permalink
write parts of a README
Browse files Browse the repository at this point in the history
  • Loading branch information
webmiche committed Mar 23, 2022
1 parent 6753980 commit 43edfe9
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# xDSL

TODO
## Testing

xDSL includes pytest unit test and llvm-style filecheck tests. They can be executed using to following commands from within the root directory of the project:

```
# Executes pytests which are located in tests/
pytest
# Executes filecheck tests
lit test/filecheck
```

## Generating executables through MLIR

xDSL can generate executables using MLIR as the backend. To use this functionality, make sure to install the [MLIR Python Bindings](https://mlir.llvm.org/docs/Bindings/Python/). Given an input file `input.xdsl`, that contains IR with only the mirrored dialects found in `src/xdsl/dialects` (arith, memref, func, cf, scf, and builtin), run:

```
mlir-opt --convert-scf-to-cf --convert-cf-to-llvm --convert-func-to-llvm --convert-arith-to-llvm --convert-memref-to-llvm --reconcile-unrealized-casts *input.xdsl* | mlir-translate --mlir-to-llvmir > tmp.ll
```

The generated `tmp.ll` file contains LLVMIR, so it can be directly passed to a compiler like clang.

## Formatting

Expand Down

0 comments on commit 43edfe9

Please sign in to comment.