Loop optimization

Brad Roberts braddr at puremagic.com
Sun May 16 18:45:42 PDT 2010


On 5/16/2010 4:15 PM, Walter Bright wrote:
> bearophile wrote:
>> DMD compiler doesn't perform many optimizations,
> 
> This is simply false. DMD does an excellent job with integer and pointer
> operations. It does a so-so job with floating point.
> 
> There are probably over a thousand optimizations at all levels that dmd
> does with integer and pointer code.
> 
> Compare the generated code with and without -O. Even without -O, dmd
> does a long list of optimizations (such as common subexpression
> elimination).

While it's false that DMD doesn't do many optimizations.  It's true that it's
behind more modern compiler optimizers.

I've been working to fix some of the grossly bad holes in dmd's inliner which is
one are that's just obviously lacking (see bug 2008).  But gcc and ldc (and
likely msvc though I lack any direct knowledge) are simply a decade or so ahead.
 It's not a criticism of dmd or a suggestion that the priorities are in the
wrong place, just a point of fact.  They've got larger teams of people and are
spending significant time on just improving and adding optimizations.

Later,
Brad


More information about the Digitalmars-d-learn mailing list