summaryrefslogtreecommitdiff
path: root/lib/Analysis/InlineCost.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-01-22 21:56:53 +0000
committerEric Christopher <echristo@apple.com>2011-01-22 21:56:53 +0000
commit7ea118de46ec81a139e5e56cbcefd5936593a8db (patch)
tree877c7be9b3d89d4d3578c7b154138bd3c616fcaa /lib/Analysis/InlineCost.cpp
parent7020f12ee8cf8fbf7d5343239c52655352867ccd (diff)
downloadllvm-7ea118de46ec81a139e5e56cbcefd5936593a8db.tar.gz
llvm-7ea118de46ec81a139e5e56cbcefd5936593a8db.tar.bz2
llvm-7ea118de46ec81a139e5e56cbcefd5936593a8db.tar.xz
Add a FIXME explaining the move to a single indirect call bonus per function
that we can change from indirect to direct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124045 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/InlineCost.cpp')
-rw-r--r--lib/Analysis/InlineCost.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Analysis/InlineCost.cpp b/lib/Analysis/InlineCost.cpp
index 6e251aa214..86f98c6b0f 100644
--- a/lib/Analysis/InlineCost.cpp
+++ b/lib/Analysis/InlineCost.cpp
@@ -189,6 +189,11 @@ unsigned CodeMetrics::CountBonusForConstant(Value *V) {
}
}
+ // FIXME: The only reason we're applying the bonus once is while it's great
+ // to devirtualize calls the magnitude of the bonus x number of call sites
+ // can lead to a huge code explosion when we prefer to inline 1000 instruction
+ // functions that have 10 call sites. This should be made a function of the
+ // estimated inline penalty/benefit + the indirect call bonus.
if (indirectCallBonus) Bonus += InlineConstants::IndirectCallBonus;
return Bonus;