[LLVMdev] [RFC] WebAssembly Backend

JF Bastien jfb at google.com
Thu Jun 18 06:47:12 PDT 2015


>
> This seems interesting, I have a few questions:
>
>
> Has the ISA been finalized yet or is it still a work in progress?  Will
> there be a fixed number of registers?
>

The design document has a high-level idea of the ISA, or rather of the AST
we're thinking of going with:

https://github.com/WebAssembly/design/blob/master/AstSemantics.md

The final encoding isn't decided on, we're still missing experiments to
figure out precise details.

We foresee having an infinite number of locals per function, but we plan to
pre-color them so that locals whose lifetimes don't interfere can be
merged. We can get clever and do this in an interesting order.


How will the ISA be transformed to machine code?
>

That's implementation dependent. Initially, a polyfill to JavaScript
because that's what exists today. We'll also implement a reference
interpreter to validate the spec. Each browser can do what it wants to have
fast and secure native support.


Why do you want to develop a full backend as opposed to a simple LLVM
> IR translation pass that converts IR directly to WebAssembly?
>

Because that's proven to have unfortunate shortcomings in both PNaCl and
Emscripten. Doing a true backend has significant advantages including in
amount of code needed, and in what e.g. ISel can do for us for legalization
and clever instruction selection.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150618/f9d5ed27/attachment.html>


More information about the llvm-dev mailing list