Which optimisations are are easier or perhaps only possible in the frontend ?

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Thu Dec 11 23:48:04 PST 2014


On Friday, 12 December 2014 at 00:20:30 UTC, deadalnix wrote:
>
> More generally, you don't want to optimize anything in the 
> frontend:
>  - It is gonna create unscrutable code for debug.
>  - You optimize before inlining, and so won't get the 
> optimization allowed by inlining.
>
> You want to add metadata to your IR int he front end to inform 
> the middle and back end. You proceed to :
>  - optimize callee
>  - estimate cost of inlining optimized callee and possibly 
> inline
>  - optimize caller
>
> Note that this is a recursive process. You may do a second 
> dance in the backend to get all platform specific optimization 
> going on.

Thanks deadalnix. I thought about using meta-data. I guess this 
is the most sensible road.




More information about the Digitalmars-d mailing list