[PATCH] D94123: [NVPTX] Strip debugging symbols for optimized NVPTX targets.

Joseph Huber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 5 15:56:23 PST 2021


jhuber6 added a comment.

In D94123#2480633 <https://reviews.llvm.org/D94123#2480633>, @tra wrote:

> There's  `--cuda-noopt-device-debug` option specifically to allow compiling GPU code with full debug info. Clang will generate optimized PTX, but ptxas optimizations will be disabled.
>
> Without that flag clang automatically downgrades debug info generation to lineinfo only. I think `-fsave-optimization-record` should do the same.
> Adding a pass to strip debug info may not be the best place to deal with the issue. I think not enabling full debug info would be a better choice.



In D94123#2480633 <https://reviews.llvm.org/D94123#2480633>, @tra wrote:

> There's  `--cuda-noopt-device-debug` option specifically to allow compiling GPU code with full debug info. Clang will generate optimized PTX, but ptxas optimizations will be disabled.
>
> Without that flag clang automatically downgrades debug info generation to lineinfo only. I think `-fsave-optimization-record` should do the same.
> Adding a pass to strip debug info may not be the best place to deal with the issue. I think not enabling full debug info would be a better choice.

Okay, so without that flag Clang will not create debug symbols in the PTX assembly output. And if the user specified `--cuda-noopt-device-debug` then the Cuda driver will not pass the optimization flags to the ptxas invocation, right? So if that's the case, then the problem with `-fsave-optimization-record` is that it's not being correctly picked up as generating debug info. So the solution here would be to make sure it treats that flag as debug information. You should be able to see it not working by checking the `*.s` output when build with `-fsave-optimization-record` having `debug` in the target.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94123



More information about the llvm-commits mailing list