================ @@ -140,14 +337,51 @@ class IndirectCallPromoter { // indirect callee with functions. Returns true if there are IR // transformations and false otherwise. bool tryToPromoteWithFuncCmp( - CallBase &CB, const std::vector<PromotionCandidate> &Candidates, - uint64_t TotalCount, ArrayRef<InstrProfValueData> ICallProfDataRef, - uint32_t NumCandidates); + CallBase &CB, Instruction *VPtr, + const std::vector<PromotionCandidate> &Candidates, uint64_t TotalCount, + ArrayRef<InstrProfValueData> ICallProfDataRef, uint32_t NumCandidates, + VTableGUIDCountsMap &VTableGUIDCounts); + + // Promote a list of targets for one indirect call by comparing vtables with + // functions. Returns true if there are IR transformations and false + // otherwise. + bool tryToPromoteWithVTableCmp( + CallBase &CB, Instruction *VPtr, + const std::vector<PromotionCandidate> &Candidates, + uint64_t TotalFuncCount, uint32_t NumCandidates, + MutableArrayRef<InstrProfValueData> ICallProfDataRef, + VTableGUIDCountsMap &VTableGUIDCounts); + + // Returns true if it's profitable to compare vtables. + bool isProfitableToCompareVTables( + const std::vector<PromotionCandidate> &Candidates, uint64_t TotalCount); + + // Populate `VTableGUIDCounts` vtable GUIDs and their counts and each ---------------- minglotus-6 wrote:
I updated the function comment. https://github.com/llvm/llvm-project/pull/81442 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits