[all-commits] [llvm/llvm-project] 7b61ae: [AutoFDO] Inline replay for cold/small callees fro...

WenleiHe via All-commits all-commits at lists.llvm.org
Fri Dec 6 11:45:03 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7b61ae68ecd7a127e69c9e0d2563bddb7eccad7a
      https://github.com/llvm/llvm-project/commit/7b61ae68ecd7a127e69c9e0d2563bddb7eccad7a
  Author: Wenlei He <aktoon at gmail.com>
  Date:   2019-12-06 (Fri, 06 Dec 2019)

  Changed paths:
    M llvm/lib/Transforms/IPO/SampleProfile.cpp
    A llvm/test/Transforms/SampleProfile/Inputs/inline-cold.prof
    A llvm/test/Transforms/SampleProfile/inline-cold.ll

  Log Message:
  -----------
  [AutoFDO] Inline replay for cold/small callees from sample profile loader

Summary:
Sample profile loader of AutoFDO tries to replay previous inlining using context sensitive profile. The replay only repeats inlining if the call site block is hot. As a result it punts inlining of small functions, some of which can be beneficial for size, and will still be inlined by CSGCC inliner later. The oscillation between sample profile loader's inlining and regular CGSSC inlining cause unnecessary loss of context-sensitive profile. It doesn't have much impact for inline decision itself, but it negatively affects post-inline profile quality as CGSCC inliner have to scale counts which is not as accurate as the original context sensitive profile, and bad post-inline profile can misguide code layout.

This change added regular Inline Cost calculation for sample profile loader, so we can inline small functions upfront under switch -sample-profile-inline-size. In addition -sample-profile-cold-inline-threshold is added so we can tune the separate size threshold - currently the default is chosen to be the same as regular inliner's cold call-site threshold.

Reviewers: wmi, davidxl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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




More information about the All-commits mailing list