aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/InlineCost.cpp
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2010-05-27 15:15:58 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2010-05-27 15:15:58 +0000
commitabdf259d487163e72081a8cf4991b1617206b41e (patch)
tree9fad9a5d5dd8c4ff54af48edad9c8cc26dd5fda1 /lib/Analysis/InlineCost.cpp
parent59161dfae3225dd9151afbc76ca9074598c0c605 (diff)
downloadsrc-abdf259d487163e72081a8cf4991b1617206b41e.tar.gz
src-abdf259d487163e72081a8cf4991b1617206b41e.zip
Notes
Diffstat (limited to 'lib/Analysis/InlineCost.cpp')
-rw-r--r--lib/Analysis/InlineCost.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Analysis/InlineCost.cpp b/lib/Analysis/InlineCost.cpp
index 627137159706..98dbb69fe6a5 100644
--- a/lib/Analysis/InlineCost.cpp
+++ b/lib/Analysis/InlineCost.cpp
@@ -175,7 +175,11 @@ void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB) {
if (!isa<IntrinsicInst>(II) && !callIsSmall(CS.getCalledFunction())) {
// Each argument to a call takes on average one instruction to set up.
NumInsts += CS.arg_size();
- ++NumCalls;
+
+ // We don't want inline asm to count as a call - that would prevent loop
+ // unrolling. The argument setup cost is still real, though.
+ if (!isa<InlineAsm>(CS.getCalledValue()))
+ ++NumCalls;
}
}
@@ -455,6 +459,11 @@ InlineCostAnalyzer::growCachedCostInfo(Function *Caller, Function *Callee) {
else
CallerMetrics.NumInsts = 0;
- // We are not updating the argumentweights. We have already determined that
+ // We are not updating the argument weights. We have already determined that
// Caller is a fairly large function, so we accept the loss of precision.
}
+
+/// clear - empty the cache of inline costs
+void InlineCostAnalyzer::clear() {
+ CachedFunctionInfo.clear();
+}