[all-commits] [llvm/llvm-project] 5fb65c: [SampleFDO] Stop repeated indirect call promotion ...

wmi-11 via All-commits all-commits at lists.llvm.org
Thu Feb 18 17:05:40 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5fb65c02ca5e91e7e1a00e0efdb8edc899f3e4b9
      https://github.com/llvm/llvm-project/commit/5fb65c02ca5e91e7e1a00e0efdb8edc899f3e4b9
  Author: Wei Mi <wmi at google.com>
  Date:   2021-02-18 (Thu, 18 Feb 2021)

  Changed paths:
    M llvm/include/llvm/ProfileData/InstrProf.h
    M llvm/lib/Analysis/IndirectCallPromotionAnalysis.cpp
    M llvm/lib/ProfileData/InstrProf.cpp
    M llvm/lib/Transforms/IPO/SampleProfile.cpp
    A llvm/test/Transforms/SampleProfile/Inputs/norepeated-icp.prof
    M llvm/test/Transforms/SampleProfile/indirect-call.ll
    A llvm/test/Transforms/SampleProfile/norepeated-icp.ll

  Log Message:
  -----------
  [SampleFDO] Stop repeated indirect call promotion for the same target.

Found a problem in indirect call promotion in sample loader pass. Currently
if an indirect call is promoted for a target, and if the parent function is
inlined into some other function, the indirect call can be promoted for the
same target again. That is redundent which can harm performance and can cause
excessive compile time in some extreme case.

The patch fixes the issue. If a target is promoted for an indirect call, the
patch will write ICP metadata with the target call count being set to 0.
In the later ICP in sample profile loader, if it sees a target has 0 count
for an indirect call, it knows the target has been promoted and won't do
indirect call promotion for the indirect call.

The fix brings 0.1~0.2% performance on our search benchmark.

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




More information about the All-commits mailing list