LWN.net Logo

Universal JITs

Universal JITs

Posted Apr 26, 2012 21:33 UTC (Thu) by daglwn (subscriber, #65432)
Parent article: LFCS 2012: LLVM and Linux

[Preface: I love LLVM and we use it at work extensively.]

> For example, in using Renderscript for Android, developers can package
> up the Bitcode into the .apk file and the actual code generation is done
> for the proper target when the app is run for the first time. For
> example, scalar code would be generated for an ARMv7, but vectorized
> code would be generated for a Neon core.

Before anyone goes off to claim that LLVM bitcode is a universal IR, it ain't so. There are too many target-specific semantics in C for that to be possible. Struct layout is just one example. One cannot have a completely target-agnostic representation of a C program.

As stated in the quote, it probably can work within an architecture family (but note it won't between x86-32 and x86-64). However, the dream of a universal distribution format is going to have to wait for a higher-level language to overtake C.


(Log in to post comments)

Universal JITs

Posted Apr 27, 2012 8:16 UTC (Fri) by kugel (subscriber, #70540) [Link]

> One cannot have a completely target-agnostic representation of a C program.

Except the C source code :)

Universal JITs

Posted Apr 27, 2012 10:29 UTC (Fri) by daglwn (subscriber, #65432) [Link]

Ok smartypants,

One cannot have a completely target-agnostic representation of every C program.

:)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds