[LLVMdev] [RFC] WebAssembly Backend

Dan Gohman dan433584 at gmail.com
Wed Jun 17 09:16:21 PDT 2015

Hello all,

WebAssembly [0] its a new virtual ISA being designed to efficiently
run compiled code in web browsers and other things, starting with
C/C++, and eventually many other languages [1]. WebAssembly
distinguishes itself from other virtual ISAs with optimizations to
reduce download size and decode time, strong portability and
predictability invariants (for example, the base has no undefined
behavior in the C/C++ sense), and participation from several browser

We're interested in developing and contributing an LLVM backend to
target this new ISA. There are many interesting technical aspects that
we’re excited to discuss with the LLVM community. Before we get
started though, we need to figure out how to do our development. Most
backends in LLVM were initially submitted in monolithic form and
developed incrementally thereafter. However, we have contributors from
multiple organizations, and a monolithic patch wouldn’t accurately
reflect the separate contributions.

Would the LLVM community be willing to let us start a new target from
scratch within the LLVM tree, following normal LLVM
incremental-development practices? The target would naturally start as
"experimental", excluded from the default build. The code organization
would look like any other backend, with everything under
lib/Target/WebAssembly except for various bits of configury that any
backend needs. We have need of the functionality provided by
SelectionDAG, MI and others, so this will pretty clearly be a backend,
rather than a specialized serialization. Also, the people leading the
project are JF Bastien and Dan Gohman, existing LLVM contributors
familiar with various relevant areas of LLVM.

Additionally, there are opportunities to refactor generic
infrastructure in LLVM to better support the needs of virtual ISAs,
including those in LLVM already and possibly more in the future.
Working in LLVM from the start would make collaboration with the rest
of the community easier.

We look forward to your feedback and questions. Thanks!

        - The WebAssembly Community Group

[0] https://github.com/WebAssembly/design/blob/master/README.md
[1] https://github.com/WebAssembly/design/blob/master/HighLevelGoals.md

More information about the llvm-dev mailing list