DMD backend quality (Was: Re: DIP 1031--Deprecate Brace-Style Struct Initializers--Community Review Round 1 Discussion)

Walter Bright newshound2 at digitalmars.com
Thu Feb 20 00:52:02 UTC 2020


On 2/18/2020 10:10 PM, Max Samukha wrote:
> On Wednesday, 19 February 2020 at 05:42:19 UTC, Walter Bright wrote:
> 
>> so it is inlining both forms. If you do have trivial functions that aren't 
>> being inlined, please let me know. Thanks!
> 
> Anything with a 'switch':
> 
> void foo() {
>      switch(true) {
>          default:
>      }
> }

That's true, it's also true for loops. Though trivial functions with switches 
seem to me to be rare.

Keep in mind that the inliner is part of the dmd front end, not the back end. 
The inliner would be more effective if it was part of the back end, but that 
comes with a major memory/time penalty (intermediate code would have to be 
generated for all functions, even ones not being compiled, and kept around in 
memory).


More information about the Digitalmars-d mailing list