Announcement

Collapse
No announcement yet.

LLVM 2.6 Released, Clang Is Now Production Ready

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

  • #16
    Originally posted by StringCheesian View Post
    There are two kinds of GCC optimizations:
    1. those enabled by -O2
    2. those that backfire, crash GCC, generate bad code, or are otherwise not reliable

    The flags you mentioned are of the latter sort, as the Mozilla devs have discovered with Firefox. Gentoo ricer learn this the hard way too.

    Thus I think its fair to disregard GCC's alleged support for profiling. At least until Firefox can have Profile Guided Optimization on Linux.
    there seems to be alot of people talking about things they have no clue about. GCC profile generated optimizations works great with firefox and has for a long time. also -O3 has been very stable for ages, or can you submit some code that won't compile correctly with -O3? I build stuff with profile guided optimizations every day and have had no problems, and I've had speed improvements as high as ~10-13% so it's a very strong optimization. With the data the profile stage collects it makes much better choices with branch prediction and caches.

    Comment


    • #17
      Originally posted by elanthis View Post
      First, the GCC codebase is disgustingly hard to work with. It's a giant pile of hacky C code, where as LLVM and Clang are (relatively) cleanly written C++ with intentional effort put into making it easy to hack on.
      LLVM is alot cleaner that's for sure, given that it was started 13 years later and written using an object oriented language (c++). However, gcc is not the same gcc that was released in 1987, it's internals have been greatly enhanced since then.

      Originally posted by elanthis View Post
      Second, RMS and the FSF are tools tbat only just recently stopped trying to actively make GCC near impossible to reuse. Clang was designed to be very easily used for third-party tools, like static analyzers or IDE integration, which RMS did not want to make possible with GCC out of an insane fear that proprietary developers would abuse any kind of parser API in a non-Free project. It took years of developers and users complaining and the looming threat of LLVM+Clang to get him to change his tune.
      RMS has had nothing to do with GCC for ages, it's all done by the gcc steering committee, consisting of people from redhat, ibm, suse etc. You are spewing nonsense.


      Originally posted by elanthis View Post
      Third, LLVM has for a long time now had capable interprocedural analysis and optimization, while GCC has only just started to get support for such things via a rather hacky and kludgy approach. IPO allows for greater optimization of a program or library, and has been supported in various commercial compilers for some time.
      LLVM's LTO (link-time-optimization) only works for OSX afaik, although you should be able to get it to work on linux using the gold linker plugin but this seems to be a big hit or miss deal. GCC 4.5 branch has LTO now.

      LLVM has made great strides during the last year and is edging in on GCC. On many of the language shootout tests I've tried using -march=native -O3 -mfpmath=sse it beats gcc (although by a small margin), however on most large programs it loses by alot ~10%. Also it lacks profile-guided-optimization which really does make a big difference. I'm eager to get started on benchmarking llvm 2.6 given that there seems to be alot of improvements and comparing it to gcc 4.4 and 4.5 snapshots.

      Comment


      • #18
        Originally posted by XorEaxEax View Post
        there seems to be alot of people talking about things they have no clue about. GCC profile generated optimizations works great with firefox and has for a long time. also -O3 has been very stable for ages, or can you submit some code that won't compile correctly with -O3? I build stuff with profile guided optimizations every day and have had no problems, and I've had speed improvements as high as ~10-13% so it's a very strong optimization. With the data the profile stage collects it makes much better choices with branch prediction and caches.
        ya,
        "The Mozilla build system contains support for building with Profile-Guided Optimization (PGO) with GCC 4 or newer and Microsoft Visual C++ 2005 (Professional Edition) or newer."

        from:
        https://developer.mozilla.org/en/Bui...d_Optimization

        Comment


        • #19
          Originally posted by garytr24 View Post
          ya,
          "The Mozilla build system contains support for building with Profile-Guided Optimization (PGO) with GCC 4 or newer and Microsoft Visual C++ 2005 (Professional Edition) or newer."

          from:
          https://developer.mozilla.org/en/Bui...d_Optimization
          If there's nothing wrong with GCC's PGO support, then why is GCC being blamed here:
          https://bugzilla.mozilla.org/show_bug.cgi?id=418866

          Comment


          • #20
            Originally posted by XorEaxEax View Post
            also -O3 has been very stable for ages, or can you submit some code that won't compile correctly with -O3?
            I've had a very different experience. After switching from my first distro (Mandrake) to Gentoo I went wild on CFLAGS to see what would happen and had problems. I found by trial and error that there was a risk of instability with anything more than -O2.

            I still see Gentoo forum threads where the problem turns out to be CFLAGS in excess of "-O2 -march=something". It seems to me that nothing has changed and GCC's optimizer is still buggy outside of -O2.

            So I don't see how more advanced optimizations could be working fine for you unless you're not applying it to as broad a variety of source code as Gentoo users do.
            Last edited by StringCheesian; 10-26-2009, 12:30 PM.

            Comment


            • #21
              I'm using -march=native -O3 -fomit-frame-pointer in my makepkg.conf on Arch Linux and I've had no problems in recent year. True I don't recompile everything (perhaps unlike many Gentoo users) but mostly packages that actually benefit from speed optimization. This includes compression, video codecs, emulators... Also I often use other flags like PGO (-fprofile-generate, -fprofile-use), -ffast-math on stuff I recompile and it's been rock solid. Also I'm going to try out the new link time optimizations in the current gcc 4.5 snapshots soon, although they are likely to break certain things since they are still in development.

              Are there any specific packages or threads that you can point to that fails to build correctly with -O3 using gcc 4.x?

              Comment


              • #22
                Originally posted by StringCheesian View Post
                If there's nothing wrong with GCC's PGO support, then why is GCC being blamed here:
                https://bugzilla.mozilla.org/show_bug.cgi?id=418866
                Yes there were problems compiling the firefox 3.6 beta, atleast that's what I read in the Arch forum. But gcc 4.5 seemed to build it fine. Firefox 3.5.x compiles fine with PGO.

                Comment


                • #23
                  Originally posted by XorEaxEax View Post
                  Are there any specific packages or threads that you can point to that fails to build correctly with -O3 using gcc 4.x?
                  Hmm... maybe you're right. I did some forum searches and googling and couldn't find anything about -O3 on 4.4.x.

                  There was this for -ftracer
                  http://forums.gentoo.org/viewtopic-p...4.html#5846744

                  Comment


                  • #24
                    Originally posted by StringCheesian View Post
                    Well, -ftracer has to be manually set and isn't part of any -O levels. It is however added during the -fprofile-use stage from gcc 4.4 atleast, which would indicate that it is stable from that version. And since I've done alot of profiled builds on a variety of packages it certainly seems stable from my end.

                    Comment


                    • #25
                      Originally posted by Micket View Post
                      I like the other features (other than faster compile time, and hopefully faster programs) even more, but I'm not sure what languages can take full advantage of it...
                      Originally posted by elanthis View Post
                      say, a REAL meta-programming facility in C++...
                      I think you're looking for D...

                      Originally posted by XorEaxEax View Post
                      Are there any specific packages or threads that you can point to that fails to build correctly with -O3 using gcc 4.x?
                      Seems like Boost usually fails to compile with anything beyond -O2, but that may be a design feature that attempts to prevent you from using it.

                      Comment


                      • #26
                        Originally posted by elanthis View Post
                        ALL projects die eventually. Linux itself will die someday. Maybe not anytime soon, but it'll happen.
                        In what contest? I don't see any Linux fork out there. Are you a prophet or something? :P

                        Heck, Windows already died twice, too.
                        When?

                        Clang could replace GCC, and it can only be an improvement (because if it isn't, it won't ever replace GCC in the first place).
                        Clang can't even compile Linux kernel, GCC supports far more architectures, it's solid, mature and it's noticeably faster in some things, so right now, it doesn't seem GCC will die before Clang.

                        Btw. GCC devs can always take LLVM code :> If it will be hard to adapt, why not to do llvm flag which will instruct GCC to use LLVM (to use it in situations where it makes faster code) instead: gcc -llvm [...] GCC will have all benefits then ;P just joking...
                        Last edited by kraftman; 10-28-2009, 05:02 AM.

                        Comment

                        Working...
                        X