Announcement

Collapse
No announcement yet.

GCC 12 Looking At Enabling Its Vectorizer For "-O2" Optimization Level

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

  • GCC 12 Looking At Enabling Its Vectorizer For "-O2" Optimization Level

    Phoronix: GCC 12 Looking At Enabling Its Vectorizer For "-O2" Optimization Level

    The GCC compiler when using the default "-O2" optimization level is likely to be slightly faster with next year's GCC 12 release as the developers are looking at enabling the vectorizer options by default...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    Which architectures will it support?

    Comment


    • #3
      I'm still using gcc 9.3.0 (9.3.0-17ubuntu1~20.04) for my i5-4670K Haswell. Stupid move? Feels like maybe the best compiler for this chip but if anyone strongly disagrees, do share.

      edit: someone asked why an old compiler would be best for any chip. My answer is that the optimizations are likely not coming in for Haswell anymore, and more code = longer execution time on stuff you don't need or gonna use. So I might as well use the last, greatest, stable version (9.3.0 in my case) instead of the bleeding edge 10/11/12. Put dumbly, of course. I'd love to be corrected.
      Last edited by perpetually high; 03 September 2021, 01:18 AM.

      Comment


      • #4
        Originally posted by perpetually high View Post
        I'm still using gcc 9.3.0 (9.3.0-17ubuntu1~20.04) for my i5-4670K Haswell. Stupid move? Feels like maybe the best compiler for this chip but if anyone strongly disagrees, do share.
        Thats an AVX2 chip. You would definitely benefit from a newer compiler, or better yet, the x86-64-V3 repo if you're on Arch.

        Comment


        • #5
          Originally posted by perpetually high View Post
          I'm still using gcc 9.3.0 (9.3.0-17ubuntu1~20.04) for my i5-4670K Haswell. Stupid move? Feels like maybe the best compiler for this chip but if anyone strongly disagrees, do share.

          edit: someone asked why an old compiler would be best for any chip. My answer is that the optimizations are likely not coming in for Haswell anymore, and more code = longer execution time on stuff you don't need or gonna use. So I might as well use the last, greatest, stable version (9.3.0 in my case) instead of the bleeding edge 10/11/12. Put dumbly, of course. I'd love to be corrected.
          Most of the work that goes into the compiler is not tuning the pipeline descriptions for some particular CPU, so you're missing out on all that work.

          That being said, in most cases the benefits are not huge, and the least-hassle way is to use the default version that comes with your distro (which is what you're using).

          Comment


          • #6
            Originally posted by jabl View Post

            Most of the work that goes into the compiler is not tuning the pipeline descriptions for some particular CPU, so you're missing out on all that work.

            That being said, in most cases the benefits are not huge, and the least-hassle way is to use the default version that comes with your distro (which is what you're using).
            Yeah, I need to do benchmarks soon to really get to the bottom of this. Appreciate the reply.

            Comment


            • #7
              Originally posted by jacob View Post
              Which architectures will it support?
              All of them?

              It even have a generic mode that can operate without using SIMD instructions (2/4 16bit integers in 64bit word). Though that mode is naturally limited, and sometimes needs to be halved to deal with overflows.

              Comment


              • #8
                Together with the pseudo x86-architectures for GCC's -march= switch that were added some time ago such as x86-64-v3 for AVX2 and x86-64-v4 for AVX512 do I hope to see distros picking up at least x86-64-v3 here and to provide more than the standard 64-bit binary packages.

                By the time GCC 12 becomes stable would it be nice for distros like Debian to a add second x86-64 repository for AVX2-optimised binaries to make these gains available to all the Debian-based x86 distros. Perhaps the multimedia repository could start adding this.

                Comment


                • #9
                  Originally posted by brucethemoose View Post
                  Thats an AVX2 chip. You would definitely benefit from a newer compiler
                  For the most part that is very unlikely.

                  Comment


                  • #10
                    Originally posted by perpetually high View Post
                    someone asked why an old compiler would be best for any chip. My answer is that the optimizations are likely not coming in for Haswell anymore
                    most optimizations are not chip-specific. new complier is always better and it's not limited to optimizations
                    Originally posted by perpetually high View Post
                    and more code = longer execution time
                    not necessarily. sometimes it can be shorter execution time and more bugs found in your program at compile time.
                    Originally posted by perpetually high View Post
                    the last, greatest, stable version (9.3.0 in my case)
                    last version in 9 branch is 9.4. i happen to use 9.3 in current project and i found deterministic ice in it(sometimes it ices but succeeds on rerun, but this one required disabling one optimization pass). i.e. 9.3 is definitely bad version

                    Comment

                    Working...
                    X