aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-03-13 00:10:20 +0000
committerDevang Patel <dpatel@apple.com>2010-03-13 00:10:20 +0000
commitcbd056074cfcd79265ee1e04e83f347355e9ad61 (patch)
tree3e6ab746b8a85d9dd6a41413a997002be1025561 /include
parente4193b20fd30e59c389814835ed2f6b3bc3b225c (diff)
downloadexternal_llvm-cbd056074cfcd79265ee1e04e83f347355e9ad61.zip
external_llvm-cbd056074cfcd79265ee1e04e83f347355e9ad61.tar.gz
external_llvm-cbd056074cfcd79265ee1e04e83f347355e9ad61.tar.bz2
Do not overestimate code size reduction in presense of debug info.
Use CodeMetrics.analyzeBasicBlock() to estimate BB size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98401 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/InlineCost.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/llvm/Analysis/InlineCost.h b/include/llvm/Analysis/InlineCost.h
index f0e97d7..ea76ec1 100644
--- a/include/llvm/Analysis/InlineCost.h
+++ b/include/llvm/Analysis/InlineCost.h
@@ -18,6 +18,7 @@
#include <climits>
#include <map>
#include <vector>
+#include "llvm/ADT/DenseMap.h"
namespace llvm {
@@ -42,6 +43,9 @@ namespace llvm {
/// is used to estimate the code size cost of inlining it.
unsigned NumInsts, NumBlocks;
+ /// NumBBInsts - Keeps track of basic block code size estimates.
+ DenseMap<const BasicBlock *, unsigned> NumBBInsts;
+
/// NumCalls - Keep track of the number of calls to 'big' functions.
unsigned NumCalls;
@@ -148,7 +152,7 @@ namespace llvm {
/// CountCodeReductionForConstant - Figure out an approximation for how
/// many instructions will be constant folded if the specified value is
/// constant.
- unsigned CountCodeReductionForConstant(Value *V);
+ unsigned CountCodeReductionForConstant(Value *V, CodeMetrics &M);
/// CountCodeReductionForAlloca - Figure out an approximation of how much
/// smaller the function will be if it is inlined into a context where an