[all-commits] [llvm/llvm-project] f4711e: [CSSPGO] Sort function offset table to speed up pr...

Hongtao Yu via All-commits all-commits at lists.llvm.org
Wed Sep 1 12:18:13 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f4711e0d009b7e62fc1fa3c070878ad366710487
      https://github.com/llvm/llvm-project/commit/f4711e0d009b7e62fc1fa3c070878ad366710487
  Author: Hongtao Yu <hoy at fb.com>
  Date:   2021-09-01 (Wed, 01 Sep 2021)

  Changed paths:
    M llvm/include/llvm/ProfileData/SampleProf.h
    M llvm/include/llvm/ProfileData/SampleProfReader.h
    M llvm/lib/ProfileData/SampleProfReader.cpp
    M llvm/lib/ProfileData/SampleProfWriter.cpp
    M llvm/test/Transforms/SampleProfile/csspgo-import-list.ll

  Log Message:
  -----------
  [CSSPGO] Sort function offset table to speed up profile loading.

With the context split work, the context-based (an array of strings) sorting performed at profile load time is way more expansive than single-string-based sorting. This is likely due to auxiliary operations done on each array element, such as indirect references, std::min operations, also likely cache misses. In this change I'm presorting profiles during profile generation time to avoid sorting at compile time.

Compared to the previous context-split work, this effectively cuts down compile time by 20% for one of our large services and brings us closer to non-CS build, with still a small gap in build time.

Reviewed By: wenlei, wmi

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




More information about the All-commits mailing list