Profile-guided optimization (PGO)

Johan Engelen via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Tue Dec 8 11:13:41 PST 2015


Hi all,
   I have been working on getting rudimentary PGO going in LDC. 
It's pretty much ready! [1]
(does not work on Windows yet... I have to fix LLVM's compile-rt 
code)

I've implemented something very similar to Clang: LDC uses 
profile information (generated by an instrumented executable 
built by LDC) to tag each branch in the code with branch weights. 
The actual optimizations are done by LLVM; at the moment LDC only 
adds metadata to the IR.

At this point, I want your input: commandline option naming, easy 
to use? (llvm-profdata is needed...), do you get substantial 
performance boosts, runtime library inclusion or separate lib for 
profile data file writing, bugs, uninstrumented 
branches/switches, etc.
All comments are welcome (please be kind ;-).

Before I announce it in the "Announce" forum, I want to hear your 
thoughts first.

Thanks!
   Johan


[1]
http://wiki.dlang.org/LDC_LLVM_profiling_instrumentation#Profile-Guided_Optimization_.28PGO.29_status_in_LDC


More information about the digitalmars-d-ldc mailing list