[PATCH] D83468: [Debuginfo] Fix for PR46653

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 14 12:25:20 PDT 2020


probinson added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1990
   // (The new location might be an explicit line 0, which we do emit.)
-  if (DL.getLine() == 0 && LastAsmLine == 0)
+  if (DL.getLine() == 0 && LastAsmLine != 0)
     return;
----------------
Jac1494 wrote:
> probinson wrote:
> > It looks like this change will suppress emitting an explicit line-0 location.  We definitely want to emit line-0 in many cases, so this patch is going too far.
> Can you please provide me testcase where line entry "0" is required..?
> I couldn't find the use case.
For example, the tail-merge.ll test that was modified.  It should not be modified.
When merging identical instructions that were originally attributed to different source locations, we cannot preserve both source attributions because the debug-info formats do not allow it.  Preserving either one of the original source locations provides the correct answer only 50% of the time, which is bad both for the debugging experience and for sample-based PGO.
Therefore, we intentionally assign the merged instruction to line 0, which in DWARF means "no definitive source location."  CodeView has a similar concept although it is encoded differently.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83468/new/

https://reviews.llvm.org/D83468





More information about the llvm-commits mailing list