[PATCH] D41604: Add a pass to generate synthetic function entry counts.

Easwaran Raman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 27 17:03:06 PST 2017


eraman created this revision.
eraman added reviewers: davidxl, silvas.
Herald added subscribers: mehdi_amini, mgorny.

This pass synthesizes function entry counts by traversing the callgraph
and using the relative block frequencies of the callsites. The intended
use of these counts is in inlining to determine hot/cold callsites in
the absence of profile information.

The pass is split into two files with the code that propagates the
counts in a callgraph in a Utils file. I plan to add support for
propagation in the thinlto link phase and the propagation code will be
shared and hence this split. I did not add support to the old PM since
hot callsite determination in inlining is not possible in old PM
(although we could use hot callee heuristic with synthetic counts in the
old PM it is not worth the effort tuning it)


https://reviews.llvm.org/D41604

Files:
  include/llvm/Analysis/SyntheticCountsUtils.h
  include/llvm/IR/Function.h
  include/llvm/IR/MDBuilder.h
  include/llvm/Transforms/IPO/SyntheticCountsPropagation.h
  lib/Analysis/CMakeLists.txt
  lib/Analysis/SyntheticCountsUtils.cpp
  lib/IR/Function.cpp
  lib/IR/MDBuilder.cpp
  lib/IR/Verifier.cpp
  lib/Passes/PassBuilder.cpp
  lib/Passes/PassRegistry.def
  lib/Transforms/IPO/CMakeLists.txt
  lib/Transforms/IPO/SampleProfile.cpp
  lib/Transforms/IPO/SyntheticCountsPropagation.cpp
  test/Transforms/SyntheticCountsPropagation/initial.ll
  test/Transforms/SyntheticCountsPropagation/prop.ll
  test/Transforms/SyntheticCountsPropagation/scc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41604.128250.patch
Type: text/x-patch
Size: 24052 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171228/04288f25/attachment-0001.bin>


More information about the llvm-commits mailing list