[llvm] [ProfileData] Remove getValueProfDataFromInst (PR #95617)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 14 15:41:21 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-pgo
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
I've migrated all uses to the new version of getValueProfDataFromInst
that returns std::unique_ptr<InstrProfValueData[]>.
---
Full diff: https://github.com/llvm/llvm-project/pull/95617.diff
2 Files Affected:
- (modified) llvm/include/llvm/ProfileData/InstrProf.h (-10)
- (modified) llvm/lib/ProfileData/InstrProf.cpp (-16)
``````````diff
diff --git a/llvm/include/llvm/ProfileData/InstrProf.h b/llvm/include/llvm/ProfileData/InstrProf.h
index 0c899e6d84965..32913236ec5ed 100644
--- a/llvm/include/llvm/ProfileData/InstrProf.h
+++ b/llvm/include/llvm/ProfileData/InstrProf.h
@@ -284,16 +284,6 @@ void annotateValueSite(Module &M, Instruction &Inst,
ArrayRef<InstrProfValueData> VDs, uint64_t Sum,
InstrProfValueKind ValueKind, uint32_t MaxMDCount);
-/// Extract the value profile data from \p Inst which is annotated with
-/// value profile meta data. Return false if there is no value data annotated,
-/// otherwise return true.
-bool getValueProfDataFromInst(const Instruction &Inst,
- InstrProfValueKind ValueKind,
- uint32_t MaxNumValueData,
- InstrProfValueData ValueData[],
- uint32_t &ActualNumValueData, uint64_t &TotalC,
- bool GetNoICPValue = false);
-
/// Extract the value profile data from \p Inst and returns them if \p Inst is
/// annotated with value profile data. Returns nullptr otherwise. It's similar
/// to `getValueProfDataFromInst` above except that an array is allocated only
diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp
index a0662a5976bbe..8cc1625e1c05c 100644
--- a/llvm/lib/ProfileData/InstrProf.cpp
+++ b/llvm/lib/ProfileData/InstrProf.cpp
@@ -1381,22 +1381,6 @@ getValueProfDataFromInst(const Instruction &Inst, InstrProfValueKind ValueKind,
return ValueDataArray;
}
-// FIXME: Migrate existing callers to the function above that returns an
-// array.
-bool getValueProfDataFromInst(const Instruction &Inst,
- InstrProfValueKind ValueKind,
- uint32_t MaxNumValueData,
- InstrProfValueData ValueData[],
- uint32_t &ActualNumValueData, uint64_t &TotalC,
- bool GetNoICPValue) {
- MDNode *MD = mayHaveValueProfileOfKind(Inst, ValueKind);
- if (!MD)
- return false;
- return getValueProfDataFromInstImpl(MD, MaxNumValueData, ValueData,
- ActualNumValueData, TotalC,
- GetNoICPValue);
-}
-
MDNode *getPGOFuncNameMetadata(const Function &F) {
return F.getMetadata(getPGOFuncNameMetadataName());
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/95617
More information about the llvm-commits
mailing list