6 ms·
Is gcc’s IR fundamentally limited compared to LLVM’s somehow? I see better assembly generated by each for different cases.
by stochastic_monk 8y ago
Is gcc’s IR fundamentally limited compared to LLVM’s somehow? I see better assembly generated by each for different cases.
- codeflo 8y agoI don't think so, and even where it would be, GCC's IR can evolve. But GP was talking about the limitations of C, not GCC. C's memory model puts some limits on what a compiler can do that other languages might not. Fortran is usually given as an example of a language that can be faster than C, because the compiler is allowed to do more. Rust might get there as well, at least in very specific circumstances. Given that GCC also has a good Fortran frontend, I'd assume that their IR is already more powerful than what's needed to compile C alone.
- celrod 8y agoIsn't it just that it is hard to prove there's no aliasing in C, which can make it harder to vectorize? If so, "restrict" should handle that in most cases.
- marcosdumay 8y agoI imagine the reason everybody chooses the LLVM's IR is because the GCC one isn't stable.
- gnulinux 8y agoLLVM IR is a moving target too.