[llvm] 72b841d - [Analysis] Migrate to a new version of getValueProfDataFromInst (#95561)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 14 09:59:18 PDT 2024
Author: Kazu Hirata
Date: 2024-06-14T09:59:15-07:00
New Revision: 72b841d016c7403ac1f7678d25b864dac80d06dc
URL: https://github.com/llvm/llvm-project/commit/72b841d016c7403ac1f7678d25b864dac80d06dc
DIFF: https://github.com/llvm/llvm-project/commit/72b841d016c7403ac1f7678d25b864dac80d06dc.diff
LOG: [Analysis] Migrate to a new version of getValueProfDataFromInst (#95561)
Note that the version of getValueProfDataFromInst that returns bool
has been "deprecated" since:
commit 1e15371dd8843dfc52b9435afaa133997c1773d8
Author: Mingming Liu <mingmingl at google.com>
Date: Mon Apr 1 15:14:49 2024 -0700
Added:
Modified:
llvm/lib/Analysis/IndirectCallPromotionAnalysis.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/IndirectCallPromotionAnalysis.cpp b/llvm/lib/Analysis/IndirectCallPromotionAnalysis.cpp
index ab53717eb889a..84b0a1b2a5387 100644
--- a/llvm/lib/Analysis/IndirectCallPromotionAnalysis.cpp
+++ b/llvm/lib/Analysis/IndirectCallPromotionAnalysis.cpp
@@ -91,13 +91,13 @@ ArrayRef<InstrProfValueData>
ICallPromotionAnalysis::getPromotionCandidatesForInstruction(
const Instruction *I, uint32_t &NumVals, uint64_t &TotalCount,
uint32_t &NumCandidates) {
- bool Res =
- getValueProfDataFromInst(*I, IPVK_IndirectCallTarget, MaxNumPromotions,
- ValueDataArray.get(), NumVals, TotalCount);
+ auto Res = getValueProfDataFromInst(*I, IPVK_IndirectCallTarget,
+ MaxNumPromotions, NumVals, TotalCount);
if (!Res) {
NumCandidates = 0;
return ArrayRef<InstrProfValueData>();
}
+ ValueDataArray = std::move(Res);
NumCandidates = getProfitablePromotionCandidates(I, NumVals, TotalCount);
return ArrayRef<InstrProfValueData>(ValueDataArray.get(), NumVals);
}
More information about the llvm-commits
mailing list