Inliner tweak. Function calls should cost more than one instruction!
authorEvan Cheng <evan.cheng@apple.com>
Thu, 17 Jul 2008 01:31:49 +0000 (01:31 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 17 Jul 2008 01:31:49 +0000 (01:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53712 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/InlineCost.cpp

index 10cb77bbcba61835a17736f3c1368650eaf770ca..5c97fd2f70665a5469597d10eb9463ef219fa5c1 100644 (file)
@@ -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()))