[llvm] [DebugInfo][NVPTX] Adding support for `inlined_at` debug directive in NVPTX backend (PR #170239)
Laxman Sole via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 4 17:07:23 PST 2025
laxmansole wrote:
> Maybe some small examples would be helpful?
(Couldn't attach `.ll` or `.ptx` files)
[test.txt](https://github.com/user-attachments/files/23946075/test.txt)
[test.before.txt](https://github.com/user-attachments/files/23946074/test.before.txt)
[test.after.txt](https://github.com/user-attachments/files/23946072/test.after.txt)
Here's the diff - Left side is test.before.ptx and right side is test.after.ptx( generated usingchanges from this PR)
<img width="1507" height="1136" alt="image" src="https://github.com/user-attachments/assets/2b62a39a-f6f9-4e00-b62b-ee01b448c6c2" />
> I'm a bit confused by the implementation - at the start of the function, it scans for every inlined at location, then it checks if a given location has been found in that list and if it has, it emits it - but then removes these from the list?
>
> It's possible for an inlinedAt location to appear more than once - it gets inlined, then some other code gets hoisted or sunk into the middle of the inlined location - what's meant to happen there?
inlinedAt locations are added to the `DenseSet` to avoid emitting the same location multiple times, like the following `.locs` in this example.
`.loc 1 31 5 // test.cu:31:5`
`.loc 1 25 4, function_name $L__info_string0, inlined_at 1 31 5 // test.cu:25:4 `
> I'd have expected the inlinedAt data to be on every .loc that is inlined - but maybe it's stateful? where you record the instruction that's at the start of an inlinedAt region, and the one that's at the end/just past the end? That seems a bit unfortunate/awkward, if it is the case...
As seen in the example, all the .locs from the inlined function have `.loc` with `inlined_at`.
https://github.com/llvm/llvm-project/pull/170239
More information about the llvm-commits
mailing list