LDC cross-module-inlining

claptrap clap at trap.com
Sun Aug 9 22:45:16 UTC 2020


On Sunday, 9 August 2020 at 22:18:13 UTC, Per Nordlöw wrote:
> Is cross-module-inlining enabled by default in LDC when 
> compiling in release mode or do I have to use explicitly flag 
> for it? I can't find any such flag from the output of neither
>
>     ldc2 -h
>
> nor
>
>     ldmd2 -h
>
> .
>
> Johan Engelen mentioned this, then experimental, flag in his 
> DConf talk from 2017 [1]
>
> [1] https://www.youtube.com/watch?v=IZY67TBZ0V4

If you enable link time optimisation you get cross module 
inlining,

-flto=full

I'm not 100% sure but I think LDC did cross module inlining by 
default at some point, then I updated the compiler and had to add 
the LTO thing. I think there is an option to enable just cross 
module inlining, but if you want speed you'll probably want to 
have LTO enabled anyway?


More information about the Digitalmars-d-learn mailing list