dmd codegen improvements

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Tue Aug 18 14:55:25 PDT 2015


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.

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


> 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.



More information about the Digitalmars-d mailing list