[llvm] [llvm][DebugInfo] Attach object-pointer to DISubprogram declarations (PR #122742)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 15 09:55:18 PST 2025


dwblaikie wrote:

> > > No, it cannot be, nvptx do not support label differences, it is very old DWARF2 +some extensions
> > 
> > 
> > That's one of several suggestions I made - good to understand why that particular one is infeasible. But scoping down the testing would be good. Like maybe don't check the abbrevs at all in most cases, just check the annotated comments that describe the values expected. Maybe include the values in the comments (like the tag comments include the abbrev number and DIE offset - the DW_AT_name comment could include the string name, rather than matching 20 lines of ASCII integers)
> 
> Not sure it will reduce the maintenance burden significantly

I'm pretty sure anything would be better than doing nothing here.

> > It's also just a huge generic test covering 200 functions. This isn't generally how LLVM is tested - small, isolated examples using a handful (usually one or two, almost definitely single digits) of functions and instructions, not integration tests exercising all manner of functionality (the name's a hint too - it's called "debug-info.ll" rather than testing some specific feature of debug info)
> 
> Am I missing something? There is only one small function `_Z5saxpyifPfS_`, which is already reduced version of the original code. This minimal reproducer allowed to test ptx support for debug info.

While there's only one llvm Function, there's 200 DISubprograms in the DWARF - a bunch of intrinsics, by the looks of it.
Removing those would probably help reduce the size a fair bit - could be done by removing `imports: !3, ` and all the associated metadata that references.

> Last thing. These tests not only test the debug info, but also its format in ptx. It checks that there is no label arithmetics, no strings, etc.

Testing for the absence of things may be better done with a separate invocation using CHECK-NOT, or --implicit-check-not. Without needing to check every line of output.

> Forgot to mention. Ptx does not support string literals in debug info, only byte/word/etc. values (at least before, not sure it has changed).

Right, I figured as much - that's why I was suggesting having the comments include the textual string and checking against that, rather than against every numeric character code.

https://github.com/llvm/llvm-project/pull/122742


More information about the llvm-commits mailing list