Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Account for global effects in LinearExecutionWalker - #8637

#8637
Merged
stevenfontanella merged 2 commits into
mainWebAssembly/binaryen:mainfrom
linear-executionWebAssembly/binaryen:linear-executionCopy head branch name to clipboard
Apr 22, 2026
Merged

Account for global effects in LinearExecutionWalker#8637
stevenfontanella merged 2 commits into
mainWebAssembly/binaryen:mainfrom
linear-executionWebAssembly/binaryen:linear-executionCopy head branch name to clipboard

Conversation

@stevenfontanella

@stevenfontanella stevenfontanella commented Apr 21, 2026

Copy link
Copy Markdown
Member

When --enable-exception-handling is true, we previously assumed that every call throws in LinearExecutionWalker which prevented some opportunities for optimizing locals (and potentially other optimizations in passes that use this class). Change the code to make use of global effects when present.

The following passes use LinearExecutionWalker:

  • LocalGraph
  • LocalCSE
  • OptimizeCasts
  • SimplifyGlobals
  • SimplifyLocals

It's also used in ContentOracle which is used in GUFA and TypeRefining.

@stevenfontanella

Copy link
Copy Markdown
Member Author

Running the fuzzer now.

@stevenfontanella
stevenfontanella marked this pull request as ready for review April 21, 2026 23:14
@stevenfontanella
stevenfontanella requested a review from a team as a code owner April 21, 2026 23:14
@stevenfontanella
stevenfontanella requested review from aheejin and removed request for a team April 21, 2026 23:14
@stevenfontanella

Copy link
Copy Markdown
Member Author

Running the fuzzer now.

Ran the fuzzer overnight for 17k iterations with no issues.

Comment thread src/ir/linear-execution.h Outdated
Comment thread src/ir/linear-execution.h Outdated
Comment thread src/ir/linear-execution.h
Comment thread test/lit/passes/simplify-locals-global-effects-eh.wast
@stevenfontanella
stevenfontanella merged commit 595f5af into main Apr 22, 2026
16 checks passed
@stevenfontanella
stevenfontanella deleted the linear-execution branch April 22, 2026 19:42
stevenfontanella added a commit that referenced this pull request Apr 23, 2026
After #8637 this works with -all.
stevenfontanella added a commit that referenced this pull request Apr 23, 2026
This now works after #8637
stevenfontanella added a commit that referenced this pull request May 23, 2026
Part of #8615. Follows up from #8637 now that global effects for
indirect calls has been added.

Allows LinearExecutionWalker to *not* halt and continue scanning when an
indirect call is encountered in the case the global effects have been
computed under `--closed-world` and we determined that the indirect call
can't have any throw effects. LinearExecutionWalker is used in the
following passes:

* LocalGraph
* LocalCSE
* OptimizeCasts
* SimplifyGlobals
* SimplifyLocals
* GUFA
* TypeRefining
@stevenfontanella stevenfontanella linked an issue Jun 2, 2026 that may be closed by this pull request
7 tasks
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.

Improve effects analysis for indirect calls

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.