Skip to content

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

@osa1

Description

@osa1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions