-
Notifications
You must be signed in to change notification settings - Fork 747
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
some obvious optimizations seems to be missing #7029
Comments
That output does not look fully optimized, yeah. The problem here is that WasmGC input like this can require multiple passes of the optimizer, see Try adding |
Oh, I didn't know about this page. It's quite useful! I only read the man page and it was much less complete. I'll play with this now. Thanks a lot! |
OK so, it looks like something is still missing. I'm starting from this file a.out.noexport.wat.zip. Then I run:
And the resulting file is here: a.out.optimized.wat.zip. I added a bunch of |
What problem specifically do you see? I don't see any |
As for the second problem mentioned in the first comment, about |
Hi,
I'm compiling the following OCaml code with Wasocaml:
This is producing a file that I'm merging with many others (runtime, stdlib etc.) through
wasm-merge
.Then I'm removing all the exports with
cat a.out.wat | grep -v "^ (export" > a.out.noexport.wat
in order to be able ton run Binaryen in closed-world mode later.The generated file (before being processed by Binaryen) is here:
a.out.noexport.wat.zip
Then I'm running Binaryen this way:
It produces the following file a.out.wasm.zip.
When I run the same command with
-S -o a.out.optimized.wat
instead, I'm getting this file a.out.optimized.wat.zip.It contains a few things that I find surprising. For instance, this pattern is present many times:
And this one too:
For the first one, I would expect the
drop (local.get)
to be simply removed. In the second case, I would expect the function to be inlined (and then its parameters dropped which would enable further optimization).Am I doing something wrong ? I'm using a lot of Binaryen options so I wouldn't be surprised if I overlooked something.
Thanks!
The text was updated successfully, but these errors were encountered: