aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-10-09 21:42:02 +0000
committerDale Johannesen <dalej@apple.com>2009-10-09 21:42:02 +0000
commitbdb984bc2757114bc706026603ed40d7f508c4c1 (patch)
treefd2e8b0e174e61730ca54aa4ac0621fd8aa1132c /include
parentd7894f105a3c397a3d7f5c5136eee39f5865e64b (diff)
downloadexternal_llvm-bdb984bc2757114bc706026603ed40d7f508c4c1.zip
external_llvm-bdb984bc2757114bc706026603ed40d7f508c4c1.tar.gz
external_llvm-bdb984bc2757114bc706026603ed40d7f508c4c1.tar.bz2
Use names instead of numbers for some of the magic
constants used in inlining heuristics (especially those used in more than one file). No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83675 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Transforms/Utils/InlineCost.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Utils/InlineCost.h b/include/llvm/Transforms/Utils/InlineCost.h
index 2d0c397..bfcb546 100644
--- a/include/llvm/Transforms/Utils/InlineCost.h
+++ b/include/llvm/Transforms/Utils/InlineCost.h
@@ -27,6 +27,14 @@ namespace llvm {
template<class PtrType, unsigned SmallSize>
class SmallPtrSet;
+ namespace InlineConstants {
+ // Various magic constants used to adjust heuristics.
+ const int CallPenalty = 5;
+ const int LastCallToStaticBonus = -15000;
+ const int ColdccPenalty = 2000;
+ const int NoreturnPenalty = 10000;
+ }
+
/// InlineCost - Represent the cost of inlining a function. This
/// supports special values for functions which should "always" or
/// "never" be inlined. Otherwise, the cost represents a unitless