Anyone heard of Profile-Guided Optimization? It's a feature of newer (last year?) LLVM. Basically, you compile your program, run it, it dumps profiling data, which LLVM/Clang/LDC/etc can use to optimize your program further based on run-time data instead of just compile-time assumptions.
The compiler will then be able to notice function call rates, and typical branching patterns (to optimize the most-called branch to the top).
This link focuses on the D language (for reducing unnecessarily virtual functions back to normal functions), but there are also articles on other languages.
http://johanengelen.github.io/ldc/2016/04/13/PGO-in-LDC-virtual-calls.html
http://johanengelen.github.io/ldc/2016/07/15/Profile-Guided-Optimization-with-LDC.html
He measured 7% performance improvement. If that was a AAA-title game, that would be a drastic improvement.
I believe GCC also supports PGO, and other modern compilers.
That sounds very cool! Next step would be optimizing the code as we run it