Skip to content

version_65: Handle EM_ASM/EM_JS in LLVM wasm backend O0 output (#1888)

Compare
Choose a tag to compare
@kripken kripken released this 28 Jan 20:14
153ba18
See emscripten-core/emscripten#7928 - we have been optimizing all wasms until now, and noticed this when the wasm object file path did not do so. When not optimizing, our methods of handling EM_ASM and EM_JS fail since the patterns are different.

Specifically, for EM_ASM we hunt for emscripten_asm_const(X, where X is a constant, but without opts it may be a get of a local. For EM_JS, the function body may not just contain a const, but a block with a set of the const and a return of a get later.

This adds logic to track gets and sets in basic blocks, which is sufficient to handle this.