Open zamazan4ik opened 9 months ago
We do have IR-based PGO since a very long time; like clang
, we use -fprofile-{use,generate}
for that. It's also the PGO method we use for the compiler itself.
Great! That means the only needed change here is updating this PGO guide: https://wiki.dlang.org/LDC_LLVM_profiling_instrumentation :)
According to the LDC documentation, LDC now implements FrontEnd PGO (FE PGO) (since
-fprofile-instr-generate
option in Clang enables FE PGO too).According to the issue in the LLVM tracker, FE PGO is not a recommended way to implement PGO nowadays. IR PGO (
-fprofile-generate
option in Clang) should be used instead.I think we need to consider giving the possibility to users use IR PGO with LDC as well and write this recommendation in LDC's PGO documentation.