| Define "better". I'm very familiar with both inlining and register allocation in GCC (I even helped write one of the register allocation rewrite attempts, until vlad went even further down the rabbit hole of writing register allocators than we did) RA was itself is historically more advanced in amount of optimization it does itself in GCC, but was still mostly a wash, because it's still much easier to work with LLVM's form and better optimizers were written. LLVM also nowadays has a fairly advanced register allocator if you want it (PBQP) - it produces near optimal register allocations. It's not used though. It hasn't been worth it. Inlining, they are not usefully comparable - they are very different approaches, both are good, and during the last inliner rewrite in LLVM, large amounts of comparisons were done a large number of times, and there isn't anything to suggest that GCC's inliner is really better (unlike RA, where the default GCC algorithm is certainly more advanced than the default LLVM RA, despite this being a deliberate decision). We spent a lot of time optimizing inlining and RA/etc code when we transitioned to LLVM at Google (many years ago now) At when we made that transition it was a net positive thing for fleet, and it was on a very large codebase. The truth about compilers is there are no silver bullets.
Things get faster mostly through careful tuning (which ML will hopefully replace), and much more rarely due to better algorithms. As a result, i would expect GCC to not do any better here than LLVM. |