-
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
core: always print unregistered ops #3303
Conversation
@AntonLydike feel free to add your example as a test case |
If not I can make one |
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.
Code change looks good and a simple "unregistered_op"() : () -> ()
should work as a test, right?
I added a small test, but in the process found that the implicit terminator stuff in |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3303 +/- ##
=======================================
Coverage 90.01% 90.02%
=======================================
Files 445 445
Lines 55926 55979 +53
Branches 5358 5365 +7
=======================================
+ Hits 50341 50394 +53
Misses 4177 4177
Partials 1408 1408 ☔ View full report in Codecov by Sentry. |
@compor I believe you last touched this code, do you know what the intended behaviour is supposed to be? |
"unregistered_op"() : () -> () | ||
scf.yield |
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.
Am I missing something?
"unregistered_op"() : () -> () | |
scf.yield | |
"unregistered_op"() : () -> () |
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.
You're missing that I believe this doesn't verify as the implicit terminator isn't added, due to an unrelated problem this pr was trying to solve. (scf.for
expects to be terminated by an scf.yield
)
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 confused, does this test not pass on main?
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.
OK I just tested it out myself and became more confused :) I think a part of the problem is that the code in the printer is a little backwards, and would benefit from a comment. It might also benefit from a bit of a refactor, it feels a little wasteful to check for terminator trait for every operation that we print, when they can only be the last operation in the block. That's probably out of scope for this PR though.
"unregistered_op"() : () -> () | ||
scf.yield |
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.
OK I just tested it out myself and became more confused :) I think a part of the problem is that the code in the printer is a little backwards, and would benefit from a comment. It might also benefit from a bit of a refactor, it feels a little wasteful to check for terminator trait for every operation that we print, when they can only be the last operation in the block. That's probably out of scope for this PR though.
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 for the fix!
`scf.for` prints it's blocks without terminators if there are no `iter_args`. Unfortunately the check for whether an operation is a terminator returns true by default for unregistered operations (presumably so that they don't break verification), and so they don't get printed. This change should make it so that these ops always get printed.
scf.for
prints it's blocks without terminators if there are noiter_args
. Unfortunately the check for whether an operation is a terminator returns true by default for unregistered operations (presumably so that they don't break verification), and so they don't get printed.This change should make it so that these ops always get printed.