OSDN Git Service

[Inliner] Do not apply any bonus for cold callsites.
authorEaswaran Raman <eraman@google.com>
Fri, 28 Jul 2017 21:47:36 +0000 (21:47 +0000)
committerEaswaran Raman <eraman@google.com>
Fri, 28 Jul 2017 21:47:36 +0000 (21:47 +0000)
commit0e9b0bc63df6c36fecf1f5fcf70353d7a632ffd6
treedef98e90e006e8f09d78e5c2491aaa6487469f53
parent0521b1a7f6b545cbc6c7d44844b3e875a16cf5c3
[Inliner] Do not apply any bonus for cold callsites.

Summary:
Inlining threshold is increased by application of bonuses when the
callee has a single reachable basic block or is rich in vector
instructions. Similarly, inlining cost is reduced by applying a large
bonus when the last call to a static function is considered for
inlining. This patch disables the application of these bonuses when the
callsite or the callee is cold. The intention here is to prevent a large
cold callsite from being inlined to a non-cold caller that could prevent
the caller from being inlined. This is especially important when the
cold callsite is a last call to a static since the associated bonus is
very high.

Reviewers: chandlerc, davidxl

Subscribers: danielcdh, llvm-commits

Differential Revision: https://reviews.llvm.org/D35823

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309441 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InlineCost.cpp
test/Transforms/Inline/last-call-bonus.ll
test/Transforms/Inline/last-call-no-bonus.ll [new file with mode: 0644]
test/Transforms/Inline/vector-no-bonus.ll [new file with mode: 0644]