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.