[LLVMdev] Building a stable bitcode format for PNaCl - based on LLVM IR

Eli Bendersky eliben at google.com
Tue Jun 18 08:22:10 PDT 2013


Hello,

[The first paragraph is safe to skip if you already know what PNaCl is.]
The Portable Native Client (PNaCl) project is a toolchain for producing
portable bitcode from C and C++ code and running in securely and
efficiently on the web via Native Client. For more details see this
presentation from the last Google I/O:
https://developers.google.com/events/io/sessions/325679543and
http://www.chromium.org/nativeclient/pnacl/building-and-testing-portable-native-client

PNaCl uses a subset of LLVM IR as its bitcode. Our goal is a single bitcode
file that can be "translated" on a target machine to a sandboxed native
executable for the target architecture and executed. This presents a number
of challenges with architecture independence and backwards compatibility.

This is a document we've been using internally to coordinate the effort to
simplify LLVM IR to the level where it's suitable to serve as a portable,
backwards compatible bitcode. After a general introduction, it presents
concrete steps the PNaCl toolchain performs to simplify LLVM IR, with some
discussion of their pros/cons. This is based on a few years of observing
changes in LLVM IR and their meaning for PNaCl.

We've considered the points made by Dan in his "LLVM IR is a compiler IR"
post (http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-October/043719.html)
and have also discussed this with him a couple of times since then. We
believe that the changes described by the attached document, together with
other PNaCl-specific characteristics, make the chosen subset suitable for
the task.

Any comments and questions are very welcome. Our goal in publishing this is
to facilitate an open discussion, as well as serve as a reference point for
other projects interested in using LLVM IR for portable and/or stable use
cases. Note that the document is a work-in-progress and some details may
change. We intend to publish a more structured reference for PNaCl bitcode
at some point in the future.

The document is available as a PDF here:
https://docs.google.com/a/chromium.org/viewer?a=v&pid=sites&srcid=Y2hyb21pdW0ub3JnfGRldnxneDo0OWYwZjVkYWFjOWNjODE1

And in text here:
https://sites.google.com/a/chromium.org/dev/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi

Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130618/1d003f7a/attachment.html>


More information about the llvm-dev mailing list