Inliner tweak. Function calls should cost more than one instruction!
[oota-llvm.git] / 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()))