Skip to content

[FIX][TIRx] Remap buffers consistently in ConvertSSA - #20069

Merged
spectrometerHBH merged 1 commit into
apache:mainfrom
jinhongyii:upstream/tirx-convertssa-buffer-remap
Jul 29, 2026
Merged

[FIX][TIRx] Remap buffers consistently in ConvertSSA#20069
spectrometerHBH merged 1 commit into
apache:mainfrom
jinhongyii:upstream/tirx-convertssa-buffer-remap

Conversation

@jinhongyii

Copy link
Copy Markdown
Contributor

Motivation and context

ConvertSSA caches remapped buffers while an SSA-renamed variable is in scope. Cleanup previously removed a cached buffer only when the renamed variable was its data pointer, so remaps through other buffer fields could survive after scope exit.

Changes

  • Track dependencies in every buffer field rewritten by GetRemappedBuffer, including shape, strides, element offset, and tile layout fields.
  • Invalidate cached remaps consistently when an SSA-renamed variable leaves scope.
  • Add a regression using reused sibling loop variables and a variable-dependent element offset.

Testing

  • python -m pytest tests/python/tirx-transform/test_tir_transform_convert_ssa.py
  • Changed-files pre-commit checks

ConvertSSA caches remapped buffers while an SSA-renamed variable is in scope. The cleanup previously popped a cached buffer only when the renamed variable was its data pointer, leaving remaps through elem_offset, shape, strides, or tile layout fields alive after scope exit.

Recognize dependencies in every field rewritten by GetRemappedBuffer, and add a regression with reused sibling loop variables and a variable-dependent elem_offset.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@spectrometerHBH
spectrometerHBH merged commit 0fbc04b into apache:main Jul 29, 2026
8 checks passed
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