From 066fcf8628b14ebe93253a153cb1ffa2e901ee9b Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 17 Jul 2008 01:31:49 +0000 Subject: [PATCH] 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 --- lib/Transforms/Utils/InlineCost.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Transforms/Utils/InlineCost.cpp b/lib/Transforms/Utils/InlineCost.cpp index 10cb77bbcba..5c97fd2f706 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(II)) + NumInsts += 5; } if (isa(II) || isa(II->getType())) -- 2.34.1