[PATCH] D88196: [DEBUGINFO, NVPTX] Removed Label Arithmetic from DWARF Pub Sections for NVPTX

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 3 10:58:11 PDT 2020


ABataev added a comment.

In D88196#2310275 <https://reviews.llvm.org/D88196#2310275>, @jdtatz wrote:

> In D88196#2292440 <https://reviews.llvm.org/D88196#2292440>, @ABataev wrote:
>
>> If I do recall it correctly, NVPTX debug info does not support pub sections. You just need to tweak the frontend to disable emission of pub sections (need to add `, nameTableKind: None` to the DICompileUnit)
>
> Sorry that I took so long to respond.
> But I was able to find information on which dwarf sections ptx supports in the official documentation.
> https://docs.nvidia.com/cuda/ptx-writers-guide-to-interoperability/index.html#debug-information
> They also mention that they support the "debug_aranges" section which is currently disabled for only the NVPTX backend, but I could re-enable it if that's ok.

Yeah, they are just optional.



================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:2338-2356
+  unsigned OffsetByteSize = Asm->getDwarfOffsetByteSize();
+  unsigned UnitLengthFieldByteSize = Asm->getUnitLengthFieldByteSize();
+  // Emit size of content not including length itself.
+  unsigned ContentSize = sizeof(int16_t) + // DWARF version number
+                         OffsetByteSize +  // Offset of CU in the .debug_info
+                                           // section
+                         UnitLengthFieldByteSize + // Compilation Unit Length
----------------
I would guard this with the check for `DwarfSectionsAsReferences` flag.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88196



More information about the llvm-commits mailing list