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

Stack switching: fix some optimization passes #7271

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

vouillon
Copy link
Contributor

@vouillon vouillon commented Feb 3, 2025

This continues #7041 by adapting the optimizations passes to work with the stack switching instructions.

@@ -0,0 +1,163 @@
;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.
;;RUN: wasm-opt -all -O3 -Oz %s -S -o - | filecheck %s
Copy link
Member

Choose a reason for hiding this comment

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

Would you be able to break this up into targeted tests for the individual fixed optimization passes? Also, the new test files should be added to the list of ignored tests in scripts/fuzzing.py until scripts/fuzz_opt.py can run cleanly without that.

@vouillon vouillon force-pushed the stack-switching-fixes branch from c067464 to 19e57a7 Compare February 7, 2025 16:38
@vouillon vouillon force-pushed the stack-switching-fixes branch from 19e57a7 to 50d6418 Compare February 7, 2025 16:47
Comment on lines +1446 to +1449
assert(params.size() > 0);
Type cont = params[params.size() - 1];
assert(cont.isContinuation());
type = cont.getHeapType().getContinuation().type.getSignature().params;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dhil Does this look correct to you?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it looks right to me. The last parameter of a switch-continuation must be a continuation type. This argument is synthetic in the sense that it is provided by switch rather than the programmer.

scripts/test/fuzzing.py Outdated Show resolved Hide resolved
Co-authored-by: Max Graey <maxgraey@gmail.com>
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.

4 participants