-
Notifications
You must be signed in to change notification settings - Fork 72
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
transformations: Add convert-arith-to-varith pass #3242
Conversation
3ea0950
to
65f9823
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3242 +/- ##
=======================================
Coverage 89.92% 89.92%
=======================================
Files 441 442 +1
Lines 55417 55479 +62
Branches 8643 8655 +12
=======================================
+ Hits 49832 49889 +57
- Misses 4158 4161 +3
- Partials 1427 1429 +2 ☔ View full report in Codecov by Sentry. |
65f9823
to
f6ec47f
Compare
f6ec47f
to
a377199
Compare
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.
Thanks, looks good!
|
||
class MergeVarithOpsPattern(RewritePattern): | ||
""" | ||
Merges operands that are varith or arith ops into |
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'm not quite sure what you mean here
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.
Expanded on it!
if len(possibly_erased_ops) == 0: | ||
return | ||
|
||
rewriter.replace_matched_op(type(op)(*new_operands)) # pyright: ignore[reportUnknownArgumentType] |
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.
nit: Could you include a comment for why you need to ignore the warning?
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.
Done!
5f622a5
to
f5d7ec2
Compare
Adds a pass `convert-arith-to-varith` that converts arith adds and muls to varith adds and muls.
Adds a pass
convert-arith-to-varith
that converts arith adds and muls to varith adds and muls. More tests coming.Stacked on top of #3241