binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

New minimal version for binaryen_wasm/js build targets

Open MaxGraey opened this issue 1 year ago • 3 comments

I'm wondering what if we add more shrieked version for binaryen_wasm/js targets? It seems many passes is not useful for general cases and can be excluded from wasm/js targets, which should improve final sizes (Not sure how much, though).

I guess we could remove from src/passes/CMakeLists.txt for such new minimal version:

  • SafeHeap
  • PostEmscripten
  • PrintCallGraph
  • PrintFeatures
  • PrintFunctionMap
  • RoundTrip
  • Souperify
  • SpillPointers
  • StackCheck

Also exclude other emscripten-specific stuffs

Does it make sense?

MaxGraey avatar Aug 03 '22 18:08 MaxGraey

I would consider binaryen_wasm/js the same library as the native build just compiled to a different target, so if someone would want to run any pass present in the native build, I think it should be available in the wasm/js variants as well. Perhaps make it configurable somehow (EXCLUDE_PASSES=...?), so users can make custom builds with some passes omitted, but I wouldn't omit passes in the general builds.

dcodeIO avatar Aug 03 '22 19:08 dcodeIO

The point is that some passes may be needed for wasm-opt, which we also build in binaryen.js

MaxGraey avatar Aug 03 '22 19:08 MaxGraey

Right, and both the CLI and the library have options to run any pass. I think it would be unexpected if some where missing. Say a producer wants to run SafeHeap or SpillPointers, because their compiler needs them. Can't tell for sure that a pass is never needed.

dcodeIO avatar Aug 03 '22 19:08 dcodeIO