-
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]: Improve fieldop fusion #1764
feat[next]: Improve fieldop fusion #1764
Conversation
…p' into gtir_fuse_as_fieldop
@@ -119,9 +175,7 @@ def fuse_as_fieldop( | |||
pass | |||
elif cpm.is_call_to(arg, "if_"): |
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.
I was going through the whole file again and got stuck here. Can we briefly discuss
- if it makes the code cleaner, if instead of building an applied field_op we extract the stencil_body and args
- instead of special casing for
if
we support any function (because onlyif
should be marked as eligible, but if we change the algorithm to mark eligible, we should not have to touch this line)
target=node.target, | ||
) | ||
|
||
def visit_FunCall(self, node: itir.FunCall, **kwargs): |
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.
Let's rewrite the whole thing together for 2 reasons:
- knowledge sharing
- after it is now (maybe) correct, focus on readability.
Can we generate a complicated IR (which we also can easily maintain) as a performance regression test? |
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.
looks good for now. as discussed, it would be good to spend time later to improve interoperability of transformations.
I will create this as soon as we have the performance dashboard and I have some spare minutes. |
make_tuple(as_fieldop(...), as_fieldop(...))
calls intoas_fieldop(λ(...) → make_tuple(...))(...)
._arg_inline_predicate
.as_fieldop
args that use the same arg twice, e.g.as_fieldop(...)(a, b)
.itir.SetAt
are considered.