Profile-guided optimization (PGO)

David Nadlinger via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Sun Dec 13 06:16:53 PST 2015


On 13 Dec 2015, at 14:59, Johan Engelen via digitalmars-d-ldc wrote:
> I just fixed two more ICEs, and now the dmd-testsuite succeeds with 
> -fprofile-instr-generate. Running the druntime/Phobos unittests now 
> with -fprofile-instr-generate.

Nice!

> I have absolutely no preference here. I think we should do what the 
> world is already familiar with. Iirc, -fprofile-instr-generate is a 
> Clang option, and that Clang is moving towards / will support GCC's 
> option naming (-fprofile-generate, -fprofile-use).

Yeah, me neither.

> DMD has a -profile option, but I have not read up on what that will 
> do.

It makes DMD's druntime emit some profiling info as text files 
(trace.def/trace.log) at program exit. This is for manual analysis only, 
no PGO-type functionality in sight.

> I guess we will not add any option for PGO to ldmd2?

Yeah, as DMD does not have any PGO functionality. Of course it will 
still pass the ldc2 options through.

> Another important TODO item: remove the profiling runtime from 
> druntime, and instead add a separate runtime-profiling lib 
> (suggestions for a name?  ldc-profile.lib?).

Maybe add a "rt" suffix to make clear that this is the actual program 
runtime part? Ultimately does not really matter, though.

  — David


More information about the digitalmars-d-ldc mailing list