aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Utils
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-07-17 01:31:49 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-07-17 01:31:49 +0000
commit066fcf8628b14ebe93253a153cb1ffa2e901ee9b (patch)
tree05b4befa3c34ad181658ced36bccb2bd63aea49a /lib/Transforms/Utils
parentb31b06d04b81c5383e2fba0cd44d4ba3f324a794 (diff)
downloadexternal_llvm-066fcf8628b14ebe93253a153cb1ffa2e901ee9b.zip
external_llvm-066fcf8628b14ebe93253a153cb1ffa2e901ee9b.tar.gz
external_llvm-066fcf8628b14ebe93253a153cb1ffa2e901ee9b.tar.bz2
Inliner tweak. Function calls should cost more than one instruction!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53712 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r--lib/Transforms/Utils/InlineCost.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/InlineCost.cpp b/lib/Transforms/Utils/InlineCost.cpp
index 10cb77b..5c97fd2 100644
--- a/lib/Transforms/Utils/InlineCost.cpp
+++ b/lib/Transforms/Utils/InlineCost.cpp
@@ -119,6 +119,11 @@ void InlineCostAnalyzer::FunctionInfo::analyzeFunction(Function *F) {
NeverInline = true;
return;
}
+
+ // Calls often compile into many machine instructions. Bump up their
+ // cost to reflect this.
+ if (!isa<IntrinsicInst>(II))
+ NumInsts += 5;
}
if (isa<ExtractElementInst>(II) || isa<VectorType>(II->getType()))