diff options
author | Dehao Chen <dehao@google.com> | 2017-03-21 19:55:36 +0000 |
---|---|---|
committer | Dehao Chen <dehao@google.com> | 2017-03-21 19:55:36 +0000 |
commit | 9907e9d860051d80b81fc2a0e9ddcb0ee98d5c72 (patch) | |
tree | 30dfc5f2d0ef56661604e5af0f9f86cffd4f941a /llvm/lib/Transforms/IPO/InlineSimple.cpp | |
parent | f4bbdc2953920acf9a22da876b5e4d025667cded (diff) | |
download | bcm5719-llvm-9907e9d860051d80b81fc2a0e9ddcb0ee98d5c72.tar.gz bcm5719-llvm-9907e9d860051d80b81fc2a0e9ddcb0ee98d5c72.zip |
Do not inline hot callsites for samplepgo in thinlto compile phase.
Summary: Because SamplePGO passes will be invoked twice in ThinLTO build: once at compile phase, the other at backend. We want to make sure the IR at the 2nd phase matches the hot part in profile, thus we do not want to inline hot callsites in the first phase.
Reviewers: tejohnson, eraman
Reviewed By: tejohnson
Subscribers: mehdi_amini, llvm-commits, Prazek
Differential Revision: https://reviews.llvm.org/D31201
llvm-svn: 298428
Diffstat (limited to 'llvm/lib/Transforms/IPO/InlineSimple.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/InlineSimple.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/InlineSimple.cpp b/llvm/lib/Transforms/IPO/InlineSimple.cpp index 514baa81090..50e7cc89a3b 100644 --- a/llvm/lib/Transforms/IPO/InlineSimple.cpp +++ b/llvm/lib/Transforms/IPO/InlineSimple.cpp @@ -93,8 +93,12 @@ Pass *llvm::createFunctionInliningPass(int Threshold) { } Pass *llvm::createFunctionInliningPass(unsigned OptLevel, - unsigned SizeOptLevel) { - return new SimpleInliner(llvm::getInlineParams(OptLevel, SizeOptLevel)); + unsigned SizeOptLevel, + bool DisableInlineHotCallSite) { + auto Param = llvm::getInlineParams(OptLevel, SizeOptLevel); + if (DisableInlineHotCallSite) + Param.HotCallSiteThreshold = 0; + return new SimpleInliner(Param); } Pass *llvm::createFunctionInliningPass(InlineParams &Params) { |