Skip to content

AMDGPU: Document more backend recognized attributes #80239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions llvm/docs/AMDGPUUsage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,42 @@ The AMDGPU backend supports the following LLVM IR attributes.
the frame. This is an internal detail of how LDS variables are lowered,
language front ends should not set this attribute.

"amdgpu-gds-size" Bytes expected to be allocated at the start of GDS memory at entry.

"amdgpu-git-ptr-high" The hard-wired high half of the address of the global information table
for AMDPAL OS type. 0xffffffff represents no hard-wired high half, since
current hardware only allows a 16 bit value.

"amdgpu-32bit-address-high-bits" Assumed high 32-bits for 32-bit address spaces which are really truncated
64-bit addresses (i.e., addrspace(6))

"amdgpu-color-export" Indicates shader exports color information if set to 1.
Defaults to 1 for :ref:`amdgpu_ps <amdgpu-cc>`, and 0 for other calling
conventions. Determines the necessity and type of null exports when a shader
terminates early by killing lanes.

"amdgpu-depth-export" Indicates shader exports depth information if set to 1. Determines the
necessity and type of null exports when a shader terminates early by killing
lanes. A depth-only shader will export to depth channel when no null export
target is available (GFX11+).

"InitialPSInputAddr" Set the initial value of the `spi_ps_input_addr` register for
:ref:`amdgpu_ps <amdgpu-cc>` shaders. Any bits enabled by this value will
be enabled in the final register value.

"amdgpu-wave-priority-threshold" VALU instruction count threshold for adjusting wave priority. If exceeded,
temporarily raise the wave priority at the start of the shader function
until its last VMEM instructions to allow younger waves to issue their VMEM
instructions as well.

"amdgpu-memory-bound" Set internally by backend

"amdgpu-wave-limiter" Set internally by backend
Comment on lines +1480 to +1482
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LLPC sets these in some cases. Any explicit setting takes precedence over the backend's internal heuristics. But I'm not sure if we want to document that.


"amdgpu-unroll-threshold" Set base cost threshold preference for loop unrolling within this function,
default is 300. Actual threshold may be varied by per-loop metadata or
reduced by heuristics.

"amdgpu-max-num-workgroups"="x,y,z" Specify the maximum number of work groups for the kernel dispatch in the
X, Y, and Z dimensions. Generated by the ``amdgpu_max_num_work_groups``
CLANG attribute [CLANG-ATTR]_. Clang only emits this attribute when all
Expand Down