[llvm] [llvm-objdump] Add support for symbolizing PGOBBAddrMap Info (PR #76386)
Micah Weston via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 19 06:52:33 PST 2024
================
@@ -1638,18 +1691,24 @@ disassembleObject(ObjectFile &Obj, const ObjectFile &DbgObj,
LLVM_DEBUG(LVP.dump());
std::unordered_map<uint64_t, BBAddrMap> AddrToBBAddrMap;
+ std::unordered_map<uint64_t, PGOAnalysisMap> AddrToPGOAnalysisMap;
auto ReadBBAddrMap = [&](std::optional<unsigned> SectionIndex =
std::nullopt) {
AddrToBBAddrMap.clear();
if (const auto *Elf = dyn_cast<ELFObjectFileBase>(&Obj)) {
- auto BBAddrMapsOrErr = Elf->readBBAddrMap(SectionIndex);
+ std::vector<PGOAnalysisMap> PGOAnalyses;
+ auto BBAddrMapsOrErr = Elf->readBBAddrMap(SectionIndex, &PGOAnalyses);
if (!BBAddrMapsOrErr) {
reportWarning(toString(BBAddrMapsOrErr.takeError()), Obj.getFileName());
return;
}
- for (auto &FunctionBBAddrMap : *BBAddrMapsOrErr)
- AddrToBBAddrMap.emplace(FunctionBBAddrMap.Addr,
- std::move(FunctionBBAddrMap));
+ for (auto &&[FunctionBBAddrMap, FunctionPGOAnalysis] :
----------------
red1bluelost wrote:
I don't think `auto &` and `auto &&` make a difference in the generated code for this case. Part of my reasoning (beyond it just being the habit I've built) for using `auto &&` is the fact that we move values out within the loop.
https://github.com/llvm/llvm-project/pull/76386
More information about the llvm-commits
mailing list