Page MenuHomePhabricator

Debug Info: Support address space attributes on rvalue references.
ClosedPublic

Authored by aprantl on May 6 2019, 5:26 PM.

Details

Summary

DWARF5, 2.12 20ff says that

Any debugging information entry representing a pointer or reference type [may have a DW_AT_address_class attribute]

The existing code (https://reviews.llvm.org/D29670) seems to take a quite literal interpretation of that wording. I don't see a reason why an rvalue reference isn't a reference type in the spirit of that paragraph. This patch allows rvalue references to also have address spaces.

Let me know if I'm missing something.

rdar://problem/50511483

Diff Detail

Repository
rL LLVM

Event Timeline

aprantl created this revision.May 6 2019, 5:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2019, 5:26 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
bjope added a subscriber: bjope.May 7 2019, 2:00 AM
bjope added inline comments.
llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
799 ↗(On Diff #198379)

nit: I figure the comment can be updated to say something like this:

"If DWARF address space value is other than None, add it. The IR verifier checks that DWARF address space only exists for pointer or reference types."

+1 to Bjorn's comment.
The DWARF spec says address class is also allowed on a "subroutine or subroutine type" do we allow generating code into nonzero address spaces?

+1 to Bjorn's comment.
The DWARF spec says address class is also allowed on a "subroutine or subroutine type" do we allow generating code into nonzero address spaces?

I don't know, but I wouldn't be surprised if we didn't. IIUC address spaces are used for heterogeneous computing to identify, e.g., which memory lives on a GPU vs the main memory, and in that case the code for the GPU would be generated by a different backend anyway, so the distinction is probably less useful?

This revision was not accepted when it landed; it landed in state Needs Review.May 7 2019, 10:42 AM
Closed by commit rL360176: Debug Info: Support address space attributes on rvalue references. (authored by adrian, committed by ). · Explain Why
This revision was automatically updated to reflect the committed changes.