[llvm] [Analysis] Migrate to a new version of getValueProfDataFromInst (PR #95561)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 14 09:16:41 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-analysis

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

Note that the version of getValueProfDataFromInst that returns bool
has been "deprecated" since:

  commit 1e15371dd8843dfc52b9435afaa133997c1773d8
  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
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);
 }

``````````

</details>


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


More information about the llvm-commits mailing list