aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/InlineCost.h
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
commit27cebf5c5e152ca142eeae056c7765aa0264e3b5 (patch)
tree3e6ab746b8a85d9dd6a41413a997002be1025561 /include/llvm/Analysis/InlineCost.h
parentfe460493143961f8225ccb85f75d974986af059f (diff)
downloadexternal_llvm-27cebf5c5e152ca142eeae056c7765aa0264e3b5.zip
external_llvm-27cebf5c5e152ca142eeae056c7765aa0264e3b5.tar.gz
external_llvm-27cebf5c5e152ca142eeae056c7765aa0264e3b5.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/llvm/Analysis/InlineCost.h')
-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