Lines Matching defs:CB
353 const CallBase &CB, ArrayRef<InstrProfValueData> ValueDataRef,
359 bool tryToPromoteWithFuncCmp(CallBase &CB, Instruction *VPtr,
370 CallBase &CB, Instruction *VPtr, ArrayRef<PromotionCandidate> Candidates,
376 bool isProfitableToCompareVTables(const CallBase &CB,
390 Instruction *computeVTableInfos(const CallBase *CB,
397 void updateFuncValueProfiles(CallBase &CB, ArrayRef<InstrProfValueData> VDs,
426 const CallBase &CB, ArrayRef<InstrProfValueData> ValueDataRef,
430 LLVM_DEBUG(dbgs() << " \nWork on callsite #" << NumOfPGOICallsites << CB
447 if (ICPInvokeOnly && isa<CallInst>(CB)) {
450 return OptimizationRemarkMissed(DEBUG_TYPE, "UserOptions", &CB)
455 if (ICPCallOnly && isa<InvokeInst>(CB)) {
458 return OptimizationRemarkMissed(DEBUG_TYPE, "UserOptions", &CB)
466 return OptimizationRemarkMissed(DEBUG_TYPE, "CutOffReached", &CB)
483 return OptimizationRemarkMissed(DEBUG_TYPE, "UnableToFindTarget", &CB)
491 if (!isLegalToPromote(CB, TargetFunction, &Reason)) {
495 return OptimizationRemarkMissed(DEBUG_TYPE, "UnableToPromote", &CB)
519 const CallBase *CB, VTableGUIDCountsMap &GUIDCountsMap,
548 auto Iter = VirtualCSInfo.find(CB);
618 CallBase &llvm::pgo::promoteIndirectCall(CallBase &CB, Function *DirectCallee,
623 CB, DirectCallee,
624 createBranchWeights(CB.getContext(), Count, TotalCount - Count));
634 return OptimizationRemark(DEBUG_TYPE, "Promoted", &CB)
644 CallBase &CB, Instruction *VPtr, ArrayRef<PromotionCandidate> Candidates,
651 pgo::promoteIndirectCall(CB, C.TargetFunction, FuncCount, TotalCount,
683 updateFuncValueProfiles(CB, ICallProfDataRef.slice(NumPromoted), TotalCount,
690 CallBase &CB, ArrayRef<InstrProfValueData> CallVDs, uint64_t TotalCount,
693 CB.setMetadata(LLVMContext::MD_prof, nullptr);
696 annotateValueSite(M, CB, CallVDs, TotalCount, IPVK_IndirectCallTarget,
725 CallBase &CB, Instruction *VPtr, ArrayRef<PromotionCandidate> Candidates,
737 // block and indirect call `CB` is moved into this new BB.
738 BasicBlock *OriginalBB = CB.getParent();
740 CB, VPtr, Candidate.TargetFunction, Candidate.AddressPoints,
741 createBranchWeights(CB.getContext(), Candidate.Count,
744 int SinkCount = tryToSinkInstructions(OriginalBB, CB.getParent());
747 OptimizationRemark Remark(DEBUG_TYPE, "Promoted", &CB);
789 // Update value profiles for 'CB' and 'VPtr', assuming that each 'CB' has a
810 updateFuncValueProfiles(CB, VDs, TotalFuncCount, NumCandidates);
820 for (auto *CB : findIndirectCalls(F)) {
824 CB, TotalCount, NumCandidates);
830 *CB, ICallProfDataRef, TotalCount, NumCandidates);
834 computeVTableInfos(CB, VTableGUIDCounts, PromotionCandidates);
836 if (isProfitableToCompareVTables(*CB, PromotionCandidates))
837 Changed |= tryToPromoteWithVTableCmp(*CB, VPtr, PromotionCandidates,
841 Changed |= tryToPromoteWithFuncCmp(*CB, VPtr, PromotionCandidates,
851 const CallBase &CB, ArrayRef<PromotionCandidate> Candidates) {
855 << NumOfPGOICallsites << CB << "\n");
974 CallBase &CB = DevirtCall.CB;
978 PGOIndirectCallVisitor::tryGetVTableInstruction(&CB);
981 VirtualCSInfo[&CB] = {DevirtCall.Offset, VTablePtr,