[llvm] c44e9ff - [IndirectCallPromotion] Use ArrayRef consistently (NFC) (#96412)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 28 12:32:07 PDT 2024
Author: Kazu Hirata
Date: 2024-06-28T12:32:03-07:00
New Revision: c44e9ff691a10cd900b93d9ff4e0ada355ca82d7
URL: https://github.com/llvm/llvm-project/commit/c44e9ff691a10cd900b93d9ff4e0ada355ca82d7
DIFF: https://github.com/llvm/llvm-project/commit/c44e9ff691a10cd900b93d9ff4e0ada355ca82d7.diff
LOG: [IndirectCallPromotion] Use ArrayRef consistently (NFC) (#96412)
Added:
Modified:
llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
Removed:
################################################################################
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<PromotionCandidate> getPromotionCandidatesForCallSite(
- const CallBase &CB, const ArrayRef<InstrProfValueData> &ValueDataRef,
+ const CallBase &CB, ArrayRef<InstrProfValueData> 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<PromotionCandidate> &Candidates,
- uint64_t TotalCount, ArrayRef<InstrProfValueData> ICallProfDataRef,
- uint32_t NumCandidates);
+ bool tryToPromoteWithFuncCmp(CallBase &CB,
+ ArrayRef<PromotionCandidate> Candidates,
+ uint64_t TotalCount,
+ ArrayRef<InstrProfValueData> 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::PromotionCandidate>
IndirectCallPromoter::getPromotionCandidatesForCallSite(
- const CallBase &CB, const ArrayRef<InstrProfValueData> &ValueDataRef,
+ const CallBase &CB, ArrayRef<InstrProfValueData> ValueDataRef,
uint64_t TotalCount, uint32_t NumCandidates) {
std::vector<PromotionCandidate> 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<PromotionCandidate> &Candidates,
- uint64_t TotalCount, ArrayRef<InstrProfValueData> ICallProfDataRef,
- uint32_t NumCandidates) {
+ CallBase &CB, ArrayRef<PromotionCandidate> Candidates, uint64_t TotalCount,
+ ArrayRef<InstrProfValueData> ICallProfDataRef, uint32_t NumCandidates) {
uint32_t NumPromoted = 0;
for (const auto &C : Candidates) {
More information about the llvm-commits
mailing list