Skip to content

How to remove no-op exported functions? #6506

Description

@orsinium

Discussed in #6501

Originally posted by orsinium April 15, 2024
Quite often, after all optimizations, wasm-opt leaves exported functions empty:

(module
  (type (func))
  (func (type 0)
    nop)
  (export "example" (func 0)))

Is there a way to tell wasm-opt that it is also safe to remove the exported functions if they are empty? I know for sure that the target runtime handles missed exports correctly.

Based on the discussion, there is currently no way to do so. Hence we decided that it's worth opening a proper feature request. The feature would help a lot with code optimization on both guest and host sides in situations when the host doesn't require the exported functions to be present.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions