Check the alwaysinline attribute on the call as well as on the caller.
[oota-llvm.git] / lib / Transforms / IPO / InlineAlways.cpp
index c5d9546ccef4306166d246b8255d9232c88c80e3..624cb90c0d5cf53479c86f07e47d0f73fe55d8b3 100644 (file)
@@ -95,8 +95,7 @@ InlineCost AlwaysInliner::getInlineCost(CallSite CS) {
   // that are viable for inlining. FIXME: We shouldn't even get here for
   // declarations.
   if (Callee && !Callee->isDeclaration() &&
-      Callee->getAttributes().hasAttribute(AttributeSet::FunctionIndex,
-                                           Attribute::AlwaysInline) &&
+      CS.hasFnAttr(Attribute::AlwaysInline) &&
       ICA->isInlineViable(*Callee))
     return InlineCost::getAlways();