Skip to content
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

Merged
merged 3 commits into from
Oct 3, 2024
Merged

core: Block predecessors #3235

merged 3 commits into from
Oct 3, 2024

Conversation

alexarice
Copy link
Collaborator

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 unify OpOperands and OpSuccessors under a single interface, as they are very similar.

@alexarice alexarice added testing PRs that modify tests core xDSL core (ir, textual format, ...) labels Oct 2, 2024
@alexarice alexarice self-assigned this Oct 2, 2024
Copy link

codecov bot commented Oct 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.90%. Comparing base (07e8eba) to head (4b5d859).
Report is 6 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@math-fehr math-fehr left a 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]):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really cool!

tests/test_use.py Outdated Show resolved Hide resolved
tests/test_use.py Outdated Show resolved Hide resolved
alexarice and others added 2 commits October 3, 2024 09:38
Co-authored-by: Sasha Lopoukhine <[email protected]>
@alexarice alexarice merged commit 335d200 into main Oct 3, 2024
14 checks passed
@alexarice alexarice deleted the alexarice/predecessor branch October 3, 2024 08:55
emmau678 pushed a commit that referenced this pull request Oct 8, 2024
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core xDSL core (ir, textual format, ...) testing PRs that modify tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants