Skip to content
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

[Relax][Analysis] Handle recursive functions in CollectVarUsage #17224

Merged

Conversation

Lunderberg
Copy link
Contributor

Prior to this commit, the relax::analysis::CollectVarUsage utility treated a local function definition as in-scope after visiting the body of the local function. As a result, recursive calls from a local function were incorrectly identified as calls to an undefined variable.

This commit updates the CollectVarUsage to treat a local function definition as in-scope when inspecting the function body. This change is similar to the change made for structural equality in #16756.

Prior to this commit, the `relax::analysis::CollectVarUsage` utility
treated a local function definition as in-scope after visiting the
body of the local function.  As a result, recursive calls from a local
function were incorrectly identified as calls to an undefined
variable.

This commit updates the `CollectVarUsage` to treat a local function
definition as in-scope when inspecting the function body.  This change
is similar to the change made for structural equality in
apache#16756.
Copy link
Member

@yongwww yongwww left a comment

Choose a reason for hiding this comment

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

LGTM

@yongwww yongwww merged commit ed9aa56 into apache:main Aug 22, 2024
19 checks passed
@Lunderberg Lunderberg deleted the relax_dce_handle_recursive_function_definitions branch August 22, 2024 16:50
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