Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dialects #81

Merged
merged 5 commits into from
Mar 24, 2022
Merged

Update dialects #81

merged 5 commits into from
Mar 24, 2022

Conversation

webmiche
Copy link
Collaborator

This updates our mirrored dialects. In partiuclar, moves std to func, and moves the funcOp from builtin to func.

@webmiche webmiche requested a review from math-fehr March 23, 2022 09:35
@webmiche
Copy link
Collaborator Author

I had some weird behaviour: After installing the rewritten dialects with pip install ., most tests would still work, i.e., std.return would still be parsed, the imports of std still work...
On the CI however, these cases failed. I am uncertain how my local environment differs from the CI. Could it be that pip does not clean up properly when reinstalling something directly?

@tobiasgrosser
Copy link
Contributor

Nice! Good from my side. Maybe @math-fehr has some further input.

README.md Outdated
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can we directly use an input.xdsl file in MLIR?
Don't we need to use mlir_converter or something like that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right, it should actually be passed through the mlir_converter aswell. I will think about how to properly integrate the tooling from the ChocoPy repo into xdsl. (I will probably add .mlir as a target to xdsl_opt, similar to how we did in choco-opt)

Copy link
Collaborator

@math-fehr math-fehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides my documentation comment, looks good to me!

Copy link
Collaborator

@Dinistro Dinistro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.
There are some ugly things in the files touched by this PR, but changing this is not related to it.

@webmiche webmiche merged commit ffbaf9d into main Mar 24, 2022
@Dinistro Dinistro deleted the update_dialects branch March 24, 2022 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants