Skip to content

OptimizeCasts: Migrate from invalidates to orderedBefore#8774

Merged
tlively merged 2 commits into
mainfrom
optimize-casts-ordered-effects
May 26, 2026
Merged

OptimizeCasts: Migrate from invalidates to orderedBefore#8774
tlively merged 2 commits into
mainfrom
optimize-casts-ordered-effects

Conversation

@tlively
Copy link
Copy Markdown
Member

@tlively tlively commented May 26, 2026

Replace the coarse 'invalidates' check in 'OptimizeCasts' with 'orderedBefore'. This is a cleanup to use the more precise directional effects check.

Also add a new lit test to verify that casts (which have trap effects) are correctly allowed to move past global state reads but blocked by global state writes.

TAG=agy

Replace the coarse 'invalidates' check in 'OptimizeCasts' with 'orderedBefore'. This is a cleanup to use the more precise directional effects check.

Also add a new lit test to verify that casts (which have trap effects) are correctly allowed to move past global state reads but blocked by global state writes.

TAG=agy
@tlively tlively requested a review from a team as a code owner May 26, 2026 16:34
@tlively tlively requested review from aheejin and removed request for a team May 26, 2026 16:34
@tlively
Copy link
Copy Markdown
Member Author

tlively commented May 26, 2026

Looks like there are some unrelated failures on Windows:

Failed Tests (4):
  Binaryen lit tests :: d8/fuzz_shell.wast
  Binaryen lit tests :: d8/fuzz_shell_exceptions.wast
  Binaryen lit tests :: d8/fuzz_shell_jspi.wast
  Binaryen lit tests :: d8/fuzz_shell_sleep.wast

But I can't repro locally on Linux with the latest V8 from JSVU :/

;; CHECK: (func $disallowed (type $1) (param $x (ref $struct))
;; CHECK-NEXT: (call $foo
;; CHECK-NEXT: (block $label1 (result i32)
;; CHECK-NEXT: (block $block (result i32)
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.

Why this change?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is a fix to unrelated tests that were breaking CI. I landed this separately in #8777.

@aheejin
Copy link
Copy Markdown
Member

aheejin commented May 26, 2026

Looks like there are some unrelated failures on Windows:

Failed Tests (4):
  Binaryen lit tests :: d8/fuzz_shell.wast
  Binaryen lit tests :: d8/fuzz_shell_exceptions.wast
  Binaryen lit tests :: d8/fuzz_shell_jspi.wast
  Binaryen lit tests :: d8/fuzz_shell_sleep.wast

But I can't repro locally on Linux with the latest V8 from JSVU :/

I can't repro them in my Cloudtop either...

@tlively tlively merged commit 818de5e into main May 26, 2026
31 of 32 checks passed
@tlively tlively deleted the optimize-casts-ordered-effects branch May 26, 2026 22:53
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