Skip to content

[Analysis] Migrate to a new version of getValueProfDataFromInst #95561

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

Conversation

kazutakahirata
Copy link
Contributor

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

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
@llvmbot
Copy link
Member

llvmbot commented Jun 14, 2024

@llvm/pr-subscribers-llvm-analysis

Author: Kazu Hirata (kazutakahirata)

Changes

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


Full diff: https://github.com/llvm/llvm-project/pull/95561.diff

1 Files Affected:

  • (modified) llvm/lib/Analysis/IndirectCallPromotionAnalysis.cpp (+3-3)
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);
 }

@kazutakahirata kazutakahirata merged commit 72b841d into llvm:main Jun 14, 2024
7 of 8 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_getValueProfDataFromInst_IndirectCallPromo branch June 14, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants