[LLVMdev] LLVM IR is a compiler IR
David A. Greene
greened at obbligato.org
Wed Oct 5 08:31:27 PDT 2011
Chris Lattner <clattner at apple.com> writes:
> That said, I'm trying to also inject realism. C is an inherently
> hostile language to try to get portability out of.
Aren't there (at least) two different aspects here? One is the source
language. C is not portable. There's nothing LLVM can do to fix that.
However, other HLLs are portable. What can LLVM do to help them?
The other aspect is the ABI. Right now LLVM pretty much assumes a
C-like ABI. That's only necessary for some C-derived languages.
Fortran, for example, has no defined ABI so the compiler is free to do
whatever it pleases. Fortran objects are not interchangeable among
compiler vendors and users are perfectly fine with that, though often us
compiler developers are not. :)
So to me this seems like a language issue and an ABI issue, neither one
of which need be tied directly to LLVM.
That said, I think creating a portable LLVM IR is a huge project (much
bigger than many people realize) and in the end, I don't think there's
much to be gained. A portable IR built on top of LLVM makes more sense
to me. Anyone interested in that should check read up on projects like
ANDF that produced volumes of papers on what's required.
-Dave
More information about the llvm-dev
mailing list