\n | (func $unused | \n
\n | ;; The result is unused, so we can remove the call. | \n
\n | (drop | \n
\n | (call $call.without.effects (ref.func $i)) | \n
\n | ) | \n
\n | ) | \n
More docs:
\nhttps://github.com/WebAssembly/binaryen?tab=readme-ov-file#intrinsics
","upvoteCount":1,"url":"https://github.com/WebAssembly/binaryen/discussions/7431#discussioncomment-12706558"}}}-
Hello! Currently, Binaryen is unable to optimize calls to |
Beta Was this translation helpful? Give feedback.
-
We do have an intrinsic for that, binaryen/test/lit/passes/vacuum-intrinsics.wast Lines 35 to 40 in 85fc8bb More docs: https://github.com/WebAssembly/binaryen?tab=readme-ov-file#intrinsics |
Beta Was this translation helpful? Give feedback.
We do have an intrinsic for that,
call.without.effects
, that can mark a call (not a function, but you can mark all calls to a target) as having no effects. This is experimental and may change. Here is the test that shows its usage:binaryen/test/lit/passes/vacuum-intrinsics.wast
Lines 35 to 40 in 85fc8bb
More docs:
https://github.com/WebAssembly/binaryen?tab=readme-ov-file#intrinsics