We had specified that `readBBAddrMap` will always keep PGOAnalyses and
BBAddrMaps the same length on success.
365fbbfbcf/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
28 KiB
28 KiB