Repository navigation
[Stack Switching] wasm-ctor-eval: stop on serializing continuations to globals - #8585
Conversation
| ;; CHECK: (func $read (type $2) (result (ref null $cont)) | ||
| ;; CHECK-NEXT: (global.get $global) | ||
| ;; CHECK-NEXT: ) | ||
| ;; NOKEEP: (func $read (type $2) (result (ref null $cont)) | ||
| ;; NOKEEP-NEXT: (global.get $global) | ||
| ;; NOKEEP-NEXT: ) | ||
| (func $read (export "read") (result (ref null $cont)) | ||
| (global.get $global) | ||
| ) | ||
| ) |
There was a problem hiding this comment.
nit: I guess this isn't needed?
There was a problem hiding this comment.
The above testcases use this pattern, because without it, the global is only written to and never read, so it can be trivially optimized out. I suspect this case might not need it as it can't optimize, but I think it's better to follow the shape of the above testcases so the diff compared to them is small and clear.
(Note that even if we don't need this now, we might need it later - ctor-eval runs a few opt passes after its work, and while simplify-globals, the pass that would remove the write-only global, is not yet run, we might add it later. Similar passes are already there.)
Continuations cannot be serialized.