-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[IndirectCallPromotion] Migrate to a new version of getValueProfDataFromInst #97357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IndirectCallPromotion] Migrate to a new version of getValueProfDataFromInst #97357
Conversation
@llvm/pr-subscribers-pgo @llvm/pr-subscribers-llvm-transforms Author: Kazu Hirata (kazutakahirata) ChangesFull diff: https://github.com/llvm/llvm-project/pull/97357.diff 1 Files Affected:
diff --git a/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp b/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
index 6a5aeeb8b52cc..0d1f506986379 100644
--- a/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
+++ b/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
@@ -547,18 +547,17 @@ Instruction *IndirectCallPromoter::computeVTableInfos(
for (size_t I = 0; I < Candidates.size(); I++)
CalleeIndexMap[Candidates[I].TargetFunction] = I;
- uint32_t ActualNumValueData = 0;
uint64_t TotalVTableCount = 0;
- auto VTableValueDataArray = getValueProfDataFromInst(
- *VirtualCallInfo.VPtr, IPVK_VTableTarget, MaxNumVTableAnnotations,
- ActualNumValueData, TotalVTableCount);
- if (VTableValueDataArray.get() == nullptr)
+ auto VTableValueDataArray =
+ getValueProfDataFromInst(*VirtualCallInfo.VPtr, IPVK_VTableTarget,
+ MaxNumVTableAnnotations, TotalVTableCount);
+ if (VTableValueDataArray.empty())
return VPtr;
// Compute the functions and counts from by each vtable.
- for (size_t j = 0; j < ActualNumValueData; j++) {
- uint64_t VTableVal = VTableValueDataArray[j].Value;
- GUIDCountsMap[VTableVal] = VTableValueDataArray[j].Count;
+ for (const auto &V : VTableValueDataArray) {
+ uint64_t VTableVal = V.Value;
+ GUIDCountsMap[VTableVal] = V.Count;
GlobalVariable *VTableVar = Symtab->getGlobalVariable(VTableVal);
if (!VTableVar) {
LLVM_DEBUG(dbgs() << " Cannot find vtable definition for " << VTableVal
@@ -586,7 +585,7 @@ Instruction *IndirectCallPromoter::computeVTableInfos(
// There shouldn't be duplicate GUIDs in one !prof metadata (except
// duplicated zeros), so assign counters directly won't cause overwrite or
// counter loss.
- Candidate.VTableGUIDAndCounts[VTableVal] = VTableValueDataArray[j].Count;
+ Candidate.VTableGUIDAndCounts[VTableVal] = V.Count;
Candidate.AddressPoints.push_back(
getOrCreateVTableAddressPointVar(VTableVar, AddressPointOffset));
}
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/162/builds/1200 Here is the relevant piece of the build log for the reference:
|
No description provided.