Slashdot Mirror


Inside the Intel Compiler

deadfx writes "Linux Journal is carrying an article authored by members of the Intel Compiler Lab examining specific optimizations employed by the compiler that allowed it to beat the gcc compiler on several benchmarks."

4 of 52 comments (clear)

  1. bad code gets good optimization.. by josepha48 · · Score: 2, Interesting
    To me it would seem that the partial redundancy would only work if the code was like the examples they give. If you coded such that there was no partial redundancy in the code then it probably would not be any better than gcc.

    i.e.
    x[i] += a[i+j*n] + b[i+j*n];
    could be coded as
    l=i+j*n;
    x[i] += a[l] + b[l];

    Both would yeild the same result, one would use more variables, but both would only do the calc once. Would this be any different?

    Personally I can see not doing the calc's twice, but I'd think that a good programmer would code so he is not doing the calcs twice.

    --

    Only 'flamers' flame!

  2. Re:Patented? by devphil · · Score: 5, Interesting


    Many of the optimizations discussed in the article are being implemented in GCC. Actually, some (e.g., SSA) have been in a parallel development branch for quite a while now, where they can make major funky changes and not have to play by the "no breakage" rules that govern the release branches.

    Just last week there was a discussion about OpenMP and how it might be implemented in GCC.

    A huge optimization that the article mentioned in the intro (but didn't go into in depth, I think) is intraprocedural optimization. That can be hard in languages that don't compile the entire program at once; you really need help from the linker.

    it can be built and run on some very unusual and dated pieces of hardware (although, from the recent release notes, it looks like some of the most obscure ones are slipping into oblivion.)

    Absolutely. If nobody's using those platforms, and we want to make a change that might effect them in a negative way -- but we can't tell, because we don't have that machine available to test on -- we have two options: make the change and hope it doesn't break, or deliberately mark the platform as "no one cares, so neither do we".

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  3. Optimization and compiler bugs by dpbsmith · · Score: 2, Interesting

    Something that's been bothering me ever since I was bitten by my first compiler bug several decades ago. (And couldn't get the bug acknowledged by the vendor because I couldn't get it to occur in a short code fragment).

    WHY does every vendor have optimization on by default all the time? Optimization routines in compilers are the most likely places to have bugs, and they are often extraordinarily subtle bugs that are hard to reproduce. I have personally encountered bugs in which the insertion of deletion of a COMMENT affected the code, and certainly many of us have encountered bugs that could not be demonstrated in a short fragment because they only occurred when things got deeply nested and the compiler ran out of temporary registers.

    Optimization also interferes with debuggers. I know that YOU are capable of doing up-front planning and writing bug-free code, but _I_ am not, and forcing me to recompile in order to use the debugger is one more hurdle in the way of getting the bugs out of the code.

    Why isn't optimization off by default, and turned on only in specific modules, or certain SECTIONS of the code (with pragmas)--those specific sections that can be demonstrated to be time-critical?

  4. Re:GCC limits optimizations due to politics? by truth_revealed · · Score: 2, Interesting

    It's a shame that RMS fails to see the advantage of opening up GCC's data structures. Sure there would be some cheaters who'd use it for personal gain (writing proprietary front-ends for the GCC backend) - but there would be ten times as many people creating useful free languages and other free tools with it. It would also greatly aid in the learning of GCC itself (no simple task). It's a calculated risk, but in my opinion, one with more upside than downside potential. But who are we to say what RMS should do with his work? The FSF is the copyright holder, afterall.