Skip to content

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
@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