This series contains independent fixes found while investigating AutoFDO performance for 766.femflow_r.
The patches improve partial training, bootstrap handling, profile count propagation, missing profiles, COMDAT accounting, cloning, and hierarchical discriminators. Each patch is logically independent and can be reviewed and committed separately. Together, these changes improve 766.femflow_r performance with AutoFDO. SPEC CPU2026 AutoFDO results compare the patch series with the compiler without the series. Positive percentages are improvements. With partial profile training: 706.stockfish_r +1.21% 707.ntest_r -0.67% 708.sqlite_r +12.89% 714.cpython_r -7.54% 721.gcc_r -0.79% 723.llvm_r -2.33% 727.cppcheck_r -0.09% 729.abc_r +0.70% 734.vpr_r -0.44% 735.gem5_r -0.66% 750.sealcrypto_r -1.13% 753.ns3_r +0.60% 760.rocksdb_r -0.20% 777.zstd_r +1.62% 709.cactus_r +2.41% 722.palm_r +0.91% 731.astcenc_r +0.07% 736.ocio_r +0.02% 737.gmsh_r +0.15% 748.flightdm_r -1.50% 749.fotonik3d_r -0.75% 765.roms_r +0.54% 766.femflow_r +29.49% 767.nest_r +2.38% 772.marian_r -0.06% 782.lbm_r -0.08% Without partial profile training: 706.stockfish_r -0.17% 707.ntest_r -2.14% 708.sqlite_r +0.15% 710.omnetpp_r +0.65% 714.cpython_r +3.47% 721.gcc_r -0.26% 723.llvm_r +2.10% 727.cppcheck_r +3.13% 729.abc_r +4.54% 734.vpr_r -0.37% 735.gem5_r +6.11% 750.sealcrypto_r -2.20% 753.ns3_r +8.76% 760.rocksdb_r +1.93% 777.zstd_r +4.42% 709.cactus_r +1.61% 722.palm_r -0.00% 731.astcenc_r +1.45% 736.ocio_r +0.17% 737.gmsh_r -0.10% 748.flightdm_r -1.50% 749.fotonik3d_r +25.46% 765.roms_r +1.06% 766.femflow_r +53.59% 767.nest_r +1.44% 772.marian_r +30.02% 782.lbm_r +2.45% Bootstrapped and regression tested on aarch64-linux-gnu. Kugan Vivekanandarajah (11): [AutoFDO] Do not ICE after partial training localizes a count [AutoFDO] Keep an inline clone body compatible with its IPA count [AutoFDO] Do not infer a zero count for an edge that must have run [AutoFDO] Estimate guessed region boundaries from the remaining count [AutoFDO] Do not sum the profiles of merged COMDAT copies [AutoFDO] Fix handle_missing_profiles and call it for AutoFDO [AutoFDO] Mark the profile of functions without samples as read [AutoFDO] Keep a call count for offlined inline instances [AutoFDO] Keep hierarchical discriminators consumable by libdw [AutoFDO] Keep the AutoFDO count of the original after guessed cloning [AutoFDO] Follow the PGO bootstrap stage flow Makefile.def | 8 +- Makefile.in | 3407 ++++++++++++++++- Makefile.tpl | 25 +- gcc/Makefile.in | 2 +- gcc/auto-profile.cc | 192 +- gcc/c/Make-lang.in | 10 +- gcc/cgraph.cc | 4 + gcc/cgraphclones.cc | 19 +- gcc/config/aarch64/gcc-auto-profile | 6 +- gcc/cp/Make-lang.in | 15 +- gcc/doc/install.texi | 13 +- gcc/hierarchical_discriminator.cc | 50 +- gcc/ipa-utils.cc | 22 +- gcc/ipa-utils.h | 3 +- gcc/lto/Make-lang.in | 15 +- gcc/lto/lto-symtab.cc | 2 +- gcc/predict.cc | 52 +- .../g++.dg/tree-prof/afdo-comdat-merge-aux.cc | 13 + .../g++.dg/tree-prof/afdo-comdat-merge.C | 35 + gcc/tree-inline.cc | 9 +- 20 files changed, 3727 insertions(+), 175 deletions(-) create mode 100644 gcc/testsuite/g++.dg/tree-prof/afdo-comdat-merge-aux.cc create mode 100644 gcc/testsuite/g++.dg/tree-prof/afdo-comdat-merge.C -- 2.34.1
