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
dialects: (pdl) simplify rewrite pattern and implementations #1163
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1163 +/- ##
==========================================
+ Coverage 87.25% 87.27% +0.02%
==========================================
Files 145 145
Lines 21411 21391 -20
Branches 3224 3220 -4
==========================================
- Hits 18682 18669 -13
+ Misses 2223 2219 -4
+ Partials 506 503 -3
☔ View full report in Codecov by Sentry. |
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.
👍
operation fits the specified pattern and, if so, assigns the xDSL values | ||
to the corresponding PDL SSA values, and runs the rewrite operations one by | ||
one. The implementations in this class are for the RHS of the rewrite. | ||
The implementations in this class are for the RHS of the rewrite. |
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.
Can you add a more detailed documentation here?
What does this do? Is it the interpreter for a pdl.rewrite
?
Has the operation already been matched? Where are they stored?
@@ -209,17 +221,10 @@ def match_and_rewrite(self, xdsl_op: Operation, rewriter: PatternRewriter) -> No | |||
@dataclass | |||
class PDLFunctions(InterpreterFunctions): |
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.
Should you rename this since this only interpret the RHS?
This PR aims to make the interpretation of the rewrite a bit less convoluted. Instead of interpreting the whole module, the rewrite pattern now interprets just the RewriteOp.