-
Notifications
You must be signed in to change notification settings - Fork 793
Description
Over in llvm/llvm-project#147201, @SingleAccretion mentioned that they can't use wasm opt:
Not all scenarios can (or want) to use wasm-opt. E. g. we don't use it by default because it can alter function indices. All WASMp2-targeting code doesn't use it (and can't, currently at least). So that's the main motivation (along with the fact that if we were say to use wasm-opt for this small optimization only, it would be at least an order of magnitude slower than if done in the linker [in terms of this optimization's isolated cost]).
I definitely get the desire to avoid wasm-opt for transforms that are required for correctness rather than optimizations (we have the same principle in Emscripten), but also it's still very nice to have for optimizations. And Binaryen tries to be useful across a lot of different wasm toolchains and use cases, so it made me curious about what the requirements of this scenario are ("all WASIp2-targeting code" sounds like a pretty broadly used use case!). It might make sense to have a mode or feature in Binaryen that could make it work here.
@SingleAccretion can you maybe say a bit more about what the problems/requirements are for the use case?