[PATCH] D118098: [InstrProf][correlation] Read DWARFv5 `OP_addrx` location
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 24 20:18:51 PST 2022
dblaikie added inline comments.
================
Comment at: llvm/lib/ProfileData/InstrProfCorrelator.cpp:131-134
+ if (Data.empty() || Names.empty())
+ return make_error<InstrProfError>(
+ instrprof_error::unable_to_correlate_profile,
+ "could not find any profile metadata in debug info");
----------------
This should probably be committed separately & ideally with a test case.
================
Comment at: llvm/lib/ProfileData/InstrProfCorrelator.cpp:187-193
+ uint64_t Index = Op.getRawOperand(0);
+ auto Offset = DU.getAddrOffsetSectionBase();
+ if (!Offset.hasValue())
+ continue;
+ // FIXME: Perhaps we should be using DWARFDebugAddrTable
+ uint64_t RawOffset = *Offset + Index * AddressSize;
+ return AddrSectionData.getAddress(&RawOffset);
----------------
Could you use `DWARFUnit::getAddrOffsetSectionItem`, perhaps?
(& I guess this would be committed along with an additional test case that covers DWARFv5 or swapping back the temporary change for the existing test case (probably should keep some v4 coverage too, for the DW_OP_addr case above))
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118098/new/
https://reviews.llvm.org/D118098
More information about the llvm-commits
mailing list