Announcement

Collapse
No announcement yet.

GCC Lands Loop Splitting Optimization

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

  • phoronix
    started a topic GCC Lands Loop Splitting Optimization

    GCC Lands Loop Splitting Optimization

    Phoronix: GCC Lands Loop Splitting Optimization

    The latest GCC 7 development code has an optimization pass now for loop splitting...

    http://www.phoronix.com/scan.php?pag...Loop-Splitting

  • sdack
    replied
    Originally posted by atomsymbol View Post
    The condition could be hidden in a library function called from the loop and the compiler could decide to inline it.
    Or a macro, a template class, an inlined class function, automatically generated code, etc.. We'd all still be writing assembler code and tweaking every single CPU-cycle if we really would think of it as a fault and we wouldn't be getting anywhere.

    Leave a comment:


  • Azpegath
    replied
    I recommend watching the talk on Data-Oriented Design by Mike Acton from CppCon a couple of years back.

    https://www.youtube.com/watch?v=rX0ItVEVjHc

    Leave a comment:


  • carewolf
    replied
    I bet this in some cases gives a 4x+ speedup since removing inner-loop conditionals also allows for autovectorization, so the split result is vectorizable, it will give a really good speed-up.

    Leave a comment:


  • atomsymbol
    replied
    Originally posted by efikkan View Post
    Any codebase receiving any significant improvement from this is probably riddled with similar or worse "defects", the only answer is to rewrite it properly
    The condition could be hidden in a library function called from the loop and the compiler could decide to inline it.

    Leave a comment:


  • bug77
    replied
    Originally posted by efikkan View Post
    This sort of optimizations probably only benefits select codebases, especially since this kind of problem is actually a "design fault".
    True, but like any other tool that holds your hand, it's better to have it and not need it than the other way around.

    Leave a comment:


  • efikkan
    replied
    This sort of optimizations probably only benefits select codebases, especially since this kind of problem is actually a "design fault".

    Any codebase receiving any significant improvement from this is probably riddled with similar or worse "defects", the only answer is to rewrite it properly. Compiler optimizations are great (for small isolated things), but they can only go so far, and they can never bad code into good code.

    Leave a comment:


  • atomsymbol
    replied
    Originally posted by phoronix View Post
    Phoronix: GCC Lands Loop Splitting Optimization

    The latest GCC 7 development code has an optimization pass now for loop splitting...

    http://www.phoronix.com/scan.php?pag...Loop-Splitting
    From https://gcc.gnu.org/ml/gcc-patches/2.../msg00138.html (underline added):
    The 1% improvements and degradations are all inside the normal result variations on this machine ...

    Leave a comment:

Working...
X