aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-03-08 02:04:19 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-03-08 02:04:19 +0000
commit6f130bf368ab082ab87bafaee9bf4e1a78acc669 (patch)
tree8351472df6ab0cc776df4a2e0326c8494512bbf5 /include
parent5fdf50065d1b481aed3222477f61f1075459210d (diff)
downloadexternal_llvm-6f130bf368ab082ab87bafaee9bf4e1a78acc669.zip
external_llvm-6f130bf368ab082ab87bafaee9bf4e1a78acc669.tar.gz
external_llvm-6f130bf368ab082ab87bafaee9bf4e1a78acc669.tar.bz2
Rotate two of the functions used to count bonuses for the inline cost
analysis to be methods on the cost analysis's function info object instead of the code metrics object. These really are just users of the code metrics, they're building the information for the function's analysis. This is the first step of growing the amount of information we collect about a function in order to cope with pair-wise simplifications due to allocas. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152283 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/CodeMetrics.h11
-rw-r--r--include/llvm/Analysis/InlineCost.h12
2 files changed, 12 insertions, 11 deletions
diff --git a/include/llvm/Analysis/CodeMetrics.h b/include/llvm/Analysis/CodeMetrics.h
index 6d34781..cf92642 100644
--- a/include/llvm/Analysis/CodeMetrics.h
+++ b/include/llvm/Analysis/CodeMetrics.h
@@ -81,21 +81,10 @@ namespace llvm {
/// to the current structure.
void analyzeFunction(Function *F, const TargetData *TD = 0);
- /// CountCodeReductionForConstant - Figure out an approximation for how
- /// 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.
- ///
- unsigned CountCodeReductionForAlloca(Value *V);
};
}
diff --git a/include/llvm/Analysis/InlineCost.h b/include/llvm/Analysis/InlineCost.h
index fdcd5a8..e3d526e 100644
--- a/include/llvm/Analysis/InlineCost.h
+++ b/include/llvm/Analysis/InlineCost.h
@@ -110,6 +110,18 @@ namespace llvm {
/// entry here.
std::vector<ArgInfo> ArgumentWeights;
+ /// countCodeReductionForConstant - Figure out an approximation for how
+ /// many instructions will be constant folded if the specified value is
+ /// constant.
+ unsigned countCodeReductionForConstant(const CodeMetrics &Metrics,
+ 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.
+ unsigned countCodeReductionForAlloca(const CodeMetrics &Metrics,
+ Value *V);
+
/// analyzeFunction - Add information about the specified function
/// to the current structure.
void analyzeFunction(Function *F, const TargetData *TD);