-
Notifications
You must be signed in to change notification settings - Fork 745
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
allow specifying the external memory #7125
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to add this, good idea.
Please add documentation for this, around line 246 which is where the current options are documented.
And please add a test. It can be similar to test/lit/passes/asyncify_pass-arg=asyncify-side-module.wast
for (auto& export : module->exports) { | ||
if (export->kind == ExternalKind::Memory && | ||
export->name == asyncifyMemoryValue) { | ||
asyncifyMemory = export->value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asyncifyMemory = export->value; | |
asyncifyMemory = export->value; | |
break; |
@@ -0,0 +1,116 @@ | |||
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. | |||
;; NOTE: This test was ported using port_passes_tests_to_lit.py and could be cleaned up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
;; NOTE: This test was ported using port_passes_tests_to_lit.py and could be cleaned up. |
;; NOTE: This test was ported using port_passes_tests_to_lit.py and could be cleaned up. | ||
|
||
;; RUN: foreach %s %t wasm-opt --enable-multimemory --enable-mutable-globals --asyncify --pass-arg=asyncify-memory@memory -S -o - | filecheck %s | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
;; This test checks that the asyncify-memory argument can pick which memory to use in asyncify. |
(memory (export "memory") 1 1) | ||
(memory (export "unused") 1 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(memory (export "memory") 1 1) | |
(memory (export "unused") 1 1) | |
(memory $mem (export "memory") 1 1) | |
(memory $ignore (export "unused") 1 1) |
Indentation, and give them names. The names should make the test output easier to read. (Can update the output using ./scripts/update_lit_checks.py PATH-TO-TEST
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I intentionally did not use the export names, so that the test verifies we use the export names to pick the memory.)
Allows specifying the memory used in Asyncify in case of multiple memories via an export.