Skip to content

Remove the in-place rewrite mode - #306

Merged
maleadt merged 1 commit into
mainfrom
tb/remove_inplace
Aug 31, 2026
Merged

Remove the in-place rewrite mode#306
maleadt merged 1 commit into
mainfrom
tb/remove_inplace

Conversation

@maleadt

@maleadt maleadt commented Aug 31, 2026

Copy link
Copy Markdown
Member

The declarative inplace=true mode mutates matched producer operations. Its find_matched_ssa helper does not preserve pattern identity: it selects the first same-function user of a binding. A decoy operation can therefore be mutated even when the use-count guard proposed in #304 succeeds.

Remove the mode and express its sole comparison rule as a normal rewrite. The standard path builds a new interior addi and only replaces the matched cmpi root, leaving shared producers unchanged.

Teach RHS type inference to consider SSA values, block arguments, and kernel arguments, promoting scalar arguments to 0-D tiles. Add regressions for shared and decoy addi chains and for argument-only interior-operation typing.

Closes #304

The declarative `inplace=true` mode mutates matched producer operations.
Its `find_matched_ssa` helper does not preserve pattern identity: it
selects the first same-function user of a binding. A decoy operation can
therefore be mutated even when the use-count guard proposed in #304
succeeds.

Remove the mode and express its sole comparison rule as a normal rewrite.
The standard path builds a new interior addi and only replaces the matched
cmpi root, leaving shared producers unchanged.

Teach RHS type inference to consider SSA values, block arguments, and
kernel arguments, promoting scalar arguments to 0-D tiles. Add regressions
for shared and decoy addi chains and for argument-only interior-operation
typing.

Co-authored-by: Simeon David Schaub <simeon.schaub@enpc.fr>
@maleadt
maleadt merged commit 5717de1 into main Aug 31, 2026
1 check passed
@maleadt
maleadt deleted the tb/remove_inplace branch August 31, 2026 10:14
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.

1 participant