[CuTeDSL] Fix loop carried target scope (#3200)

* [CuTeDSL] Bug fix for scf.for's write_args analysis

* [CuTeDSL] Add for loop test
This commit is contained in:
TungtungQia
2026-05-11 16:02:26 +08:00
committed by GitHub
parent ae6bccf341
commit 1d9e1f6d7a
2 changed files with 46 additions and 2 deletions

View File

@@ -1645,10 +1645,10 @@ class DSLPreprocessor(ast.NodeTransformer):
target_var_is_active_before_loop = False
if isinstance(node.target, ast.Name):
target_var_name = node.target.id
for active_symbol in active_symbols:
for idx, active_symbol in enumerate(active_symbols):
if target_var_name in active_symbol:
target_var_is_active_before_loop = True
active_symbols.remove(active_symbol)
active_symbols[idx] = active_symbol - {target_var_name}
break
# Add necessary exprs to handle this