[RFC][flang][cmake][perf-training] Optimize flang with PGO and BOLT

To summarize the results, the average compile time improvements using check-flang are the following:

  • no profile:
    • LTO: 6%
  • one profiling round:
    • PGO: 7.5% (LTO+PGO 7.4%)
    • BOLT: 6.1% (no data point for LTO+BOLT)
  • two profiling rounds:
    • PGO+BOLT: 13.5% (LTO+PGO+BOLT 13.5%)

So to me it makes sense to have both PGO and BOLT enabled due to clear synergy. I’d keep ThinLTO enabled even though it’s not currently showing clear gain on this workload as it should have little relative build-time overhead, and future improvements might bring benefits.

3 Likes