[PATCH] D24638: [thinlto] Basic thinlto fdo heuristic

Piotr Padlewski via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 15 15:31:58 PDT 2016


Prazek created this revision.
Prazek added reviewers: tejohnson, eraman, mehdi_amini.
Prazek added a subscriber: llvm-commits.
Herald added a subscriber: mehdi_amini.

This patch improves thinlto importer
by importing 3x larger functions that are called from hot block.

I compared performance with the trunk on spec, and there
were about 2% on povray and 3.33% on milc. These results seems
to be consistant and match the results Teresa got with her simple
heuristic. Some benchmarks got slower but I think they are just
noisy (mcf, xalancbmki, omnetpp)- running the benchmarks again with 
more iterations to confirm. Geomean of all benchmarks including the noisy ones
were about +0.02%.

I see much better improvement on google branch with Easwaran patch
for pgo callsite inlining (the inliner actually inline those big functions)
Over all I see +0.5% improvement, and I get +8.65% on povray.
So I guess we will see much bigger change when Easwaran patch will land 
(it depends on new pass manager), but it is still worth putting this to trunk
before it.

Implementation details changes:
- Removed CallsiteCount.
- ProfileCount got replaced by Hotness
- hot-import-multiplier is set to 3.0 for now,
didn't have time to tune it up, but I see that we get most of the interesting
functions with 3, so there is no much performance difference with higher, and 
binary size doesn't grow as much as with 10.0.

https://reviews.llvm.org/D24638

Files:
  include/llvm/Analysis/ModuleSummaryAnalysis.h
  include/llvm/IR/ModuleSummaryIndex.h
  lib/Analysis/ModuleSummaryAnalysis.cpp
  lib/Bitcode/Reader/BitcodeReader.cpp
  lib/Bitcode/Writer/BitcodeWriter.cpp
  lib/LTO/ThinLTOCodeGenerator.cpp
  lib/Transforms/IPO/FunctionImport.cpp
  test/Bitcode/Inputs/thinlto-function-summary-callgraph-profile-summary.ll
  test/Bitcode/summary_version.ll
  test/Bitcode/thinlto-alias.ll
  test/Bitcode/thinlto-function-summary-callgraph-pgo.ll
  test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll
  test/Bitcode/thinlto-function-summary-callgraph.ll
  test/Bitcode/thinlto-function-summary-refgraph.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24638.71571.patch
Type: text/x-patch
Size: 28638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160915/9ccd3c55/attachment.bin>


More information about the llvm-commits mailing list