[all-commits] [llvm/llvm-project] 23191a: [CSSPGO][llvm-profgen] Do not duplicate context pr...

Hongtao Yu via All-commits all-commits at lists.llvm.org
Thu May 12 09:29:41 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 23191a4ffee999f764215daf4efc9e18eca291bb
      https://github.com/llvm/llvm-project/commit/23191a4ffee999f764215daf4efc9e18eca291bb
  Author: Hongtao Yu <hoy at fb.com>
  Date:   2022-05-12 (Thu, 12 May 2022)

  Changed paths:
    M llvm/lib/ProfileData/SampleProf.cpp
    M llvm/test/tools/llvm-profgen/cs-preinline.test

  Log Message:
  -----------
  [CSSPGO][llvm-profgen] Do not duplicate context profiles into base profile when converting CS flat profile to nested.

Recent experiments with our two large internal services showed that duplicating context profiles into base profile caused code size inflation and didn't deliver good performance compared to no such duplication. It was a trick we made to catch up with the CS flat profile and I'm now turning it off by default.

The code size inflation mainly comes from the enriched based profiles. A base profile for a function represents the uninlined (or outlined) portion of the whole function running time. Such portion could be very small if a function is inlined into most of its hot callsites. Duplicating context profiles of the function into its base profiles could cause the outlined body to be hot enough and in turn get many of its callees inlined, thus increases the code size. The size inflation could further cause perf regression.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D124796




More information about the All-commits mailing list