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

[docs] Add basic pass tutorial #7012

Merged
merged 15 commits into from
May 10, 2024
Merged

[docs] Add basic pass tutorial #7012

merged 15 commits into from
May 10, 2024

Conversation

dobios
Copy link
Member

@dobios dobios commented May 9, 2024

Getting Started contains a decent amount of info but lacks a good tutorial for people who want to quickly learn how to hack together a working CIRCT pass. This PR adds a really basic tutorial that hopefully does just that.

I also added the -DLLVM_ENABLE_LLD=true flag to the cmake tutorial, because everyone should be using lld, it reduces the memory usage during linking by orders of magnitude.

Let me know what you all think!

@dobios dobios added the documentation Improvements or additions to documentation label May 9, 2024
Copy link
Contributor

@teqdruid teqdruid left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for doing this. You can separate out the LLD bits and just push them to main.

You should also point out that a more complete tutorial about all aspects of MLIR design (CIRCT just being a set of MLIR dialects and passes) is available in the MLIR repo/documentation. In general, we need to plaster these types of comments all over the documentation.

There's nothing worse than an outdated tutorial, so as a future improvement we should separate out the pass, put the tutorial code in its own directory, and write tests for it.

docs/GettingStarted.md Outdated Show resolved Hide resolved
docs/GettingStarted.md Outdated Show resolved Hide resolved
docs/GettingStarted.md Outdated Show resolved Hide resolved
docs/GettingStarted.md Outdated Show resolved Hide resolved
docs/GettingStarted.md Outdated Show resolved Hide resolved
docs/GettingStarted.md Outdated Show resolved Hide resolved
docs/GettingStarted.md Outdated Show resolved Hide resolved
docs/GettingStarted.md Outdated Show resolved Hide resolved
docs/GettingStarted.md Outdated Show resolved Hide resolved
docs/GettingStarted.md Outdated Show resolved Hide resolved
docs/GettingStarted.md Outdated Show resolved Hide resolved
docs/GettingStarted.md Outdated Show resolved Hide resolved
@dobios
Copy link
Member Author

dobios commented May 9, 2024

#7018 Let me know if you all agree with the flags I added.

@dobios dobios requested a review from darthscsi as a code owner May 9, 2024 19:23
@dobios dobios changed the title [docs] Added basic pass tutorial [docs] Add basic pass tutorial May 9, 2024
@dobios
Copy link
Member Author

dobios commented May 9, 2024

Better?

@@ -67,7 +67,7 @@ $ mkdir llvm/build
$ cd llvm/build
$ cmake -G Ninja ../llvm \
-DLLVM_ENABLE_PROJECTS="mlir" \
-DLLVM_TARGETS_TO_BUILD="X86;RISCV" \
-DLLVM_TARGETS_TO_BUILD="s/X86;RISCV/host/" \
Copy link
Member

Choose a reason for hiding this comment

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

maybe mistake?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah substitution error on my end, should be just host

@dobios dobios merged commit 0d120ca into main May 10, 2024
2 checks passed
@dobios dobios deleted the dev/dobios/docs-improvement branch May 10, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants