-
Notifications
You must be signed in to change notification settings - Fork 73
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
Canonicalizers and Declarative Rewrite Patterns #19
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9f4a7ab
slight formatting changes
j2kun 8fb25f5
Add empty canonicalizers to poly binops
j2kun f556f6e
dyn_cast -> dyn_cast_or_null
j2kun 7b9f282
Canonicalize a difference of squares
j2kun 2235f84
upgrade eval to accept complex inputs
j2kun e55bab9
Add tablegen pattern to lift conj through eval
j2kun 69a18e9
add generated patterns to eval canonicalizer
j2kun 6dea94a
rewrite DifferenceOfSquares in tablegen
j2kun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef LIB_DIALECT_POLY_POLYPATTERNS_TD_ | ||
#define LIB_DIALECT_POLY_POLYPATTERNS_TD_ | ||
|
||
include "PolyOps.td" | ||
include "mlir/Dialect/Complex/IR/ComplexOps.td" | ||
include "mlir/IR/PatternBase.td" | ||
|
||
def LiftConjThroughEval : Pat< | ||
(Poly_EvalOp $f, (ConjOp $z)), | ||
(ConjOp (Poly_EvalOp $f, $z)) | ||
>; | ||
|
||
#endif // LIB_DIALECT_POLY_POLYPATTERNS_TD_ |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was following the tutorial and got stuck here e55bab9 with MLIR v18.1.x. I've described the issue on the LLVM repo here in detail. Just wanted to know if someone else has also faced this issue as I couldn't find the solution for it.
EDIT: This issue with the API was fixed later in the tutorial in the commits fa6d030 and d2e0a72 of #26. It has to do with the API changes with Complex operators like
ConjOp
now requiring two arguments$input
and attribute$fastmath
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I haven't seen people use MLIR by installing the tools as separate binaries, and instead they tend to build everything from source at a specific LLVM commit (or HEAD).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must admit I'm not very familiar with the standard MLIR development process. Building a large project like LLVM can take some time on potato computers or in CI/CD setups. So I prefer stable binary releases for such dependencies as they enable faster "clean build" iterations. The dependencies are supposed to be frozen anyway! :)
I also faced problems with some MLIR support tools (LSP servers in particular) when building from source (I filed that issue here).