Re: left-to-right (was In-Out Parameters for functions)

From: Robert I. Eachus (rieachus_at_comcast.net)
Date: 02/28/04


Date: Sat, 28 Feb 2004 11:58:35 -0500

Stephen Leake wrote:

> But you haven't answered my question. Is there, in actual fact, any
> compiler that actually does these optimizations?

Sure, lots of them, but that is not really the interesting question.
The interesting experiment is to find a way to turn off just the
optimizations that take advantage of the reordering freedoms, then see
what effect it has on the performance of the compiled code on some set
of benchmarks.

It might take hacking source to be sure of doing exactly that in GNAT,
but you can probably bound the benefit using current optimization switches.

Of course, the real interesting part of the project would be to run the
suite on different hardware architectures and see how much of an effect
it has on modern CPU architectures compared to say a Pentium or 80486
without superscalar and OoO support in the CPU.

It would probably make a good senior project for some undergraduate, and
if the results showed that the effect of such optimizations on
superscalar out-of-order CPUs it might make a Master's or PhD thesis.
In any case it should result in a couple of papers.

Why do I suggest this as an academic project? Well years go the same
sort of thing was done by hardware and language architects both in
academia and in industry. The conclusion AT THAT TIME, was that the
freedom to reorder, and the compiler code to take advantage of it, was
very worthwhile. With OoO superscaler machines, it is not clear that
there would be any advantage to requiring "more predictable" semantics
in programming languages given what happens during execution. But it
could be that the "optimization freedoms" don't buy much in the way of
performance anymore.

-- 
                                           Robert I. Eachus
"The only thing necessary for the triumph of evil is for good men to do 
nothing." --Edmund Burke


Relevant Pages

  • Re: Moving WASD from one box to another...
    ... With differing types of CPU there *are* some considerations. ... base level of V6.0 and generic compiler optimizations. ... This can be done by using the $ @INSTALL procedure on the target system once the WASD tree has been put in place. ...
    (comp.os.vms)
  • Re: WaitForSingleObject() will not deadlock
    ... One is to hijack the semantics of volatile to disable compiler optimizations ... and otherwise let the compiler to agressive optimization. ... Agressive optimizations are the ones that work on the edge of the semantics of the ... Because the compiler can see into lock and unlock, it is able to reduce f ...
    (microsoft.public.vc.mfc)
  • Re: WaitForSingleObject() will not deadlock
    ... represent an incorrect implementation of the language. ... the *compiler* does not guarantee this. ... but to state it in terms of the execution instead of the formal semantics of the language ... as long as the optimizations do not change the semantics of the language). ...
    (microsoft.public.vc.mfc)
  • Re: optimized code
    ... > loop invariants are handled by the JIT not by the compiler fron-ends. ... generates the best optimized MSIL of any of the .NET languages. ... standard native code optimizations on MSIL code. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: c compilation - gcc vs visual c
    ... I recently compiled a numerically intensive c project under cygwin gcc ... MS focuses a lot more on specific optimizations, ... the simplest approach, however (and the one I currently use in my compiler), ... (silly code), are ones I focus on fixing. ...
    (comp.lang.c)