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

dialects: (pdl) simplify rewrite pattern and implementations #1163

Merged
merged 4 commits into from Jun 20, 2023

Conversation

superlopuh
Copy link
Member

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.

@superlopuh superlopuh added the dialects Changes on the dialects label Jun 19, 2023
@superlopuh superlopuh self-assigned this Jun 19, 2023
@codecov
Copy link

codecov bot commented Jun 19, 2023

Codecov Report

Patch coverage: 91.66% and project coverage change: +0.02 🎉

Comparison is base (bb28485) 87.25% compared to head (5471517) 87.27%.

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     
Impacted Files Coverage Δ
tests/interpreters/test_pdl_interpreter.py 90.97% <60.00%> (-1.78%) ⬇️
xdsl/interpreters/experimental/pdl.py 74.15% <100.00%> (+2.65%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

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.

👍

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

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):
Copy link
Collaborator

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?

@superlopuh superlopuh merged commit 7ca8b2d into main Jun 20, 2023
12 checks passed
@superlopuh superlopuh deleted the sasha/interpreter/pdl-less-weird branch June 20, 2023 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialects Changes on the dialects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants