Lines Matching refs:CB

72   MandatoryInlineAdvice(InlineAdvisor *Advisor, CallBase &CB,
75 : InlineAdvice(Advisor, CB, ORE, IsInliningMandatory) {}
134 CallBase &CB, FunctionAnalysisManager &FAM, const InlineParams &Params) {
135 Function &Caller = *CB.getCaller();
139 *CB.getParent()->getParent()->getParent());
152 auto GetInlineCost = [&](CallBase &CB) {
153 Function &Callee = *CB.getCalledFunction();
158 return getInlineCost(CB, Params, CalleeTTI, GetAssumptionCache, GetTLI,
162 CB, GetInlineCost, ORE,
167 DefaultInlineAdvisor::getAdviceImpl(CallBase &CB) {
168 auto OIC = getDefaultInlineAdvice(CB, FAM, Params);
170 this, CB, OIC,
171 FAM.getResult<OptimizationRemarkEmitterAnalysis>(*CB.getCaller()));
174 InlineAdvice::InlineAdvice(InlineAdvisor *Advisor, CallBase &CB,
177 : Advisor(Advisor), Caller(CB.getCaller()), Callee(CB.getCalledFunction()),
178 DLoc(CB.getDebugLoc()), Block(CB.getParent()), ORE(ORE),
227 llvm::getDevelopmentModeAdvisor(M, MAM, [&FAM, Params](CallBase &CB) {
228 auto OIC = getDefaultInlineAdvice(CB, FAM, Params);
244 /// Return true if inlining of CB can block the caller from being
246 /// estimated inline cost associated with callsite \p CB.
248 /// caller if \p CB is suppressed for inlining.
251 function_ref<InlineCost(CallBase &CB)> GetInlineCost) {
255 // If the cost of inlining CB is non-positive, it is not going to prevent the
364 void llvm::setInlineRemark(CallBase &CB, StringRef Message) {
368 Attribute Attr = Attribute::get(CB.getContext(), "inline-remark", Message);
369 CB.addFnAttr(Attr);
377 llvm::shouldInline(CallBase &CB,
378 function_ref<InlineCost(CallBase &CB)> GetInlineCost,
382 InlineCost IC = GetInlineCost(CB);
383 Instruction *Call = &CB;
384 Function *Callee = CB.getCalledFunction();
385 Function *Caller = CB.getCaller();
389 << ", Call: " << CB << "\n");
395 << ", Call: " << CB << "\n");
411 setInlineRemark(CB, inlineCostStr(IC));
418 LLVM_DEBUG(dbgs() << " NOT Inlining: " << CB
428 setInlineRemark(CB, "deferred");
432 LLVM_DEBUG(dbgs() << " Inlining " << inlineCostStr(IC) << ", Call: " << CB
544 std::unique_ptr<InlineAdvice> InlineAdvisor::getMandatoryAdvice(CallBase &CB,
546 return std::make_unique<MandatoryInlineAdvice>(this, CB, getCallerORE(CB),
593 InlineAdvisor::getMandatoryKind(CallBase &CB, FunctionAnalysisManager &FAM,
595 auto &Callee = *CB.getCalledFunction();
604 llvm::getAttributeBasedInliningDecision(CB, &Callee, TIR, GetTLI);
615 std::unique_ptr<InlineAdvice> InlineAdvisor::getAdvice(CallBase &CB,
618 return getAdviceImpl(CB);
619 bool Advice = CB.getCaller() != CB.getCalledFunction() &&
621 getMandatoryKind(CB, FAM, getCallerORE(CB));
622 return getMandatoryAdvice(CB, Advice);
625 OptimizationRemarkEmitter &InlineAdvisor::getCallerORE(CallBase &CB) {
626 return FAM.getResult<OptimizationRemarkEmitterAnalysis>(*CB.getCaller());