[llvm] [SPIR-V] Emit DebugTypeBasic for NonSemantic DI (PR #106980)

Dmitry Sidorov via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 12 05:13:57 PDT 2024


https://github.com/MrSidims commented:

Sorry, I'm a bit too late for the party. This PR is LGTM, but I have several questions for the code around.
1st is related to https://github.com/llvm/llvm-project/pull/106980/files#diff-4b1404a35b0d0bc5726da0a1774bf36112350066a39a6d66690fd96186a438e1R106 - it seem too me, that currently only one CU is supported, is it correct? The SPIR-V specification (and LLVM and dwarf themselves) doesn't push a restriction to have a single CU in the module. In LLVM IR it would be looking like !llvm.dbg.cu = !{![[#CU1:]], ![[#CU2:]]} that can be generated by either clang if certain pragmas changing compilation options is added to the code or when 2 (or more) LLVM IR modules are linked via llvm-link (a common scenario for OpenMP Fortran applications, when C++ modules are linked with Fortran - there it's crucial to have both compilation unites preserved in debug information).
2nd: https://github.com/llvm/llvm-project/pull/106980/files#diff-4b1404a35b0d0bc5726da0a1774bf36112350066a39a6d66690fd96186a438e1R117 - if DWARF information doesn't exist in the module, we shouldn't guess the version but either put zero constant (current translator's behavior) or better DebugInfoNone (but expect translator to not parse such SPIR-V - probably this should be fixed there, didn't check it yet).

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


More information about the llvm-commits mailing list