Skip to content

MergeBlocks: Migrate from invalidates to orderedBefore#8767

Open
tlively wants to merge 1 commit into
mainfrom
merge-blocks-ordered-effects
Open

MergeBlocks: Migrate from invalidates to orderedBefore#8767
tlively wants to merge 1 commit into
mainfrom
merge-blocks-ordered-effects

Conversation

@tlively
Copy link
Copy Markdown
Member

@tlively tlively commented May 23, 2026

Replace the coarse 'invalidates' check in 'MergeBlocks' with 'orderedBefore'. This allows 'MergeBlocks' to move expressions (like GC reads) out of blocks past other sibling expressions that have been left behind.

Also clean up dead code in 'optimize()' by removing the unused 'dependency1' and 'dependency2' parameters and their checks (which were the other two replaced 'invalidates' calls that are no longer active).

TAG=agy

Replace the coarse 'invalidates' check in 'MergeBlocks' with 'orderedBefore'. This allows 'MergeBlocks' to move expressions (like GC reads) out of blocks past other sibling expressions that have been left behind.

Also clean up dead code in 'optimize()' by removing the unused 'dependency1' and 'dependency2' parameters and their checks (which were the other two replaced 'invalidates' calls that are no longer active).

TAG=agy
@tlively tlively requested a review from a team as a code owner May 23, 2026 00:49
@tlively tlively requested review from aheejin and removed request for a team May 23, 2026 00:49
Comment on lines +15 to +17
;; Test 1: Disallowed reordering (GC read NOT moved before Wasm acquire load)
;; Child 0 is named, so it is NOT optimized and its effects (acquire load) are left behind.
;; Child 1 tries to move the GC read out, which should be blocked because it cannot move before the acquire load.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIt: Comment 80-col wrapping. The same for Test 2

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