diff --git a/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp b/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp index bb8019b5c31d8..fe9eaae9ac7ea 100644 --- a/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp +++ b/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp @@ -133,16 +133,17 @@ class IndirectCallPromoter { // TotalCount is the total profiled count of call executions, and // NumCandidates is the number of candidate entries in ValueDataRef. std::vector getPromotionCandidatesForCallSite( - const CallBase &CB, const ArrayRef &ValueDataRef, + const CallBase &CB, ArrayRef ValueDataRef, uint64_t TotalCount, uint32_t NumCandidates); // Promote a list of targets for one indirect-call callsite by comparing // indirect callee with functions. Returns true if there are IR // transformations and false otherwise. - bool tryToPromoteWithFuncCmp( - CallBase &CB, const std::vector &Candidates, - uint64_t TotalCount, ArrayRef ICallProfDataRef, - uint32_t NumCandidates); + bool tryToPromoteWithFuncCmp(CallBase &CB, + ArrayRef Candidates, + uint64_t TotalCount, + ArrayRef ICallProfDataRef, + uint32_t NumCandidates); public: IndirectCallPromoter(Function &Func, InstrProfSymtab *Symtab, bool SamplePGO, @@ -160,7 +161,7 @@ class IndirectCallPromoter { // the count. Stop at the first target that is not promoted. std::vector IndirectCallPromoter::getPromotionCandidatesForCallSite( - const CallBase &CB, const ArrayRef &ValueDataRef, + const CallBase &CB, ArrayRef ValueDataRef, uint64_t TotalCount, uint32_t NumCandidates) { std::vector Ret; @@ -277,9 +278,8 @@ CallBase &llvm::pgo::promoteIndirectCall(CallBase &CB, Function *DirectCallee, // Promote indirect-call to conditional direct-call for one callsite. bool IndirectCallPromoter::tryToPromoteWithFuncCmp( - CallBase &CB, const std::vector &Candidates, - uint64_t TotalCount, ArrayRef ICallProfDataRef, - uint32_t NumCandidates) { + CallBase &CB, ArrayRef Candidates, uint64_t TotalCount, + ArrayRef ICallProfDataRef, uint32_t NumCandidates) { uint32_t NumPromoted = 0; for (const auto &C : Candidates) {