[PATCH] D34312: [NewPM/Inliner] Reduce threshold for cold callsites in the non-PGO case

Easwaran Raman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 16 18:09:21 PDT 2017


eraman created this revision.

This uses inline-cold-callsite-threshold to callsites that are cold locally (within the function) in the absence of profile information. Callsite's coldness is determined based on it's BFI relative to the caller's entry BFI. The default value chosen is callsite's frequency being <= 1/100th of the caller's entry frequency. In general this is a small size win. For example, the llvm test-suite sees a mean text size reduction of 0.03%, but there are some nice wins in large benchmarks there (sqlite sees 23% reduction and 7zip sees 4% reduction). There are some regressions, but those are all on benchmarks with smaller code size (<4K). This also improves an internal  compression benchmark by around 8% by preventing a cold callee from being inlined and thereby allowing the caller to be inlined into its caller.  The 1% threshold allows a callsite guarded by _builtin_expect(cond, 0) inside a singly-nested loop to be considered cold.

I am working on doing similar identification of hot callsites without profile information,  but tuning that is proving to be harder and so I want to start with this first.


https://reviews.llvm.org/D34312

Files:
  lib/Analysis/InlineCost.cpp
  test/Transforms/Inline/inline-cold-callsite-pgo.ll
  test/Transforms/Inline/inline-cold-callsite.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34312.102917.patch
Type: text/x-patch
Size: 6121 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170617/9a5b9fb9/attachment.bin>


More information about the llvm-commits mailing list