Use updated threshold for indirect call bonus
authorEaswaran Raman <eraman@google.com>
Mon, 7 Dec 2015 21:21:20 +0000 (21:21 +0000)
committerEaswaran Raman <eraman@google.com>
Mon, 7 Dec 2015 21:21:20 +0000 (21:21 +0000)
commitaa464aada41ae2b8ef9f3ef4147c6ef09d2879e2
tree36dfff8b2e877dcdbbbfa036c052546221e82aff
parent4e2c148ec86b66853f64326a7ee8e85afd479ae1
Use updated threshold for indirect call bonus

When considering foo->bar inlining, if there is an indirect call in foo which gets resolved to a direct call (say baz), then we try to inline baz into bar with a threshold T and subtract max(T - Cost(bar->baz), 0) from Cost(foo->bar). This patch uses max(Threshold(bar->baz) - Cost(bar->baz)) instead, where Thresheld(bar->baz) could be different from T due to bonuses or subtractions. Threshold(bar->baz) - Cost(bar->baz) better represents the desirability of inlining baz into bar.

Differential Revision: http://reviews.llvm.org/D14309

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254945 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InlineCost.cpp