/// inlining has the given attribute set either at the call site or the
/// function declaration. Primarily used to inspect call site specific
/// attributes since these can be more precise than the ones on the callee
- /// itself.
+ /// itself.
bool paramHasAttr(Argument *A, Attribute::AttrKind Attr);
/// Return true if the given value is known non null within the callee if
- /// inlined through this particular callsite.
+ /// inlined through this particular callsite.
bool isKnownNonNullInCallee(Value *V);
// Custom analysis routines.
CallAnalyzer CA(TTI, ACT, *F, InlineConstants::IndirectCallThreshold, CS);
if (CA.analyzeCall(CS)) {
// We were able to inline the indirect call! Subtract the cost from the
- // bonus we want to apply, but don't go below zero.
- Cost -= std::max(0, InlineConstants::IndirectCallThreshold - CA.getCost());
+ // threshold to get the bonus we want to apply, but don't go below zero.
+ Cost -= std::max(0, CA.getThreshold() - CA.getCost());
}
return Base::visitCallSite(CS);
else if (NumVectorInstructions <= NumInstructions / 2)
Threshold -= (FiftyPercentVectorBonus - TenPercentVectorBonus);
- return Cost < Threshold;
+ return Cost <= std::max(0, Threshold);
}
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)