User Guide for AMDGPU Backend#

Introduction#

The AMDGPU backend provides ISA code generation for AMD GPUs, starting with the R600 family up until the current GCN families. It lives in the llvm/lib/Target/AMDGPU directory.

LLVM#

Target Triples#

Use the Clang option --target=<Architecture><SubArch>-<Vendor>-<OS>-<Environment> to specify the target triple.

Note

Historically, the single top-level amdgcn architecture was used for all devices and specific devices by the subtarget. It has been replaced with the amdgpu architecture combined with a subarch suffix. The legacy spelling is accepted for accepted for compatibility.

AMDGPU Architectures#

Architecture

Description

r600

AMD GPUs HD2XXX-HD6XXX for graphics and compute shaders.

amdgpu

AMD GPUs GCN GFX6 onwards for graphics and compute shaders.

amdgcn

Legacy alias for amdgpu.

The following table lists each major subarch and the minor subarches it covers. The Default Processor column gives the generic processor that a major subarch selects by default for code generation; this is the corresponding generic processor for families that have one (see AMDGPU Generic Processors). Major subarches listed as (none) are placeholders for families that do not yet have a generic target. See Subarchitecture Compatibility for how subarches are matched.

AMDGPU Subarchitectures#

Major Subarch

Default Processor

Covered Subarches (Processor)

amdgpu6

(none)

amdgpu6.00 (gfx600), amdgpu6.01 (gfx601), amdgpu6.02 (gfx602)

amdgpu7

(none)

amdgpu7.00 (gfx700), amdgpu7.01 (gfx701), amdgpu7.02 (gfx702), amdgpu7.03 (gfx703), amdgpu7.04 (gfx704), amdgpu7.05 (gfx705)

amdgpu8

(none)

amdgpu8.01 (gfx801), amdgpu8.02 (gfx802), amdgpu8.03 (gfx803), amdgpu8.05 (gfx805)

amdgpu8.10

(none)

amdgpu8.10 (gfx810)

amdgpu9

gfx9-generic

amdgpu9.00 (gfx900), amdgpu9.02 (gfx902), amdgpu9.04 (gfx904), amdgpu9.06 (gfx906), amdgpu9.09 (gfx909), amdgpu9.0c (gfx90c)

amdgpu9.08

(none)

amdgpu9.08 (gfx908)

amdgpu9.0a