Announcement

Collapse
No announcement yet.

GCC Lands Loop Splitting Optimization

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

  • 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

  • #2
    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 ...

    Comment


    • #3
      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.

      Comment


      • #4
        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.

        Comment


        • #5
          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.

          Comment


          • #6
            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.

            Comment


            • #7
              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

              Comment


              • #8
                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.

                Comment

                Working...
                X