Check the alwaysinline attribute on the call as well as on the caller.
[oota-llvm.git] / lib / Analysis / IPA / InlineCost.cpp
index 358f61fd5231480323fc82662e519b98efcad554..66f3f8e02528df1159483b885c159b2abd45e557 100644 (file)
@@ -1259,7 +1259,7 @@ InlineCost InlineCostAnalysis::getInlineCost(CallSite CS, Function *Callee,
 
   // Calls to functions with always-inline attributes should be inlined
   // whenever possible.
-  if (Callee->hasFnAttribute(Attribute::AlwaysInline)) {
+  if (CS.hasFnAttr(Attribute::AlwaysInline)) {
     if (isInlineViable(*Callee))
       return llvm::InlineCost::getAlways();
     return llvm::InlineCost::getNever();