Skip to content

fix(mlir): per-function symbol reset for CF block args (#232) - #234

Merged
godofecht merged 1 commit into
mainfrom
fix/mlir-cf-block-arg-ptr-232
Aug 8, 2026
Merged

godofecht merged 1 commit into
mainfrom
fix/mlir-cf-block-arg-ptr-232

Conversation

@godofecht

Copy link
Copy Markdown
Contributor

Summary

  • Fixes #232: CF join edges were carrying a stale i → %arg0 : i32 from an earlier function while the current %arg0 was !llvm.ptr (W_CheckNumForName).
  • Snapshot module-scope symbols after the first pass; restore at each generate_function. Defense-in-depth: skip merge candidates whose mlir_type disagrees with _ssa_types.

Test plan

  • Unit test: earlier i: i32 param must not retag later string %arg0 in cf.br
  • doom-flow W_CheckNumForName now ends with cf.br ^bb56 (no typed %arg0 : i32)
  • Extracted W_CheckNumForName module passes mlir-opt

Made with Cursor

Params/locals from earlier functions were left in symbol_table, so a
stale `i → %arg0 : i32` leaked into later CF join edges while the
current `%arg0` was `!llvm.ptr` (W_CheckNumForName). Snapshot
module-scope symbols after the first pass and restore at each function;
also skip merge candidates whose mlir_type disagrees with _ssa_types.

Co-authored-by: Cursor <[email protected]>
@godofecht
godofecht merged commit eb9e9a4 into main Aug 8, 2026
14 checks passed
@godofecht
godofecht deleted the fix/mlir-cf-block-arg-ptr-232 branch August 8, 2026 03:01
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.

MLIR: CF block args type ptr function params as i32 (W_CheckNumForName)

1 participant