[PATCH] D45784: [DEBUG_INFO, NVPTX] Fix relocation info.

Eric Christopher via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 8 21:00:22 PST 2018


echristo added a comment.

In https://reviews.llvm.org/D45784#1224910, @ABataev wrote:

> In https://reviews.llvm.org/D45784#1224027, @echristo wrote:
>
> > Rather than testing for isNVPTX in AsmPrinter.cpp I'd rather just make a function "emitPreFunctionDebugInfo" and have it do nothing unless it's NVPTX and then define this in the nvptx backend. Easier to update if nvidia ever fixes this weirdness too.
>
>
> Seems to me you were looking to the very first patch. The last one looks exactly like you want. Switch to the latest revision.


Closer, I think you can do all of this in the NVPTX backend by just having something emit an "empty" line directive where you want rather than needing to redo the target independent code. Just call recordSourceLine with bogus information in the backend? Do you need a real location or can something that looks like the line number program initial state work for you? If you need a valid one then it's possible you could run into problems with multiple cus in a single input file (which I agree is less than likely with cuda, but I don't want to discount the possibility of people linking cuda modules together).

Thoughts?

-eric


Repository:
  rL LLVM

https://reviews.llvm.org/D45784





More information about the llvm-commits mailing list