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

wasm-opt doesn't drop some stack shuffling instructions before unreachable #6715

Closed
osa1 opened this issue Jul 5, 2024 · 1 comment · Fixed by #6719
Closed

wasm-opt doesn't drop some stack shuffling instructions before unreachable #6715

osa1 opened this issue Jul 5, 2024 · 1 comment · Fixed by #6719

Comments

@osa1
Copy link
Contributor

osa1 commented Jul 5, 2024

When I optimize the attached .wasm with the current main branch (9792f2c) using this invocation:

wasm-opt \
      -g \
      --all-features \
      --closed-world \
      --traps-never-happen \
      --type-unfinalizing \
      -Os \
      --type-ssa \
      --gufa \
      -Os \
      --type-merging \
      -Os \
      --type-finalizing \
      test.wasm -o test.opt.wasm

The generated .wasm has 34 instruction sequences of drop; unreachable.

In those cases the drop instruction could be dropped.

test.wasm.zip

@kripken
Copy link
Member

kripken commented Jul 8, 2024

Thanks @osa1 , that was indeed a missed optimization. I opened #6719 to add it.

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 a pull request may close this issue.

2 participants