Skip to content

HeapStoreOptimization: Migrate from invalidates to orderedBefore#8758

Draft
tlively wants to merge 6 commits into
mainfrom
heap-store-ordered-effects
Draft

HeapStoreOptimization: Migrate from invalidates to orderedBefore#8758
tlively wants to merge 6 commits into
mainfrom
heap-store-ordered-effects

Conversation

@tlively
Copy link
Copy Markdown
Member

@tlively tlively commented May 22, 2026

Replace the coarse invalidates check in HeapStoreOptimization with orderedBefore. This allows HeapStoreOptimization to optimize heap stores across release stores (e.g., moving a GC read before a release store), while still correctly blocking them from being moved before acquire loads.

Added a lit test to verify the asymmetrical reordering behavior with release/acquire atomics on shared GC structs and Wasm memory.

TAG=agy

tlively added 5 commits May 20, 2026 18:13
Replace the coarse `invalidates` check and the coarse global state check
in LICM with more precise `orderedBefore` checks. This allows LICM to
move memory accesses past release stores, while still correctly blocking
them from moving past acquire loads.

Add a lit test to verify the asymmetrical reordering behavior with
release/acquire atomics on shared memory/GC structs.
Replace the coarse `invalidates` check in `LocalCSE` with `orderedBefore`.
This allows `LocalCSE` to reuse expression values across release stores,
while still correctly blocking reuse across acquire loads.

Add a lit test to verify the asymmetrical reordering behavior with
release/acquire atomics on shared GC structs and Wasm memory.
Replace the coarse `invalidates` check in `CodePushing` with `orderedBefore`.
This allows `CodePushing` to push expressions (like GC reads) past acquire
loads, while still correctly blocking them from being pushed past release
stores.

Add a lit test to verify the asymmetrical reordering behavior with
release/acquire atomics on shared GC structs and Wasm memory.
Replace the coarse `invalidates` check in `HeapStoreOptimization` with `orderedBefore`. This allows `HeapStoreOptimization` to optimize heap stores across release stores (e.g., moving a GC read before a release store), while still correctly blocking them from being moved before acquire loads.

Added a lit test to verify the asymmetrical reordering behavior with release/acquire atomics on shared GC structs and Wasm memory.

TAG=agy
@tlively tlively requested a review from a team as a code owner May 22, 2026 06:44
@tlively tlively requested review from kripken and removed request for a team May 22, 2026 06:44
@tlively tlively changed the title LICM: Migrate from invalidates to orderedBefore HeapStoreOptimization: Migrate from invalidates to orderedBefore May 22, 2026
@tlively
Copy link
Copy Markdown
Member Author

tlively commented May 22, 2026

Oops, this was uploaded with an incorrect name. Fixed now.

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.

The title still seems wrong, this is not HeapStoreOptimization?

@tlively tlively marked this pull request as draft May 22, 2026 16:32
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