Skip to content

Commit 602634d

Browse files
[Transforms] Migrate to a new version of getValueProfDataFromInst (#95477)
Note that the version of getValueProfDataFromInst that returns bool has been "deprecated" since: commit 1e15371 Author: Mingming Liu <mingmingl@google.com> Date: Mon Apr 1 15:14:49 2024 -0700
1 parent 22ea97d commit 602634d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/Transforms/Instrumentation/CGProfile.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ static bool runCGProfilePass(Module &M, FunctionAnalysisManager &FAM,
7878
if (!CB)
7979
continue;
8080
if (CB->isIndirectCall()) {
81-
InstrProfValueData ValueData[8];
8281
uint32_t ActualNumValueData;
8382
uint64_t TotalC;
84-
if (!getValueProfDataFromInst(*CB, IPVK_IndirectCallTarget, 8,
85-
ValueData, ActualNumValueData, TotalC))
83+
auto ValueData = getValueProfDataFromInst(
84+
*CB, IPVK_IndirectCallTarget, 8, ActualNumValueData, TotalC);
85+
if (!ValueData)
8686
continue;
87-
for (const auto &VD :
88-
ArrayRef<InstrProfValueData>(ValueData, ActualNumValueData)) {
87+
for (const auto &VD : ArrayRef<InstrProfValueData>(
88+
ValueData.get(), ActualNumValueData)) {
8989
UpdateCounts(TTI, &F, Symtab.getFunction(VD.Value), VD.Count);
9090
}
9191
continue;

0 commit comments

Comments
 (0)