available_externall linkage is not local, this was confusing the codegenerator,
[oota-llvm.git] / lib / Transforms / Utils / InlineCost.cpp
index c9eb0ea1c907cb7be304df49e16597ab2e31d8f7..87aff01a58576804615c0f4f7faa0c3083934bf7 100644 (file)
@@ -189,7 +189,8 @@ InlineCost InlineCostAnalyzer::getInlineCost(CallSite CS,
   // If there is only one call of the function, and it has internal linkage,
   // make it almost guaranteed to be inlined.
   //
-  if (Callee->hasLocalLinkage() && Callee->hasOneUse())
+  if ((Callee->hasLocalLinkage() || Callee->hasAvailableExternallyLinkage()) && 
+      Callee->hasOneUse())
     InlineCost -= 15000;
   
   // If this function uses the coldcc calling convention, prefer not to inline