Lines Matching defs:CB
345 const CallBase &CB, ArrayRef<InstrProfValueData> ValueDataRef,
351 bool tryToPromoteWithFuncCmp(CallBase &CB, Instruction *VPtr,
362 CallBase &CB, Instruction *VPtr, ArrayRef<PromotionCandidate> Candidates,
368 bool isProfitableToCompareVTables(const CallBase &CB,
379 Instruction *computeVTableInfos(const CallBase *CB,
386 void updateFuncValueProfiles(CallBase &CB, ArrayRef<InstrProfValueData> VDs,
414 const CallBase &CB, ArrayRef<InstrProfValueData> ValueDataRef,
418 LLVM_DEBUG(dbgs() << " \nWork on callsite #" << NumOfPGOICallsites << CB
435 if (ICPInvokeOnly && isa<CallInst>(CB)) {
438 return OptimizationRemarkMissed(DEBUG_TYPE, "UserOptions", &CB)
443 if (ICPCallOnly && isa<InvokeInst>(CB)) {
446 return OptimizationRemarkMissed(DEBUG_TYPE, "UserOptions", &CB)
454 return OptimizationRemarkMissed(DEBUG_TYPE, "CutOffReached", &CB)
471 return OptimizationRemarkMissed(DEBUG_TYPE, "UnableToFindTarget", &CB)
479 if (!isLegalToPromote(CB, TargetFunction, &Reason)) {
483 return OptimizationRemarkMissed(DEBUG_TYPE, "UnableToPromote", &CB)
507 const CallBase *CB, VTableGUIDCountsMap &GUIDCountsMap,
536 auto Iter = VirtualCSInfo.find(CB);
606 CallBase &llvm::pgo::promoteIndirectCall(CallBase &CB, Function *DirectCallee,
611 CB, DirectCallee,
612 createBranchWeights(CB.getContext(), Count, TotalCount - Count));
622 return OptimizationRemark(DEBUG_TYPE, "Promoted", &CB)
632 CallBase &CB, Instruction *VPtr, ArrayRef<PromotionCandidate> Candidates,
639 pgo::promoteIndirectCall(CB, C.TargetFunction, FuncCount, TotalCount,
671 updateFuncValueProfiles(CB, ICallProfDataRef.slice(NumPromoted), TotalCount,
678 CallBase &CB, ArrayRef<InstrProfValueData> CallVDs, uint64_t TotalCount,
681 CB.setMetadata(LLVMContext::MD_prof, nullptr);
684 annotateValueSite(M, CB, CallVDs, TotalCount, IPVK_IndirectCallTarget,
713 CallBase &CB, Instruction *VPtr, ArrayRef<PromotionCandidate> Candidates,
725 // block and indirect call `CB` is moved into this new BB.
726 BasicBlock *OriginalBB = CB.getParent();
728 CB, VPtr, Candidate.TargetFunction, Candidate.AddressPoints,
729 createBranchWeights(CB.getContext(), Candidate.Count,
732 int SinkCount = tryToSinkInstructions(OriginalBB, CB.getParent());
735 OptimizationRemark Remark(DEBUG_TYPE, "Promoted", &CB);
777 // Update value profiles for 'CB' and 'VPtr', assuming that each 'CB' has a
798 updateFuncValueProfiles(CB, VDs, TotalFuncCount, NumCandidates);
808 for (auto *CB : findIndirectCalls(F)) {
812 CB, TotalCount, NumCandidates);
818 *CB, ICallProfDataRef, TotalCount, NumCandidates);
822 computeVTableInfos(CB, VTableGUIDCounts, PromotionCandidates);
824 if (isProfitableToCompareVTables(*CB, PromotionCandidates, TotalCount))
825 Changed |= tryToPromoteWithVTableCmp(*CB, VPtr, PromotionCandidates,
829 Changed |= tryToPromoteWithFuncCmp(*CB, VPtr, PromotionCandidates,
839 const CallBase &CB, ArrayRef<PromotionCandidate> Candidates,
844 << NumOfPGOICallsites << CB << "\n");
948 CallBase &CB = DevirtCall.CB;
952 PGOIndirectCallVisitor::tryGetVTableInstruction(&CB);
955 VirtualCSInfo[&CB] = {DevirtCall.Offset, VTablePtr,