-
Notifications
You must be signed in to change notification settings - Fork 49
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
feat[next]: Flatten as_fieldop
tuple arguments
#1873
base: main
Are you sure you want to change the base?
feat[next]: Flatten as_fieldop
tuple arguments
#1873
Conversation
return let_expr | ||
|
||
|
||
def unwrap_scan(stencil: itir.Lambda | itir.FunCall): |
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.
This function has been moved, the only addition is the _remove_let_alias
call.
@@ -71,3 +71,79 @@ def is_equal(a: itir.Expr, b: itir.Expr): | |||
return a == b or ( | |||
CannonicalizeBoundSymbolNames.apply(a) == CannonicalizeBoundSymbolNames.apply(b) | |||
) | |||
|
|||
|
|||
def canonicalize_as_fieldop(expr: itir.FunCall) -> itir.FunCall: |
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.
This function has only been moved without changes.
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.
lgtm
Adds a new transformation in the collapse tuple pass that transforms all tuple arguments of an
as_fieldop
into multiple arguments, one for each element:(⇑(λ(it) → (·it)[1]))({1, 2})
into
(⇑(λ(__ct_flat_el0_it, __ct_flat_el1_it) → ·__ct_flat_el1_it))(1, 2)
Depends on #1868