[all-commits] [llvm/llvm-project] 6c27c6: [PGO] Improve the working set size heuristics unde...

hjyamauchi via All-commits all-commits at lists.llvm.org
Mon Jun 1 10:29:47 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6c27c61d32fd2951a290c6d4363bd495f6feae96
      https://github.com/llvm/llvm-project/commit/6c27c61d32fd2951a290c6d4363bd495f6feae96
  Author: Hiroshi Yamauchi <yamauchi at google.com>
  Date:   2020-06-01 (Mon, 01 Jun 2020)

  Changed paths:
    M llvm/include/llvm/IR/Module.h
    M llvm/include/llvm/IR/ProfileSummary.h
    M llvm/lib/Analysis/ProfileSummaryInfo.cpp
    M llvm/lib/IR/Module.cpp
    M llvm/lib/LTO/LTOBackend.cpp
    M llvm/lib/Transforms/IPO/FunctionImport.cpp
    M llvm/unittests/Analysis/ProfileSummaryInfoTest.cpp
    M llvm/unittests/IR/ModuleTest.cpp

  Log Message:
  -----------
  [PGO] Improve the working set size heuristics under the partial sample PGO.

Summary:
The working set size heuristics (ProfileSummaryInfo::hasHugeWorkingSetSize)
under the partial sample PGO may not be accurate because the profile is partial
and the number of hot profile counters in the ProfileSummary may not reflect the
actual working set size of the program being compiled.

To improve this, the (approximated) ratio of the the number of profile counters
of the program being compiled to the number of profile counters in the partial
sample profile is computed (which is called the partial profile ratio) and the
working set size of the profile is scaled by this ratio to reflect the working
set size of the program being compiled and used for the working set size
heuristics.

The partial profile ratio is approximated based on the number of the basic
blocks in the program and the NumCounts field in the ProfileSummary and computed
through the thin LTO indexing. This means that there is the limitation that the
scaled working set size is available to the thin LTO post link passes only.

Reviewers: davidxl

Subscribers: mgorny, eraman, hiraditya, steven_wu, dexonsmith, arphaman, dang, llvm-commits

Tags: #llvm

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




More information about the All-commits mailing list