[LLVMdev] PNaCl Bitcode reference manual

Mark Seaborn mseaborn at chromium.org
Thu Aug 1 10:37:47 PDT 2013


On 1 August 2013 10:19, Dan Gohman <dan433584 at gmail.com> wrote:

> Hi Eli,
>
> Recently, I proposed some changes to LLVM to do more lowering of illegal
> types (like i128 or i17) and other things within the LLVM IR layer, and the
> proposal was roundly rejected by the LLVM community:
>
> http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-April/061567.html
>
> PNaCl is essentially doing what my proposal described. How do you expect
> to reconcile the community's desire to avoid doing lowering on LLVM IR with
> PNaCl's design that is built on doing lowering on LLVM IR?
>

I expect we'll have to continue maintaining our own integer lowering IR
pass for PNaCl, unless upstream LLVM has a change of heart and decides to
add an implementation of such an IR pass.

The pass isn't excessively complex so I don't think this will be a big
burden, although it does only handle increasing the integer size (e.g. i17
-> i32), and not splitting integers up (i128 -> two i64s).  Having this
pass certainly seems preferable to allowing arbitrary-sized integer types
in the PNaCl ABI.

Here's the current implementation of the pass:
http://git.chromium.org/gitweb/?p=native_client/pnacl-llvm.git;a=blob;f=lib/Transforms/NaCl/PromoteIntegers.cpp;h=017e4976f27d2557b67c3b563e3685d140517808;hb=b9657234ee8b1951db5977a8ffb55a2e5df6d76c

For comparison, Emscripten does much the same thing.  It has its own
integer legalisation pass, but it's implemented in Javascript rather than
in C++.

Cheers,
Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130801/ac2ad9d4/attachment.html>


More information about the llvm-dev mailing list