Re:Adding HLSL and DirectX Support to Clang and LLVM
by TazeTSchnitzel on Saturday March 12, 2022 @04:15AM
(#30650136)
LLVM IR is a complex, unstable, implementation-defined internal format used by LLVM with lots of quirks. While LLVM can consume LLVM bitcode made by previous versions of LLVM, it must be quite painful to use for any non-LLVM-based tooling. It's also not a portable format: the IR encodes many target-specific assumptions.
I can think of a few off the top of my head (it ties you to an old llvm version) but at the same time, presumably you need to reduce the size on the wire of this format so you need some kind of bitcode, and since it seems to be a binary interface for GPU drivers which can't be changing regularly the choice seems as good as any other?
Note: these are all naive uneducated assumptions on my part, as I'm not well informed in this area.