-
Notifications
You must be signed in to change notification settings - Fork 77
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: (eqsat) add pass to convert non-eclass functions to eclass #3189
Conversation
func.func @test(%x : index) -> (index) { | ||
%c2 = arith.constant 2 : index | ||
%res = arith.muli %x, %c2 : index | ||
func.return %res : index | ||
} | ||
|
||
// CHECK: Error while applying pattern: Ops with non-single results not handled |
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.
Oh interesting, I forgot about function returns, they seem useful enough to have from the get-go, could you please change the check to rather be len(results) > 1
? I would then recommend using the test
dialect in filecheck, to make sure we're testing exactly what we mean to test:
func.func @test(%x : index) -> (index) { | |
%c2 = arith.constant 2 : index | |
%res = arith.muli %x, %c2 : index | |
func.return %res : index | |
} | |
// CHECK: Error while applying pattern: Ops with non-single results not handled | |
func.func @test(%x : index) -> (index) { | |
%r0, %r1 = "test.op"() : () -> (index, index) | |
} | |
// CHECK: Error while applying pattern: Only single-result operations can be converted to eclasses, got 2 results |
(I also changed the message do include the length of the results, should hopefully help debug this in the future)
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.
Could you please add a test with a successful transform also?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3189 +/- ##
=======================================
Coverage 90.03% 90.04%
=======================================
Files 445 446 +1
Lines 56205 56239 +34
Branches 5399 5403 +4
=======================================
+ Hits 50606 50639 +33
+ Misses 4180 4177 -3
- Partials 1419 1423 +4 ☔ 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.
Perfect, thank you!
…eclass (xdslproject#3189) This PR addresses xdslproject#3170: - [x] Added initial front end pass `eqsat-create-eclasses` for the minimal example - [x] Added an initial test case for the pass
This PR addresses #3170:
eqsat-create-eclasses
for the minimal example