Show HN: A new LLVM optimization pass that aggressively reduces WebAssembly size - Klaput News

Show HN: A new LLVM optimization pass that aggressively reduces WebAssembly size
60 by apignotti | 10 comments on Hacker News.
WebAssembly is commonly used as part of web applications, and minimizing its size is especially important. As part of the latest release of Cheerp, our C++ to WebAssembly/JavaScript compiler, we have introduced a powerful new LLVM optimization that aggressively reduce WebAssembly output size at compile time. We have named this optimization 'PartialExecuter', the key idea behind it being taking advantage of known function parameters to find inner code blocks that cannot ever be possibly executed. Such blocks can then be completely removed from the compiled output, significantly reducing its size. What makes this pass more powerful than typical Dead Code Elimination is the ability of reasoning over all the possible executions that the code can take, while being robust to memory stores and side-effects. Moreover, PartialExecuter can even reason over loads as far as they refer to read-only memory. This latter capability is especially useful to drop code from complex functions whose behavior depend on input strings (i.e. printf). We think this work may be of interest for the HN community, and we welcome feedback and questions. In-depth blog post: https://ift.tt/jqBobJE

RELATED POST :
Memuat...

Comments

Popular posts from this blog

Show HN: Modifying Clang for a Safer, More Explicit C++ - Klaput News

Show HN: A tool to design and run user state machines - Klaput News