wasm-opt
The wasm-opt
tool is a wasm-to-wasm
optimizer. It will receive a WebAssembly module as input and run transformation passes on it to optimize and generate the optimized WebAssembly module. Let's look at the steps:
- Let's first create the
inline-optimizer.wast
file and add the following content:(module (func $parent (export "parent") (result i32) (i32.add (call $child) (i32.const 13) ) ) (func $child (result i32) (call $grandChild)) (func $grandChild (result i32) (call $greatGrandChild)) (func $greatGrandChild (result i32) (i32.const 7)) )
- To generate...