Open
Conversation
sjfeng1999
reviewed
Apr 14, 2026
sjfeng1999
reviewed
Apr 14, 2026
sjfeng1999
reviewed
Apr 14, 2026
sjfeng1999
previously approved these changes
Apr 16, 2026
The AST rewriter's control_flow_scope pop loses variables defined in const_expr if blocks from the symbol scope. When a later bare if (without const_expr) is encountered, the rewriter treats it as dynamic and rewrites it into closures via scf_if_dispatch. Variables like val_s defined earlier don't get passed as parameters, causing UnboundLocalError at compile time. Fix: wrap all bare if/elif conditions inside @flyc.kernel (kernel_gemm) and @flyc.jit (launch_gemm) with const_expr(), since they are all compile-time Python constants. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
…scheduler use_mfma_k32 and _is_gfx950 are compile-time constants; leaving them as bare if/elif causes the AST rewriter to treat them as dynamic branches, which can lead to scope/type errors via scf_if_dispatch. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
…_kernel Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
…ernel Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Scope analysis.
Dynamic judgment.
Rectification of non-standard test cases.
Correct construction of scf.if.
Technical Details
Test Plan
Test Result
Submission Checklist