[Unity][Op] Allow the argument to call_tir
to be a var bound to a tuple, not a tuple literal
#15971
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_tir
and 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_tir
calls or treatingcall_tir
as 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.)