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: add arg_types param to Block.split_before #1944

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

superlopuh
Copy link
Member

No description provided.

@superlopuh superlopuh added the core xDSL core (ir, textual format, ...) label Jan 5, 2024
@superlopuh superlopuh self-assigned this Jan 5, 2024
Copy link

codecov bot commented Jan 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9a268bd) 89.50% compared to head (0333a59) 89.49%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1944      +/-   ##
==========================================
- Coverage   89.50%   89.49%   -0.01%     
==========================================
  Files         279      279              
  Lines       34367    34387      +20     
  Branches     5094     5097       +3     
==========================================
+ Hits        30759    30776      +17     
- Misses       2873     2875       +2     
- Partials      735      736       +1     

☔ 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.

👍

@superlopuh superlopuh merged commit 37fff4b into main Jan 5, 2024
10 checks passed
@superlopuh superlopuh deleted the sasha/core/split-block-args branch January 5, 2024 14:25
@webmiche
Copy link
Collaborator

webmiche commented Jan 8, 2024

I guess block arguments are generally a bit of a headache for splitting blocks. E.g., what happens now if a moved op actually has a block argument of the original block as its operand? The IR will just be ill-formed, right? Maybe, we should try to catch this case in a test and make sure that IR is detected to be ill-formed.

Also, I guess you could also infer which block arguments the new block needs by looking at its def-use chain and seeing what is alive at the splitting point. But I guess that would kind of be overengineering at this point.

I am fine with the current solution, if we add the expected failure test I mentioned above and maybe a warning that this can be a problem. I guess it would be interesting at some point to look into a principled way of handling this in the splitting method, but for the moment, we can push the burden to the user.
(@superlopuh @math-fehr)

@superlopuh
Copy link
Member Author

Yeah there are helpers to add here, potentially, but I think that the assumption is that most often the newly created block will be dominated by the original, so all the values are in scope, no argument magic necessary. Let's add helpers when we come across a use-case where that's not true.

@webmiche
Copy link
Collaborator

webmiche commented Jan 8, 2024

What do you think about the testcase I mentioned? You want me to open an issue, right? 😜

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, ...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants