After your earlier brainfart, "AFAIK, ptx is parsed into LLVM IR and then some optimizations and code gen happens." :
Seriously, then who owns OGL? Khronos? Cad companies? MS by proxy?
SGi owns the trademark. The difference, as far as I can tell, is that Apple makes use of LLVM mandatory for implementors of OpenCL - seems like a good idea in the long run, to be honest. Open source goodness all the way, eventually.
Fact is, there are problems in OpenCL due to LLVM producing code that the IHVs' compilers can't work with. Dunno how much longer this basic stuff is going to continue to throw up deal-breaking errors.
Obviously we can't tell how much of that is the fault of the users of LLVM (AMD, NVidia) as opposed to LLVM itself - clearly there have been language conformance problems in both AMD's and NVidia's implementations of OpenCL.
Ditching Brook+ in favour of OpenCL wasn't much of a problem for AMD, because AMD didn't really have a huge investment there. Brook+ was originally a front-end for DX HLSL (evolved from BrookGPU, as distinct from Brook, a stream language), and started off solely generating pixel shaders (with supporting vertex shader to kick them into life).
By contrast NVidia has spent many years heavily investing in its own languages - going back to Cg thence to C for CUDA - designed
specifically for its own hardware. So, with OpenCL, NVidia loses some control. Theoretically, once LLVM's working right in this environment, there'll be gains to be had.
You might argue that NVidia will ditch its internal technologies and adopt an LLVM-based chain entirely across all its platforms (including D3D graphics). This doesn't address the basic fact that OpenCL is a generalised API, aimed at including chips that aren't GPUs. It's not the closest-fit for NVidia's hardware and the variant of C in OpenCL is theoretically immature compared with what NVidia is doing (or has planned) for C for CUDA.
Even with NVidia all-LLVM, OpenCL is still "relatively distant", an abstraction in the middle that serves no purpose in a pure NVidia environment.
LLVM doesn't know about CPUs either. It's a library containing a bunch of IR optimization/transformation passes. Along with some code for generating IR and JITing it. All of it is separate. You use whatever pieces of the pie you like. You bend it. You mend it.
That's my point - no-one's done LLVM from a C-like language (HLSL-like or OpenCL-C-like) to GPU ISA yet. If it's work in progress then maybe we'll get to hear about it some time.
Just in Time ... for lunch
People have built static bug finders with LLVM too. Does it mean that LLVM understands CPUs?
LLVM and its environment is a major work in progress, in case you haven't noticed. It's why we see OpenCL dependent upon fixes to LLVM, it's quite immature in this application. Go have a look at AMD's and NVidia's developer forums.
Fine, you tell us your theory.
I suggest you read the first page of the IL Specification. You'll see that AMD's IL is based upon D3D10's assembly language, which is an evolution of DX9 assembly. IL was designed as a thin layer twixt D3D assembly and ISA upon the introduction of R600 (i.e. D3D10). AMD (ATI) has been doing DX-style assembly->ISA since before LLVM came into existence.
And, by the way, I'm not suggesting that LLVM isn't usable in doing OpenCL->ISA without intermediate steps. I'm saying that the LLVM ecosystem isn't mature enough for AMD and NVidia to entirely junk their driver-level JIT technology. And that OpenCL is an abstraction at further remove from NVidia's hardware than CUDA.
Big deal. May be you should look into the compilers for uCs. They also tailor their code for each member of the family. It's a done deal for like what, decades?
GPUs are the daddies of microcontrollers.
Besides the Tablegen DSL LLVM has is pretty nicely suited for this sort of per gpu-codegen.
Lovely.
All those variables apply to CUDA too.
I'm sure you'll let us know of the first GPU doing graphics whose JIT is LLVM based.
Jawed