-
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
core: Block predecessors #3235
core: Block predecessors #3235
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3235 +/- ##
==========================================
- Coverage 90.07% 89.90% -0.17%
==========================================
Files 438 440 +2
Lines 54881 55344 +463
Branches 8523 8635 +112
==========================================
+ Hits 49433 49758 +325
- Misses 4065 4159 +94
- Partials 1383 1427 +44 ☔ 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.
Really cool! I thought it would be harder to implement, nice that there are actually only a few changes required!
I think IRWithUses
make sense to be honest, thanks for merging these concepts together!
@@ -1756,6 +1779,50 @@ def __next__(self): | |||
return next_block | |||
|
|||
|
|||
@dataclass | |||
class OpSuccessors(Sequence[Block]): |
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.
Really cool!
Co-authored-by: Sasha Lopoukhine <[email protected]>
Adds a list of uses to blocks, and adds a function to get the predecessors of a block. --------- Co-authored-by: Sasha Lopoukhine <[email protected]>
Adds a list of uses to blocks, and adds a function to get the predecessors of a block.
I'm slightly unsure about the code re-use in this PR. It feels slightly wrong to use the
Use
class for both operand usage and successor usage, though the data is the same. I'm also unsure if I should have attempted to unifyOpOperands
andOpSuccessors
under a single interface, as they are very similar.