Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EH] Support CFGWalker for new EH spec #6235

Merged
merged 5 commits into from
Jan 26, 2024

Conversation

aheejin
Copy link
Member

@aheejin aheejin commented Jan 24, 2024

This adds support CFGWalker for the new EH instructions (try_table and throw_ref). CFGWalker is used by many different passes, but in the same vein as #3494, this adds tests for RedundantSetElimination pass. rse-eh.wast file was created from translated and simplified version of rse-eh-old.wast, but many tests were removed because we don't have special catch block or delegate anymore.

This adds support `CFGWalker` for the new EH instructions (`try_table`
and `throw_ref`). `CFGWalker` is used by many different passes, but in
the same vein as WebAssembly#3494, this adds tests for `RedundantSetElimination`
pass. `rse-eh.wast` file is created from translated and simplified
version of `rse-eh-old.wast`, but many tests were removed because we
don't have special `catch` block or `delegate` anymore.
@aheejin aheejin requested review from kripken and tlively January 24, 2024 07:20
src/cfg/cfg-traversal.h Outdated Show resolved Hide resolved
@kripken
Copy link
Member

kripken commented Jan 24, 2024

(please fuzz this before landing)

Co-authored-by: Alon Zakai <alonzakai@gmail.com>
@aheejin
Copy link
Member Author

aheejin commented Jan 24, 2024

(please fuzz this before landing)

I don't think we can fuzz new EH yet because the optimization pipeline is not supported yet. On that front, I should've included this new test to the no-fuzz list... Will do that.

Comment on lines +246 to +247
;; Unlike nested-try_table1, the exception may not be caught by the inner
;; catch, so the local.set may not run. So this should NOT be dropped.
Copy link
Member

Choose a reason for hiding this comment

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

This is because the CFG builder does not consider tags when creating control flow edges, right? In reality the exception would always be caught here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, good point. I'll make a copy of this which throws with a different tag, and put a TODO on this one.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, it shouldn't be a different tag, in which case it is always not gonna be caught. I'll replace the throw with a call, which we don't know what it will throw.

@aheejin aheejin merged commit d23a63f into WebAssembly:main Jan 26, 2024
14 checks passed
@aheejin aheejin deleted the new_eh_cfg_walker branch January 26, 2024 00:22
radekdoulik pushed a commit to dotnet/binaryen that referenced this pull request Jul 12, 2024
This adds support `CFGWalker` for the new EH instructions (`try_table`
and `throw_ref`). `CFGWalker` is used by many different passes, but in
the same vein as WebAssembly#3494, this adds tests for `RedundantSetElimination`
pass. `rse-eh.wast` file is created from translated and simplified
version of `rse-eh-old.wast`, but many tests were removed because we
don't have special `catch` block or `delegate` anymore.
@gkdn gkdn mentioned this pull request Aug 31, 2024
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.

3 participants