Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming Software IT Linux Technology

LLVM 2.2 Released 128

performance geek writes "LLVM 2.2 was released yesterday! This is the thirteenth public release of the open-source compiler that started as a GCC fork. LLVM supports several aggressive optimizations, in compile-, link- and run-time, and often produces faster (1.5-3x) code than GCC. It is also much faster than GCC at compiling (despite the slow link-time optimizations). Gentoo users are already trying to build the whole system with the LLVM toolchain to get the extra performance bit."
This discussion has been archived. No new comments can be posted.

LLVM 2.2 Released

Comments Filter:
  • by emj ( 15659 ) on Tuesday February 12, 2008 @11:40AM (#22392598) Journal
    LWN has discussion [lwn.net] on this, and there is a nice video presentation of LLVM 2.0 [google.com] as well. Cool thing, but as they say it isn't really about replacing GCC.
  • by Goaway ( 82658 ) on Tuesday February 12, 2008 @11:41AM (#22392610) Homepage
    "The open-source compiler that started as a GCC fork"? LLVM is not a compiler. It is a code generator, optimizer and virtual machine, usable as a compiler back-end. It later added a gcc-based front end.

    Also, Apple is currently driving development of an alternate BSD-licensed front end named clang [llvm.org].
    • by samkass ( 174571 ) on Tuesday February 12, 2008 @12:44PM (#22393458) Homepage Journal
      Although Apple states that clang is not designed to replace GCC overall, I would be surprised if Apple wasn't planning on it replacing GCC in their products. It appears to provide more performance, smaller binaries, and a freer license than GCC.

      Apple already reportedly uses it to compile their graphics code so that the same code can run on either a GPU or the CPU regardless of chipset available.
      • and a freer license than GCC.

        What does this mean, exactly? That they want a compiler which they can modify, distribute and not publish the source? You do know that gcc being GPL does not imply that code compiled with it not the resulting binaries are GPL, right?

        • by MenTaLguY ( 5483 )

          ...they want a compiler which they can modify, distribute and not publish the source?

          Yes.

          • That's why Apple used a BSD base as opposed to a Linux base for Mac OS X.
            • Re: (Score:3, Informative)

              by LizardKing ( 5245 )

              That's why Apple used a BSD base as opposed to a Linux base for Mac OS X.

              No, it's because MacOS X is a continuation of NeXTstep, which was based on a BSD userland and Mach kernel (itself originally developed from the BSD Unix kernel circa version 4.3). At the time NeXTstep was originally developed, Linux didn't exist and the GNU userland was still in its infancy. In addition, I've never seen any evidence that Apple considered a move to a Linux base for MacOS X, and considering how solid NeXTstep and Ope

              • Mac OS 9 wasn't Unix based. When they jumped to a Unix base with OS X, Linux had been well established. They choose a BSD base because of the license. OS X isn't open source. The kernel is, but it hasn't always been. At times Apple has closed off the source of the kernel. If they chose a Linux base, OS X would have to be completely open source, and that was never going to fly.

                Apple chose a license that allowed them to take open code, alter, redistribute, and not share the source. Again, the parent ex
                • by Goaway ( 82658 )
                  Which part of "MacOS X is a continuation of NeXTstep" did you not understand? Mac OS X is not a from-scratch project. It was not created right after Mac OS 9. It's entirely based on NeXTstep, which is far older.
                  • So they built upon something existing. That's backwards logic. You insist that because they built upon an existing product, that ruled out them possibly using another existing product because NeXTstep started before Linux was big? That makes zero sense.

                    Furthermore, Apple was been one of the biggest pushers of DRM and proprietary standards for years. Not to mention that they've taken credit for innovations and inventions that have existed in the open source community for years. (Virtual desktops come to
                    • by Goaway ( 82658 )

                      You insist that because they built upon an existing product, that ruled out them possibly using another existing product because NeXTstep started before Linux was big?

                      No, using another existing product was ruled out because Steve Jobs was the founder of NeXT. Learn some computing history.

                      Furthermore, Apple was been one of the biggest pushers of DRM

                      Bigger than Microsoft?

                      and proprietary standards

                      Name two.

                      Given that they weren't even willing to keep the kernel open

                      What exactly is http://www.opensource.apple.com/darwinsource/ [apple.com], then?

                      Perhaps you should pay a little less attention to internet hysteria, and a little more to actual truth.

                    • Bill Gates also worked heavily on OS/2 and promised it would be the OS for businesses. What we have today has little to do with DOS or early versions of Windows, but rather NT which they bought.

                      And OS X has little to nothing to do with previous iterations of the Mac OS. Steve Jobs had ties to NeXTstep, but that didn't mean Apple had to use it. Again, Apple has abandoned other things, just as Microsoft has.

                      I also didn't say Apple was the single biggest pusher of DRM, simply that they have been one of the
                    • by Goaway ( 82658 )

                      iTunes phones home,

                      It does not. Once again, you believe this because you belive internet hysteria without actually checking up on the facts.

                      The bundle software in much the same way that Microsoft was found guilty of anti-trust laws.

                      Bundling software is not and has never been illegal. The reason Microsoft got in trouble was because they did this while in a position of market dominance, in which case there are additional restrictions on what you are allowed to do. You can hardly claim Apple has a monopoly.

                      Apple has waffled on that.

                      You mean, the internet threw a hissy fit over an issue that never existed. The source has never been closed.

                    • http://blogs.zdnet.com/Apple/?p=75 [zdnet.com]

                      Apple even altered the firewall software on Mac OS X to hide the fact that iTunes phones home.

                      And the source on Darwin was closed. They refused to release code required to compile and run Darwin. They refused to release code that was part of Darwin.

                      You need to check your facts.
                    • by Goaway ( 82658 )

                      http://blogs.zdnet.com/Apple/?p=75

                      Right. Internet hysteria. That whole thing was because the iTunes store would recommend music to you based on what you were listening to. This was later changed to not be on by default after people complained. There was never any indication that it was malicious or meant for data mining.

                      Apple even altered the firewall software on Mac OS X to hide the fact that iTunes phones home.

                      The OS X firewall does not monitor outgoing connections at all. It would never have shown if iTunes phoned home, and thus "modifying" it would make no sense.

                      And the source on Darwin was closed. They refused to release code required to compile and run Darwin. They refused to release code that was part of Darwin.

                      Again, internet hysteria. http://lists.apple.com/archives/darwin [apple.com]

                • Re: (Score:1, Informative)

                  by Anonymous Coward
                  Did you read a word of the post you're replying to?

                  Mac OS 9 wasn't Unix based.

                  So what? Who said it was? And who cares anyway? It's completely and utterly irrelevant, because OS X isn't derived from MacOS 9, it's derived from NeXTStep.

                  When they jumped to a Unix base with OS X, Linux had been well established.

                  But they didn't jump to a Unix base; they replaced MacOS with a new operating system based on NeXTStep. NeXTStep was first developed in the 1980s, many years before Linux even existed at all, let alo

                  • Bullshit. You don't know what you're talking about. There is no reason whatsoever why you can't run a closed-source userland on a GPL kernel.

                    But you can't link closed source modules into a GPL kernel, and that's an issue with in-kernel DRM, for one, and potentially other technologies that, while not so based on secrecy themselves, Apple would rather keep closed-source.

                    This said, NeXTStep was already there, and arguably Apple bought NeXT because of it and related technologies, so there's no good reason to go from those underpinnings to a linux-based system.

                • When they jumped to a Unix base with OS X, Linux had been well established. They choose a BSD base because of the license.

                  No, they chose NeXTStep as the base because of its features, which is why they bought NeXT. From what I understand, the decision wasn't made to "jump to Unix" separately from choosing NeXT, they were looking for a new OS, and considered continuing an internal (non-Unix-based) project to replace MacOS, or purchasing an existing OS and adapting it: there was no separate decision for Unix,

              • Actually, Apple DID evaluate linux before NeXT became MacOSX. They ported linux to apple powerpc hardware under the mach microkernel in 1996.

                http://en.wikipedia.org/wiki/MkLinux [wikipedia.org]

                --jeffk++
          • I didn't think that one was too hard to figure out either :P
          • Seems that you didn't grasp the whole "free as in freedom" concept, then. I've come to realize that the best way to characterize that "free as in freedom" thing is this: it's not about your freedoms, as a developer or user. It's about the code's freedoms as an entity unto itself. And being closed (like the BSD license allows, for example), is less free than the LGPL, which in turn is less free than the GPL because it allows you to lock up code around it.

            Whether open source must mean free software, and whe

        • There's some concern in the BSD camps and elsewhere about the switch to GPLv3 for GCC and the GNU binutils. Some of the impetus for the changes in GPLv3 is the use of GCC in the embedded programming world, where the development and target platforms are closed source (usually Windows using Cygwin in the case of the development platform). As embedded applications is where BSD is quite heavily used, without the fanfare that Linux often gets simply because you don't have to make the source code available, compa

          • GPLv2 (without the "later version" wording).

            You do understand that the usual "or a later version" clause leaves the choice of version to you (or whoever is distributing the code), right?

            • by Goaway ( 82658 )
              No, it leaves the choice with those who drive the development. If the main development branch suddenly decides to go GPL3 only, you are either stuck with an outdated version, or forced to use the GPL3 code.
              • That's ridiculous. You are only required to use the GPL3 code if you want to make use of what those developers that opted for the GPL3 worked hard to write. Why would you be entitled to take advantage of their work without acepting their conditions?
        • by samkass ( 174571 )
          What does this mean, exactly? That they want a compiler which they can modify, distribute and not publish the source?

          Obviously that's not their primary motivation since they are, in fact, publishing the source. But I suspect they want the freedom to combine it with any other source they have in any way they deem technically advantageous without the license having anything to say about it. They probably also want the freedom to control the timing and manner of the publication of the source. And yes, they
          • What does this mean, exactly? That they want a compiler which they can modify, distribute and not publish the source?

            Obviously that's not their primary motivation since they are, in fact, publishing the source. But I suspect they want the freedom to combine it with any other source they have in any way they deem technically advantageous without the license having anything to say about it. They probably also want the freedom to control the timing and manner of the publication of the source. And yes, they probably want the ability to not publish the source in certain circumstances when they feel that doing so would be detrimental to them.

            Ok, so what they want is more freedom for themselves. Which is quite a different thing from freedom for the user, which is what the GPL set out to protect. You said "it appears to provide a freer license": it is always necessary to be explicit about who gets the extra freedom.

            GPL is a great license for its own ecosystem, but don't try to pretend that it isn't more restrictive than BSD.

            It is less restrictive for the developer, and more restrictive for the user. Restrictiveness is not a totally ordered [wikipedia.org] value.

            In this particular case, according to what you say, Apple wants to be more free so as to be able to restr

            • by Goaway ( 82658 )

              Ok, so what they want is more freedom for themselves. Which is quite a different thing from freedom for the user, which is what the GPL set out to protect. You said "it appears to provide a freer license": it is always necessary to be explicit about who gets the extra freedom.

              And the developer is the party bound by the license, not the user. Thus, a license with less restrictions, like BSD, is "more free" in any useful sense of the word.

              You may think it is good to protect the user's interests, but this does not mean the "license is more free". It is less free. Don't conflate what you want with "freedom".

              • Ok, so what they want is more freedom for themselves. Which is quite a different thing from freedom for the user, which is what the GPL set out to protect. You said "it appears to provide a freer license": it is always necessary to be explicit about who gets the extra freedom.

                And the developer is the party bound by the license, not the user. Thus, a license with less restrictions, like BSD, is "more free" in any useful sense of the word.

                The party bound by the license is the distributor. If you do not understand that, you really should not be making comments on the GPL...

                You may think it is good to protect the user's interests, but this does not mean the "license is more free". It is less free. Don't conflate what you want with "freedom".

                What I am saying is that a statement such as "the license is more free" does not mean anything. You have to specify who it provides that extra freedom and what that freedom allows the recipient to do. Likewise, a statement like "it is less free" does not mean anything.

                • by Goaway ( 82658 )

                  The party bound by the license is the distributor.
                  And in how many cases is the developer not the distributor? Stop playing semantic games to cloud the issue.
                  • Maybe you have heard about this groups of people called `distribution makers'? You can check http://www.redhat.com/ [redhat.com], http://www.debian.org/ [debian.org], http://ubuntu.com/ [ubuntu.com], and so on. I hear there is a whole site [distrowatch.com] dedicated to simply listing linux distros! They surely are not the developers of all the code they package, you know.

                    The fact that the GPL is a license on distribution is a hardly a semantic point: it is essentially the whole point of the license!

                    You claimed that "the developer is the party bound by the lice

                    • by Goaway ( 82658 )
                      Still playing silly semantic games. The fact that there is a second group of distributors makes no difference to the actual argument. That second group is not "users", either. My point that the user is not bound by the license still holds exactly as before.
                    • Your point was literally [slashdot.org]:

                      the developer is the party bound by the license, not the user.

                      I have never said that the user is bound by the license, as that would be absurdly idiotic, as the license says so itself in the first couple of paragraphs. The developer, too, is not bound by the license. The distributor is who is bound by the license, because it is a copyright license. It is not that hard.

                      Still playing silly semantic games. The fact that there is a second group of distributors makes no difference to the actual argument. That second group is not "users", either.

                      I have no idea what you are trying to say here. You asked "And in how many cases is the developer not the distributor?" and I pointed you to the easily established fact th

                    • by Goaway ( 82658 )
                      Sigh.

                      Did you even make the tiniest effort to understand what my original point was?
                    • Your point [slashdot.org] was that, since the GPL binds the developer, a license such as BSD is freer. Now, the GPL does not bind the developer, so that argument carries absolutely no weight. There are other arguments to be made, but yours does not take you anywhere.

                      After that you said:

                      You may think it is good to protect the user's interests, but this does not mean the "license is more free". It is less free. Don't conflate what you want with "freedom".

                      I cannot make any sense of this. As I said before, there is no total order on liberties. You appear to believe that `protecting the user' means `less free', while `protecting the developer' means `more free': this is a meaningless state

                    • by Goaway ( 82658 )

                      Your point was that, since the GPL binds the developer, a license such as BSD is freer. Now, the GPL does not bind the developer, so that argument carries absolutely no weight. There are other arguments to be made, but yours does not take you anywhere.

                      And you dodge the point that the developer is pretty much always also the distributor. The fact that there are other distributors too doesn't change this. Thus, the developer is for all intents and purposes bound by the GPL.

                      I cannot make any sense of this. As I said before, there is no total order on liberties. You appear to believe that `protecting the user' means `less free', while `protecting the developer' means `more free':

                      No, I mean that putting more demands on the developer means less free, and putting less demands on the developer means more free. The question of the user's ability to do this or that is entirely secondary, and a separate matter. You can say that "this license is more protective of use

                    • And you dodge the point that the developer is pretty much always also the distributor. The fact that there are other distributors too doesn't change this. Thus, the developer is for all intents and purposes bound by the GPL.

                      Of course a person can assume many roles.

                      As long as the developer is only a developer, he can do whatever he pleases with the GPL code written by others he got for free. Now, as soon as he wants to distribute it, there are terms he has to accept. For example, there is quite a lot of modified GPL code in my computer, which I modified from sources I got from others---yet I have not distributed them, so I am 100% unbound by the GPL. Were I to distribute the modified code, thereby becoming a distributor for

                    • by Goaway ( 82658 )
                      I would have thought that everyone could agree that a programmer tinkering around with some source on his computer and then abandoning it would not be of any relevance of interest to the discussion, and could be implicitly ignored.

                      I guess I was wrong there.
                    • You are fun in a way only sci.math cranks are fun...

                      Of course that can be ignored in so far as you are discussing the GPL because the GPL is a distribution license which only affects distribution.

            • by samkass ( 174571 )
              Ok, so what they want is more freedom for themselves. Which is quite a different thing from freedom for the user

              They ARE the user, so in this case it's the same.
              • Oh, come on. They are not. That claim is plainly silly.

      • ...and a freer license than GCC.

        Really? I'm glad you weren't around when freeing the slaves was the important issue. Perhaps we should have BSDed the slaves. You know, everyone will release them, but of course anyone else can pick them back up and enslave them for themselves.
        • by maxume ( 22995 )
          You know perfectly well that he meant freer as in less restrictive. Acting like words only have the meanings that you endorse is tiresome.

          And yes, the GPL is more restrictive than something like BSD. Plenty of people think those restrictions are to good effect, but they are still restrictions in the sense that there are things that can be done with BSD(or similar) code that cannot be done with GPL code.
          • You know perfectly well that he meant freer as in less restrictive. Acting like words only have the meanings that you endorse is tiresome.

            Denying that the words have more than one possible meaning is dishonest.

            He meant freer as in "less restrictive for the developer". There are other ways for code to be free.

            • by maxume ( 22995 )
              Who is denying that the words have more than meaning? What exactly do you interpret "acting like words only have the meanings that you endorse" to be talking about?

              My intent was to imply that yes, free often means Free in the way that GNU, etc use it, but that it is tiresome to act like that is the only meaning it has. I'm pretty sure that is what I did, because in the world I live in, when someone says something, it is best to interpret what they are saying in the context of their own words, not in whateve
        • We're talking about freedom not GNU Freedom*. If you want to draw politic analogies, then it's a little like comparing BSD liberalism to GNU Marxism with Stallman as Stalin, changing the consitution - sorry, license - as it suits him.

          * A registered trademark of the Free Software Foundation. (I jest).

          • by k8to ( 9046 )
            If you're going to go completely off the deep end and call the GPL commie, at least get your commies straight. Stalin isn't marxist.
            • If you're going to go completely off the deep end and call the GPL commie, at least get your commies straight. Stalin isn't marxist.

              Stalin wasn't a Marxist? He described himself as Marxist-Leninist, and attempted to drag the Soviet Union into the industrial age with the five year plans ostensibly to fit with Marxist preconditions for a Communist state. Marxist apologists like to counter the argument that their doctrine is fundamentally flawed by claiming that Stalin, Mao, et. al. aren't Marxists, while

  • by Jellybob ( 597204 ) on Tuesday February 12, 2008 @11:50AM (#22392736) Journal
    Of course the Gentoo users are off recompiling there whole system for the extra performance. It's what they do - why use your computer when you can make it .242% faster with only 15 hours of compiling?
    • That's why I left for Ubuntu, but honestly, if I can make it 3x faster with 15 hours of compiling?
      • why use your computer when you can make it .242% faster with only 15 hours of compiling?

        but honestly, if I can make it 3x faster with 15 hours of compiling?

        Err, I think you're missing the point.

        • Re: (Score:3, Informative)

          Actually, I was correcting the point. TFS claims 1.5x-3x speed improvement over gcc.

          Of course, TFS was also dead wrong about Gentoo users trying to build the whole system. Apparently there's an ebuild to install llvm, which seems like an obvious thing to do. There's also mention of Mesa intending to switch to llvm, and other projects might follow, but those are isolated programs, no more shocking or revolutionary than the fact that Eclipse is written in Java.
          • by devangm ( 869429 )
            I've tried the v2.1 ebuilds with the 4.0 gcc frontend and gzip/bzip were 10-20% slower on most types of files on my athlon64x2. I'm guessing the optimizations need to be turned on relevant to the codebase, and most are off by default.

            I wish the ebuilds had gcc-config support and the fix_libtool thing might need some fixing too.
            • I'm not going to pretend to know anything about the gzip/bzip code but I would guess that processor hungry tools like those are already pretty optimized at the C language level if not assembly.

              Perhaps optimizations like those to trick the gcc compiler into generating faster code has the reverse effect on LLVM?

              Again, I know nothing.
          • Actually, I was correcting the point.

            The point in front of the 242%. It was a joke.

            *sigh*

          • by makomk ( 752139 )
            I think the main reason Mesa are interested in LLVM is not so much as a gcc replacement, but to generate code for shaders and the like...
      • by eddy ( 18759 )
        Your whole system 3x faster by changing compiler? You never can. There isn't that much performance hidden in there.
        • Yeah, I would bet those are very special cases where you get 3x performance. Of a C program that has 1000 functions probably only a small percentage of those functions could be sped up 3x and they're probably trivial and don't contribute much to the overall runtime of that program.

          If any significant profiling has been done on CPU intensive programs the authors might already be doing optimizations at the C language level.
        • Re: (Score:3, Informative)

          by Just Some Guy ( 3352 )

          There isn't that much performance hidden in there.

          Fortunately for us, compiler researchers say you're wrong. LLVM takes the Java-like approach of seeing what parts of your code can be optimized by gathering runtime profiling information, then using that to dynamically recompile parts of your code that really need it. I'd be surprised if that kind of system couldn't squeeze out quite a bit more performance.

    • Gentoo Users (Score:4, Insightful)

      by Enderandrew ( 866215 ) <enderandrew@NOsPAM.gmail.com> on Tuesday February 12, 2008 @01:21PM (#22393976) Homepage Journal
      Some Gentoo users just want fine-grained control over their systems. They get exactly the packages they want, configured the way they want, and nothing else. The biggest power of Gentoo isn't compile optimizations, but rather use flags. I want my box to operate exactly how I want it. Gentoo allows me that freedom.

      It does take a good deal more time and effort, but frankly some people enjoy that sort of thing as a hobby, the way others constantly tinker with their car.

      For what it is worth, portage (and the two portage replacements, pauldis and pkgcore) are quite frankly hands down the best package managers out there, and they handle pre-compiled binary packages just as well. I really honestly believe the rest of the Linux world would be greatly benefited by using one package manager, regardless of how they compile or pack their binaries.

      Set a use flag for openSUSE_10.3 and portage knows what packages to grab. It could work.
      • For what it is worth, portage (and the two portage replacements, pauldis and pkgcore) are quite frankly hands down the best package managers out there, and they handle pre-compiled binary packages just as well.

        The problem is that in my view gentoo is often the worst distribution out there, with very low quality packages. Maybe the package manager is great, but it's not really about technical excenlece it's about how easy it is to use. Sadly most things become easy to use after training, and people don't wa

        • Re: (Score:3, Insightful)

          by Enderandrew ( 866215 )
          There are tons of advantages to portage, but the biggest is use flags. It also handles dependencies far better than apt-get, yast, or anything else I've tried. I've run into broken, dependency hell of other systems. That alone is huge.

          You say the packages in Gentoo are horrible. They are source based packages, the same as you'd get with Debian, or Ubuntu, etc. Each distro does often include distro-specific patches with various packages, but not all. However, I'm not sure which packages are so horrible
          • by emj ( 15659 )
            There are reasons to call packages horrible, ignorance from users, NIH feelings from users and bad integration of developers. What I saw in 2005-6 was that the packages of Gentoo were lower quality than the ones in Debian. I think this was because the Debian way is to include everything, and that is hard to do good which means they have to work more on the packages. The Gentoo way seemed to be about adding as many use flags as possible, I think this leads to packages that hasn't been tested with all feature
            • It is important however to separate the package manager and the packages themselves. If nothing else, portage handles dependencies very well, and will even show you a tree of dependencies for your packages.
        • by Dan Ost ( 415913 )
          If you want manual control over the build (or want to make source changes), instead of typing

          emerge foo

          You'd type

          ebuild foo.ebuild fetch unpack compile install qmerge

          and make whatever changes you wanted in between unpack and compile or compile and install (depending on the kinds of changes you wanted to make.
  • I don't imagine my whole computer will even run more than 10% faster, let alone 3 times faster. However, there are some really large, clunky codebases such as OpenOffice that could probably really benefit from this. And if part of the benefit comes from assembly in-lining, then code that has large chunks of assembly like emulators, or maybe the kernel might benefit as well. It will likely be up to these packages to try and support llvm rather than vice-versa.
    • Gelato uses OpenIMPACT [uiuc.edu] to do the same thing. From what I understand, OpenIMPACT works on both 32-bit and 64-bit code, with most of the development going into the 64-bit stuff and with most of the interest from the HPC and supercomputer groups (which is where I've most often seen the Gelato distro). Both are source-to-source "compilers" (well, since it's source-to-source, I'd look at them more as a pre-compiler). Not sure how well they do at optimizing between source files. I'm also suspicious of linking (fu
  • I remember reading somewhere about some guy targeting javascript so that he could write in any language which has a front-end in LLVM and have it generate javascript.

    I don't know javascript at all...so lets say he did this with Java.

    Could I write a program in C, and have it target a JVM rather than a particular OS/Architecture? Would I get Java array bounds checking of my C code?

"Protozoa are small, and bacteria are small, but viruses are smaller than the both put together."

Working...