summaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
authorKenneth Uildriks <kennethuil@gmail.com>2010-10-08 13:57:31 +0000
committerKenneth Uildriks <kennethuil@gmail.com>2010-10-08 13:57:31 +0000
commitca52c8ba12285c0e86f1b6d3b354342c59e2a416 (patch)
treef52b5fe896d2b417ef41ff8d6917999c112afe18 /include/llvm
parentd7b8d91d4a2a284bbe9ef6f32b3c25daa7ea0513 (diff)
downloadllvm-ca52c8ba12285c0e86f1b6d3b354342c59e2a416.tar.gz
llvm-ca52c8ba12285c0e86f1b6d3b354342c59e2a416.tar.bz2
llvm-ca52c8ba12285c0e86f1b6d3b354342c59e2a416.tar.xz
Start separating out code metrics into code size metrics and code performance metrics. Partial Specialization will apply the former to function specializations, and the latter to all callsites that can use a specialization, in order to decide whether to create a specialization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116057 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Analysis/CodeMetrics.h7
-rw-r--r--include/llvm/Analysis/InlineCost.h6
2 files changed, 10 insertions, 3 deletions
diff --git a/include/llvm/Analysis/CodeMetrics.h b/include/llvm/Analysis/CodeMetrics.h
index 1a67409ad1..e89ad9026d 100644
--- a/include/llvm/Analysis/CodeMetrics.h
+++ b/include/llvm/Analysis/CodeMetrics.h
@@ -77,7 +77,12 @@ namespace llvm {
/// many instructions will be constant folded if the specified value is
/// constant.
unsigned CountCodeReductionForConstant(Value *V);
-
+
+ /// CountBonusForConstant - Figure out an approximation for how much
+ /// per-call performance boost we can expect if the specified value is
+ /// constant.
+ unsigned CountBonusForConstant(Value *V);
+
/// CountCodeReductionForAlloca - Figure out an approximation of how much
/// smaller the function will be if it is inlined into a context where an
/// argument becomes an alloca.
diff --git a/include/llvm/Analysis/InlineCost.h b/include/llvm/Analysis/InlineCost.h
index b3b93950d4..9963ba44d0 100644
--- a/include/llvm/Analysis/InlineCost.h
+++ b/include/llvm/Analysis/InlineCost.h
@@ -96,9 +96,11 @@ namespace llvm {
public:
unsigned ConstantWeight;
unsigned AllocaWeight;
+ unsigned ConstantBonus;
- ArgInfo(unsigned CWeight, unsigned AWeight)
- : ConstantWeight(CWeight), AllocaWeight(AWeight) {}
+ ArgInfo(unsigned CWeight, unsigned AWeight, unsigned CBonus)
+ : ConstantWeight(CWeight), AllocaWeight(AWeight), ConstantBonus(CBonus)
+ {}
};
struct FunctionInfo {