The NVPTX target disallows both labels in debug sections and label arithmetic,
so instead the content sizes are computed before writing. The new test
in "debug-pub.ll" was added for this specfic change. Also included
are the renabling of Data16bitsDirective and NVPTXTargetStreamer::emitRawBytes,
which have been fixed since CUDA 9.0, with the debuginfo tests updated for this.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
Removed the renabling of Data16bitsDirective and NVPTXTargetStreamer::emitRawBytes as it's
extraneous to the point of this patch and should be submitted in a new patch afterwards.
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.
Updated LLVM.DebugInfo/X86::dwarf-pubnames-split.ll test to remove the label arithmetic
Fixed my new test where I forgot to include the new lengths in the last update
Although I don't understand yet, why LLVM.DebugInfo/X86::debug-pubtables-dwarf64.ll is failing.
Yeah, they are just optional.
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | ||
---|---|---|
2338–2356 | I would guard this with the check for DwarfSectionsAsReferences flag. |
Used @ABataev suggestion of adding a "guard this with the check for DwarfSectionsAsReferences",
so that these changes are only used for targets that don't support labels in Dwarf sections.
Did you check if ptxas can process it correctly? Are there any problems with it? I did not see that nvcc generates these sections at all.
It can and you can check with ptxas $PTX_FILE -o $OUT && llvm-dwarfdump $OUT -debug-pubnames
To get nvcc to generate it you can use the example in their ptx interop guide, but you must pass the --device-debug / -G flag to nvcc for it to generate the "debug_pubnames" section.
I would guard this with the check for DwarfSectionsAsReferences flag.