Skip to content

Conversation

@havogt
Copy link
Contributor

@havogt havogt commented Jul 11, 2025

Before this PR (λ(x, y) → f(x, x + y))(y + y, x) with opcount_preserving=True would inline to (λ(x) → f(x, x + x))(y + y) because the outer x vs the lambda parameter x was not properly handled.
Now, in case of such a conflict, the lambda is first transformed to λ(x_, y) → f(x_, x_ + y).

@havogt havogt requested a review from egparedes July 11, 2025 05:19
@havogt
Copy link
Contributor Author

havogt commented Jul 11, 2025

Fixes the bug in #1713 test_lap_like.

Copy link
Contributor

@egparedes egparedes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@havogt havogt merged commit 416e713 into GridTools:main Jul 11, 2025
23 checks passed
philip-paul-mueller pushed a commit to philip-paul-mueller/gt4py that referenced this pull request Jul 15, 2025
Before this PR `(λ(x, y) → f(x, x + y))(y + y, x)` with
`opcount_preserving=True` would inline to `(λ(x) → f(x, x + x))(y + y)`
because the outer `x` vs the lambda parameter `x` was not properly
handled.
Now, in case of such a conflict, the lambda is first transformed to
`λ(x_, y) → f(x_, x_ + y)`.
stubbiali pushed a commit to stubbiali/gt4py that referenced this pull request Aug 19, 2025
Before this PR `(λ(x, y) → f(x, x + y))(y + y, x)` with
`opcount_preserving=True` would inline to `(λ(x) → f(x, x + x))(y + y)`
because the outer `x` vs the lambda parameter `x` was not properly
handled.
Now, in case of such a conflict, the lambda is first transformed to
`λ(x_, y) → f(x_, x_ + y)`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants