3 ms·
Will LLVM IR allow developers to deliver binaries that will run on both Intel and ARM? I see the Swift compiler can output LLVM IR, can you do the same thing w
by jimbokun 6y ago
Will LLVM IR allow developers to deliver binaries that will run on both Intel and ARM?
I see the Swift compiler can output LLVM IR, can you do the same thing with Objective C code bases?
- monocasa 6y agoNo, LLVM IR has platform specific parts baked into it like the ABI, and you can't really jump archs like that.
- zozbot234 6y agoNot really. LLVM is not a single interoperable IR, it's more like a family of IR's with many arch-specific details. WASM+WASI could work though.
- saagarjha 6y agoNot by itself, but of course the LLVM infrastructure has deep support for cross-compilation. (Objective-C can be translated to IR as well; it goes through largely the same pipeline once the frontend is done with it.)
- jeffbee 6y agoAdding to what the other comments said, compilation from source to IR discards a lot of information, such as C preprocessor directives (which might take the form of "if x86" or "if ARM"). So, no.
- scarface74 6y agoNo. That rumor was dispelled by Chris Lattner during an interview on the Accidental Tech Podcast.