[SHT_LLVM_BB_ADDR_MAP] Fixes two bugs in decoding of PGOAnalyses in BBAddrMap. (#77139)
We had specified that `readBBAddrMap` will always keep PGOAnalyses and BBAddrMaps the same length on success. https://github.com/llvm/llvm-project/blob/365fbbfbcfefb8766f7716109b9c3767b58e6058/llvm/include/llvm/Object/ELFObjectFile.h#L116-L117 It turns out that this is not currently the case when no analyses exist in a function. No test had caught it. We also should not append PGOBBEntries when there is no BBFreq or BrProb. This patch adds: * tests that PGOAnalyses and BBAddrMaps are same length even when no analyses are enabled * fixes decode so that PGOAnalyses and BBAddrMaps are same length * updates test to not emit unnecessary PGOBBEntries * fixes decode to not emit PGOBBEntries when unnecessary
Loading
Please sign in to comment