[llvm] [ProfileData] Clean up validateRecord (PR #95488)
Mingming Liu via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 13 17:44:12 PDT 2024
================
@@ -1035,16 +1035,13 @@ static const char *ValueProfKindStr[] = {
Error InstrProfWriter::validateRecord(const InstrProfRecord &Func) {
for (uint32_t VK = 0; VK <= IPVK_Last; VK++) {
- uint32_t NS = Func.getNumValueSites(VK);
- if (!NS)
+ if (VK == IPVK_IndirectCallTarget || VK == IPVK_VTableTarget)
continue;
+ uint32_t NS = Func.getNumValueSites(VK);
for (uint32_t S = 0; S < NS; S++) {
- uint32_t ND = Func.getNumValueDataForSite(VK, S);
- std::unique_ptr<InstrProfValueData[]> VD = Func.getValueForSite(VK, S);
DenseSet<uint64_t> SeenValues;
- for (uint32_t I = 0; I < ND; I++)
- if ((VK != IPVK_IndirectCallTarget && VK != IPVK_VTableTarget) &&
----------------
minglotus-6 wrote:
https://github.com/llvm/llvm-project/commit/a4b543a5a541eeff5a7ba92ada4b0d809a2c8482 reports errors on duplicated values.
I'm going to be away from keyboard for sometime but curious to dig the rationale before that commit (no need to wait for my dig for this change).
https://github.com/llvm/llvm-project/pull/95488
More information about the llvm-commits
mailing list