summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit97cd0298cc4886673a272659e6a8b887ee0db6bd (patch)
tree044f5503fec91add167a23bb463c8587393aecd3 /llvm/lib/Transforms/Utils
parentc062381c7b05c811637e47c5fbd38164fef1dcae (diff)
downloadbcm5719-llvm-97cd0298cc4886673a272659e6a8b887ee0db6bd.tar.gz
bcm5719-llvm-97cd0298cc4886673a272659e6a8b887ee0db6bd.zip
Inliner tweak. Function calls should cost more than one instruction!
llvm-svn: 53712
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/InlineCost.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineCost.cpp b/llvm/lib/Transforms/Utils/InlineCost.cpp
index 10cb77bbcba..5c97fd2f706 100644
--- a/llvm/lib/Transforms/Utils/InlineCost.cpp
+++ b/llvm/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()))
OpenPOWER on IntegriCloud