[PATCH] D85085: Fix debug_loc offset difference with basic block sections

Sriraman Tallam via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 1 21:42:22 PDT 2020


tmsriram created this revision.
tmsriram added reviewers: aprantl, dblaikie, amharc.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
tmsriram requested review of this revision.
Herald added a subscriber: ormris.

debug_loc for params not used in entry block need to be computed with the section start as the base label.

The attached test will not assemble without the patch as the assembler will complain that we are trying to compute a label difference from 2 different sections.

If the basic block containing the first mention of the param is not in the  same section as the entry basic block, we cannot use the CurrentFnBegin label. To fix it, we use the Section begin label instead. Using the Section Label will result in loss of debug loc fidelity as we do not capture the basic blocks before the start of this section.

Right now, LabelsBeforeInsn just stores one label for each insn.  We can fix the fidelity problem by storing all the basic block section labels that appear before the insn and generating a difference for each of them.  Hence, I have made this as a FIXME.

Is this alright?  I am not very familiar with debug_loc,  other better suggestions are much appreciated here.


https://reviews.llvm.org/D85085

Files:
  llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
  llvm/test/DebugInfo/X86/basic-block-sections-debug-loc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85085.282426.patch
Type: text/x-patch
Size: 7794 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200802/dc94d303/attachment.bin>


More information about the llvm-commits mailing list