Skip to content

Commit 22825dd

Browse files
committed
[AMDGPU][Docs] DWARF aspace-aware base types
Propose an extension to base type DIEs such that DW_ATE_address-encoded base types can include an architecture specific address space. Use this to implement DW_OP_convert conversions between AMDGPU address space addresses where meaningful.
1 parent 1393aeb commit 22825dd

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

llvm/docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3804,6 +3804,12 @@ A.5.1 Base Type Entries
38043804
entry, or allow some forms of ``DW_TAG_array_type`` (those that have the
38053805
``DW_AT_GNU_vector`` attribute) to be used as stack entry value types?
38063806

3807+
2. A ``DW_TAG_base_type`` debugger information entry with the encoding
3808+
``DW_ATE_address`` may have a ``DW_AT_LLVM_address_space`` attribute whose
3809+
value is an architecture specific address space (see
3810+
:ref:`amdgpu-dwarf-address-spaces`). If ommitted it defaults to
3811+
``DW_ASPACE_LLVM_none``.
3812+
38073813
.. _amdgpu-dwarf-type-modifier-entries:
38083814

38093815
A.5.3 Type Modifier Entries

llvm/docs/AMDGPUUsage.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2918,6 +2918,34 @@ controlled by the execution mask. An undefined location description together
29182918
with ``DW_OP_LLVM_extend`` is used to indicate the lane was not active on entry
29192919
to the subprogram. See :ref:`amdgpu-dwarf-dw-at-llvm-lane-pc` for an example.
29202920

2921+
.. _amdgpu-dwarf-base-type-conversions:
2922+
2923+
Base Type Conversions
2924+
---------------------
2925+
2926+
For AMDGPU expressions, ``DW_OP_convert`` may be used to convert between
2927+
``DW_ATE_address``-encoded base types in different address spaces.
2928+
2929+
Conversions are defined as in :ref:`amdgpu-address-spaces` when all relevant
2930+
conditions described there are met, and otherwise result in an evaluation
2931+
error.
2932+
2933+
.. note::
2934+
2935+
For a target which does not support a particular address space, converting to
2936+
or from that address space is always an evaluation error.
2937+
2938+
For targets which support the generic address space, converting from
2939+
``DW_ASPACE_AMDGPU_generic`` to ``DW_ASPACE_LLVM_none`` is always defined and
2940+
requires no change to the literal value of the address.
2941+
2942+
Converting from ``DW_ASPACE_AMDGPU_generic`` to any of
2943+
``DW_ASPACE_AMDGPU_local``, ``DW_ASPACE_AMDGPU_private_wave`` or
2944+
``DW_ASPACE_AMDGPU_private_lane`` is defined when the relevant hardware
2945+
support is present and setup has been completed. Conversion to
2946+
``DW_ASPACE_AMDGPU_private_lane`` additionally requires the context to
2947+
include the active lane.
2948+
29212949
Debugger Information Entry Attributes
29222950
-------------------------------------
29232951

0 commit comments

Comments
 (0)