From fdf73547456c684cc1a8c0a65c14330372f7d590 Mon Sep 17 00:00:00 2001 From: Piotr Padlewski Date: Mon, 26 Sep 2016 20:37:32 +0000 Subject: [thinlto] Basic thinlto fdo heuristic Summary: 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. Reviewers: eraman, mehdi_amini, tejohnson Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D24638 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282437 91177308-0d34-0410-b5e6-96231b3b80d8 --- ...hinlto-function-summary-callgraph-combined.1.bc | Bin 0 -> 360 bytes ...to-function-summary-callgraph-pgo-combined.1.bc | Bin 0 -> 368 bytes .../thinlto-function-summary-callgraph-pgo.1.bc | Bin 0 -> 1060 bytes ...o-function-summary-callgraph-profile-summary.ll | 27 +++++++++++++++++++++ .../Inputs/thinlto-function-summary-callgraph.1.bc | Bin 0 -> 968 bytes 5 files changed, 27 insertions(+) create mode 100644 test/Bitcode/Inputs/thinlto-function-summary-callgraph-combined.1.bc create mode 100644 test/Bitcode/Inputs/thinlto-function-summary-callgraph-pgo-combined.1.bc create mode 100644 test/Bitcode/Inputs/thinlto-function-summary-callgraph-pgo.1.bc create mode 100644 test/Bitcode/Inputs/thinlto-function-summary-callgraph-profile-summary.ll create mode 100644 test/Bitcode/Inputs/thinlto-function-summary-callgraph.1.bc (limited to 'test/Bitcode/Inputs') diff --git a/test/Bitcode/Inputs/thinlto-function-summary-callgraph-combined.1.bc b/test/Bitcode/Inputs/thinlto-function-summary-callgraph-combined.1.bc new file mode 100644 index 00000000000..e6a13402005 Binary files /dev/null and b/test/Bitcode/Inputs/thinlto-function-summary-callgraph-combined.1.bc differ diff --git a/test/Bitcode/Inputs/thinlto-function-summary-callgraph-pgo-combined.1.bc b/test/Bitcode/Inputs/thinlto-function-summary-callgraph-pgo-combined.1.bc new file mode 100644 index 00000000000..11b9037e568 Binary files /dev/null and b/test/Bitcode/Inputs/thinlto-function-summary-callgraph-pgo-combined.1.bc differ diff --git a/test/Bitcode/Inputs/thinlto-function-summary-callgraph-pgo.1.bc b/test/Bitcode/Inputs/thinlto-function-summary-callgraph-pgo.1.bc new file mode 100644 index 00000000000..cb3380efcb8 Binary files /dev/null and b/test/Bitcode/Inputs/thinlto-function-summary-callgraph-pgo.1.bc differ diff --git a/test/Bitcode/Inputs/thinlto-function-summary-callgraph-profile-summary.ll b/test/Bitcode/Inputs/thinlto-function-summary-callgraph-profile-summary.ll new file mode 100644 index 00000000000..f7d2ca839b9 --- /dev/null +++ b/test/Bitcode/Inputs/thinlto-function-summary-callgraph-profile-summary.ll @@ -0,0 +1,27 @@ +; ModuleID = 'thinlto-function-summary-callgraph-profile-summary2.ll' +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + + +define void @hot1() #1 { + ret void +} +define void @hot2() #1 { + ret void +} +define void @hot3() #1 { + ret void +} +define void @cold() #1 { + ret void +} +define void @none1() #1 { + ret void +} +define void @none2() #1 { + ret void +} +define void @none3() #1 { + ret void +} + diff --git a/test/Bitcode/Inputs/thinlto-function-summary-callgraph.1.bc b/test/Bitcode/Inputs/thinlto-function-summary-callgraph.1.bc new file mode 100644 index 00000000000..d42da69fcff Binary files /dev/null and b/test/Bitcode/Inputs/thinlto-function-summary-callgraph.1.bc differ -- cgit v1.2.3