3 ms·
The claim about compiler IRs is strange. For one thing, hardware is different. Which hardware are you claiming LLVM IR is "accurate" to? More concretely, LLVM
by tom_mellior 8y ago
The claim about compiler IRs is strange. For one thing, hardware is different. Which hardware are you claiming LLVM IR is "accurate" to?
More concretely, LLVM IR has integer types for any bit size, while actual hardware architectures have only a few. Many real CPUs have condition code registers set as side effects of operations, while LLVM requires explicit compares, etc.
- jcranmer 8y agoThe big thing that you see in LLVM IR that you don't see in C is vector register support. There is also support for multiple return values, as well as some better coverage of hardware instructions via intrinsics (e.g., fma). It is somewhat poor in support for things like exposing hardware exceptions and the condition code support, and its support for vectors, floating point, and bit sizes is definitely in the realm of supporting union of architectural possibilities instead of the intersection. I definitely would not call LLVM IR accurate to hardware, but it is more accurate than C is.