[Unity][Op] Allow the argument to call_tir to be a var bound to a tuple, not a tuple literal#15971
Closed
slyubomirsky wants to merge 2 commits intoapache:unityfrom
Closed
[Unity][Op] Allow the argument to call_tir to be a var bound to a tuple, not a tuple literal#15971slyubomirsky wants to merge 2 commits intoapache:unityfrom
call_tir to be a var bound to a tuple, not a tuple literal#15971slyubomirsky wants to merge 2 commits intoapache:unityfrom
Conversation
quic-sanirudh
approved these changes
Oct 25, 2023
Contributor
quic-sanirudh
left a comment
There was a problem hiding this comment.
LGTM, thanks for the quickfix
Contributor
|
This may be a duplicate of #15916, which also resolves the analogous problem for |
Contributor
Oh nice, this is great, thanks for this. I was running to issues in the some of the same passes when testing locally, and so I was starting to work on a fix to follow up this PR, but looks like they're all fixed in #15916, that saves me a bunch of time 😄, so thanks again for that. |
Contributor
Author
|
Didn't see it, yep, they're duplicates. There is one case that the other PR misses so hopefully that can be updated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In response to the issue in common subexpression elimination noted in this forum post, this PR fixes the case noted by allowing
call_tirand its variants to correctly handle the case where they are passed a variable bound to a tuple of arguments, rather than a tuple literal. This was an easy change to make and corresponds to user expectations.In principle, we could address the issue highlighted in other ways, such as by changing common subexpression elimination to avoid doing elimination inside
call_tircalls or treatingcall_tiras a special case during normalization. I went with this approach because I believe it to be simpler; however, we may consider other approaches if it is absolutely essential that the argument be a tuple literal. (I would argue that that would not be a particularly good design.)