Enable PGO for CLang

Merged Bitbucket Importer requested to merge bitbucket/merged-pr-554 into branch/default

Created originally on Bitbucket by Dodan (Dodan Mihai)

Was already merged in Bitbucket before import, marked as merged by the import user

I have enabled PGO for CLang.

PGO works a bit differently for CLang than for gcc, in the sense that the generated profiles need to be aggregated with llvm-profdata, which should be where the clang binary is. Therefore, I added:

  • the location of llvm-profdata for both Unix and Darwin
  • after the training phase, I have added the merger phase, used only for CLang, where as for GCC, it simply returns true.
  • removed the -fno-flto from the PGO compilation, as the default -flto has been removed and enabling it for PGO explicitly shows an 8% improvement overall. (against 5.8.0 with LTO).

Merge request reports