avoid codegen pass

russhy russhy at gmail.com
Sat Oct 2 22:59:27 UTC 2021


On Saturday, 2 October 2021 at 22:40:32 UTC, max haughton wrote:
> On Saturday, 2 October 2021 at 18:05:06 UTC, Dennis wrote:
>> On Saturday, 2 October 2021 at 16:57:48 UTC, max haughton 
>> wrote:
>>> Do you have optimizations turned on? i.e. are you compiling 
>>> with -O by accident?
>>
>> Not needed, it's declared:
>> ```D
>> pragma(inline, true) @property _timezone() @safe const pure 
>> nothrow @nogc
>> ```
>>
>> DMD does inlining in the frontend, and without the `-inline` 
>> flag it still inlines functions when requested by 
>> `pragma(inline, true)`. That's why you see it logged even 
>> without codegen or `-inline`.
>>
>> That's not what causes the long compile time though, `dmd -v` 
>> logs passes before doing them, not after, so it's the 
>> semantic3 before the inline pass that's taking all the time.
>
> I was aware (and am not a fan of) inlining in the frontend, but 
> didn't look at the Phobos code.
>
> Honestly dmd shouldn't have an optimizer IMO, it's not fit for 
> purpose anymore, if you want optimizations use GDC or LDC. 
> Inlining doesn't even respect the semantics of the language IIRC

DMD optimization are still valuable, DMD still compile faster 
than LDC/GDC

For games it's even more important you don't want your debug 
build to run at 5 FPS


More information about the Digitalmars-d-learn mailing list