-
Notifications
You must be signed in to change notification settings - Fork 85
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 (scf): Canonicalization for const rehoisting #3421
dialects (scf): Canonicalization for const rehoisting #3421
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3421 +/- ##
=======================================
Coverage 90.16% 90.16%
=======================================
Files 455 455
Lines 57467 57509 +42
Branches 5532 5536 +4
=======================================
+ Hits 51815 51854 +39
- Misses 4195 4196 +1
- Partials 1457 1459 +2 ☔ 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.
Thank you!
rewriter.insert_op_before_matched_op([new_const := child_op.clone()]) | ||
rewriter.replace_op(child_op, [], new_const.results) |
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:
rewriter.insert_op_before_matched_op([new_const := child_op.clone()]) | |
rewriter.replace_op(child_op, [], new_const.results) | |
rewriter.insert_op_before_matched_op((new_const := child_op.clone(),)) | |
rewriter.replace_op(child_op, (), new_const.results) |
@@ -1,4 +1,4 @@ | |||
// RUN: xdsl-opt -p canonicalize %s | filecheck %s | |||
// RUN: xdsl-opt -p canonicalize --split-input-file %s | filecheck %s |
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.
is this needed?
We want to carry out constant definition from loop definition to allow more loop optimizations. In mlir this is done in cse on constants inside the `applyPatternsAndFoldGreedily` function in the PatternRewriter. In the future we might port this functionality so this pattern will become redundant.
We want to carry out constant definition from loop definition to allow more loop optimizations. In mlir this is done in cse on constants inside the
applyPatternsAndFoldGreedily
function in the PatternRewriter. In the future we might port this functionality so this pattern will become redundant.