dmd codegen improvements

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Tue Aug 18 15:04:24 PDT 2015


On Tuesday, 18 August 2015 at 21:55:26 UTC, Walter Bright wrote:
> On 8/18/2015 2:33 PM, deadalnix wrote:
>> There is none. There is a ton of 0.5% one that adds up to the 
>> 30% difference.
>
> I regard a simple pattern that nets 0.5% as quite a worthwhile 
> win. That's only 60 of those to make up the difference.
>
> If you've got any that you know of that would net 0.5% for dmd, 
> lay it on me!
>
>
>> If I'd were to bet on what would impact DMD perfs the most, 
>> I'd go for SRAO, and
>> a inliner in the middle end that works bottom up :
>>   - Explore the call graph to-down optimizing functions along 
>> the way
>>   - Backtrack bottom-up and check for inlining opportunities.
>>   - Rerun optimizations on the function inlining was done in.
>
> That's how the inliner already works. The data flow analysis 
> optimizer also runs repeatedly as each optimization exposes 
> more possibilities. The register allocator also runs repeatedly.
>

My understanding is that the inliner is in the front end. This 
definitively do not work the way I describe it here.

> (I am unfamiliar with the term SRAO. Google comes up with 
> nothing for it.)
>

That is because I made a typo, sorry.

It stand for 'scalar replacement of aggregate' aka SROA (not 
SRAO).

You can find literature on the subject.

>> It require a fair amount of tweaking and probably need a way 
>> for the backends to
>> provide a cost heuristic for various functions,
>
> A cost heuristic is already used for the inliner (it's in the 
> front end, in 'inline.d'). A cost heuristic is also used for 
> the register allocator.

I'm not sure how this can be made to work the way I describe it 
in the frontend.



More information about the Digitalmars-d mailing list