[PATCH] D118098: [InstrProf][correlation] Read DWARFv5 `OP_addrx` location

Ellis Hoag via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 25 10:36:26 PST 2022


ellis added inline comments.


================
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);
----------------
dblaikie wrote:
> 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))
Ah thanks, that makes the code much simpler!


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