Announcement

Collapse
No announcement yet.

GCC 12 Profile Guided Optimization Benchmarks With The AMD Threadripper 3990X

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • binarybanana
    replied
    On Gentoo you can easily enable PGO using portage-bashrc-mv [1]. Install and set PGO=1 for a single package or system wide. That's it.
    [1]: https://github.com/vaeth/portage-bashrc-mv

    Leave a comment:


  • joshx1
    replied
    I recently went down this rabbithole with Rust, and it's interesting!

    See their blog post at https://blog.rust-lang.org/inside-ru...-compiler.html and their documentation https://doc.rust-lang.org/rustc/prof...imization.html

    Leave a comment:


  • cj.wijtmans
    replied
    Yeah at the moment kernel can only be compiled lto with clang. Which is funny because for a long time clang didnt compile kernel. Also we have gcc extensions being used in the kernel. So they would not work with clang? Weird situation.
    Anyway.
    is the primary optimization of pgo perhaps branch prediction? Because c++ supports branch prediction hints now. And C does as well. What other major optimizations would pgo have that cant be done manually. I think pgo is DOA and we just need more standardized attributes to give the compiler hints. Oh theres cache lining hints as well i believe in c++ now.

    Leave a comment:


  • V1tol
    replied
    Originally posted by kozman View Post
    Has anyone ever attempted it recently? I feel like I remember back in the early gcc 9 or 10 days someone tried it and there were problems or it just didn't work.
    We should have LTO with GCC first

    Leave a comment:


  • polluktus
    replied
    Originally posted by kozman View Post

    Has anyone ever attempted it recently? I feel like I remember back in the early gcc 9 or 10 days someone tried it and there were problems or it just didn't work.
    i was using https://gitlab.com/torvic9/linux513-...pgo-kees.patch with 5.13 and cfi. Didn't do any benchmarks, but it worked. But currently i dont think anyone is still working on it.

    Leave a comment:


  • kozman
    replied
    Originally posted by polluktus View Post
    maybe one day we'll see pgo for linux kernel and some amazing benchmarks with lto+pgo
    Has anyone ever attempted it recently? I feel like I remember back in the early gcc 9 or 10 days someone tried it and there were problems or it just didn't work.

    Leave a comment:


  • coder
    replied
    Originally posted by espi View Post
    Lets make a C JIT compiler so that it can find out in real time what code is hot amirite? it could also apply optimizations for the system its running on.
    I guess there's a bit of a packaging problem, since you'd need all the build dependencies. Not to mention the lack of buildsystem standards. And how fast a C or C++ codebase compiles is hugely variable, ranging from almost-JIT to not-remotely-close.

    It's not as if you can just concatenate all the source files, either. That would break static, plus various things people do with the preprocessor.

    Leave a comment:


  • espi
    replied
    Originally posted by coder View Post
    That's some nice benefit.

    I do wonder just how much of it could be gained by manually adding a few function attributes[1] and builtin functions[2], like __builtin_expect(), in well-chosen spots. Otherwise, GCC has no idea how hot a loop, function, or condition is.
    1. https://gcc.gnu.org/onlinedocs/gcc-1...ion-Attributes
    2. https://gcc.gnu.org/onlinedocs/gcc-1...Other-Builtins
    Lets make a C JIT compiler so that it can find out in real time what code is hot amirite? it could also apply optimizations for the system its running on.

    Leave a comment:


  • coder
    replied
    That's some nice benefit.

    I do wonder just how much of it could be gained by manually adding a few function attributes[1] and builtin functions[2], like __builtin_expect(), in well-chosen spots. Otherwise, GCC has no idea how hot a loop, function, or condition is.
    1. https://gcc.gnu.org/onlinedocs/gcc-1...ion-Attributes
    2. https://gcc.gnu.org/onlinedocs/gcc-1...Other-Builtins

    Leave a comment:


  • polluktus
    replied
    maybe one day we'll see pgo for linux kernel and some amazing benchmarks with lto+pgo

    Leave a comment:

Working...
X